1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Intel Tangier pinctrl functions
5 * Copyright (C) 2016, 2023 Intel Corporation
7 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 * Raag Jadav <raag.jadav@intel.com>
11 #ifndef PINCTRL_TANGIER_H
12 #define PINCTRL_TANGIER_H
14 #include <linux/spinlock_types.h>
15 #include <linux/types.h>
17 #include <linux/pinctrl/pinctrl.h>
19 #include "pinctrl-intel.h"
22 struct platform_device
;
24 #define TNG_FAMILY_NR 64
25 #define TNG_FAMILY_LEN 0x400
28 * struct tng_family - Tangier pin family description
29 * @barno: MMIO BAR number where registers for this family reside
30 * @pin_base: Starting pin of pins in this family
31 * @npins: Number of pins in this family
32 * @protected: True if family is protected by access
33 * @regs: Family specific common registers
37 unsigned int pin_base
;
43 #define TNG_FAMILY(b, s, e) \
47 .npins = (e) - (s) + 1, \
50 #define TNG_FAMILY_PROTECTED(b, s, e) \
54 .npins = (e) - (s) + 1, \
59 * struct tng_pinctrl - Tangier pinctrl private structure
60 * @dev: Pointer to the device structure
61 * @lock: Lock to serialize register access
62 * @pctldesc: Pin controller description
63 * @pctldev: Pointer to the pin controller device
64 * @families: Array of families this pinctrl handles
65 * @nfamilies: Number of families in the array
66 * @functions: Array of functions
67 * @nfunctions: Number of functions in the array
68 * @groups: Array of pin groups
69 * @ngroups: Number of groups in the array
70 * @pins: Array of pins this pinctrl controls
71 * @npins: Number of pins in the array
76 struct pinctrl_desc pctldesc
;
77 struct pinctrl_dev
*pctldev
;
79 /* Pin controller configuration */
80 const struct tng_family
*families
;
82 const struct intel_function
*functions
;
84 const struct intel_pingroup
*groups
;
86 const struct pinctrl_pin_desc
*pins
;
90 int devm_tng_pinctrl_probe(struct platform_device
*pdev
);
92 #endif /* PINCTRL_TANGIER_H */