diff options
Diffstat (limited to 'include/linux/pinctrl/pinctrl.h')
-rw-r--r-- | include/linux/pinctrl/pinctrl.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 04c011038f32..8bd22ee7aa09 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | struct pinctrl_dev; | 22 | struct pinctrl_dev; |
23 | struct pinmux_ops; | 23 | struct pinmux_ops; |
24 | struct pinconf_ops; | ||
24 | struct gpio_chip; | 25 | struct gpio_chip; |
25 | 26 | ||
26 | /** | 27 | /** |
@@ -45,6 +46,7 @@ struct pinctrl_pin_desc { | |||
45 | * @name: a name for the chip in this range | 46 | * @name: a name for the chip in this range |
46 | * @id: an ID number for the chip in this range | 47 | * @id: an ID number for the chip in this range |
47 | * @base: base offset of the GPIO range | 48 | * @base: base offset of the GPIO range |
49 | * @pin_base: base pin number of the GPIO range | ||
48 | * @npins: number of pins in the GPIO range, including the base number | 50 | * @npins: number of pins in the GPIO range, including the base number |
49 | * @gc: an optional pointer to a gpio_chip | 51 | * @gc: an optional pointer to a gpio_chip |
50 | */ | 52 | */ |
@@ -53,6 +55,7 @@ struct pinctrl_gpio_range { | |||
53 | const char *name; | 55 | const char *name; |
54 | unsigned int id; | 56 | unsigned int id; |
55 | unsigned int base; | 57 | unsigned int base; |
58 | unsigned int pin_base; | ||
56 | unsigned int npins; | 59 | unsigned int npins; |
57 | struct gpio_chip *gc; | 60 | struct gpio_chip *gc; |
58 | }; | 61 | }; |
@@ -89,22 +92,20 @@ struct pinctrl_ops { | |||
89 | * this pin controller | 92 | * this pin controller |
90 | * @npins: number of descriptors in the array, usually just ARRAY_SIZE() | 93 | * @npins: number of descriptors in the array, usually just ARRAY_SIZE() |
91 | * of the pins field above | 94 | * of the pins field above |
92 | * @maxpin: since pin spaces may be sparse, there can he "holes" in the | ||
93 | * pin range, this attribute gives the maximum pin number in the | ||
94 | * total range. This should not be lower than npins for example, | ||
95 | * but may be equal to npins if you have no holes in the pin range. | ||
96 | * @pctlops: pin control operation vtable, to support global concepts like | 95 | * @pctlops: pin control operation vtable, to support global concepts like |
97 | * grouping of pins, this is optional. | 96 | * grouping of pins, this is optional. |
98 | * @pmxops: pinmux operation vtable, if you support pinmuxing in your driver | 97 | * @pmxops: pinmux operations vtable, if you support pinmuxing in your driver |
98 | * @confops: pin config operations vtable, if you support pin configuration in | ||
99 | * your driver | ||
99 | * @owner: module providing the pin controller, used for refcounting | 100 | * @owner: module providing the pin controller, used for refcounting |
100 | */ | 101 | */ |
101 | struct pinctrl_desc { | 102 | struct pinctrl_desc { |
102 | const char *name; | 103 | const char *name; |
103 | struct pinctrl_pin_desc const *pins; | 104 | struct pinctrl_pin_desc const *pins; |
104 | unsigned int npins; | 105 | unsigned int npins; |
105 | unsigned int maxpin; | ||
106 | struct pinctrl_ops *pctlops; | 106 | struct pinctrl_ops *pctlops; |
107 | struct pinmux_ops *pmxops; | 107 | struct pinmux_ops *pmxops; |
108 | struct pinconf_ops *confops; | ||
108 | struct module *owner; | 109 | struct module *owner; |
109 | }; | 110 | }; |
110 | 111 | ||
@@ -123,7 +124,7 @@ extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); | |||
123 | 124 | ||
124 | struct pinctrl_dev; | 125 | struct pinctrl_dev; |
125 | 126 | ||
126 | /* Sufficiently stupid default function when pinctrl is not in use */ | 127 | /* Sufficiently stupid default functions when pinctrl is not in use */ |
127 | static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) | 128 | static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) |
128 | { | 129 | { |
129 | return pin >= 0; | 130 | return pin >= 0; |