diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-samsung.h')
-rw-r--r-- | drivers/pinctrl/pinctrl-samsung.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/pinctrl/pinctrl-samsung.h b/drivers/pinctrl/pinctrl-samsung.h index b8956934cda6..5addfd16e3cc 100644 --- a/drivers/pinctrl/pinctrl-samsung.h +++ b/drivers/pinctrl/pinctrl-samsung.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/pinctrl/consumer.h> | 23 | #include <linux/pinctrl/consumer.h> |
24 | #include <linux/pinctrl/machine.h> | 24 | #include <linux/pinctrl/machine.h> |
25 | 25 | ||
26 | #include <linux/gpio.h> | ||
27 | |||
26 | /* register offsets within a pin bank */ | 28 | /* register offsets within a pin bank */ |
27 | #define DAT_REG 0x4 | 29 | #define DAT_REG 0x4 |
28 | #define PUD_REG 0x8 | 30 | #define PUD_REG 0x8 |
@@ -64,6 +66,7 @@ enum pincfg_type { | |||
64 | * @EINT_TYPE_NONE: bank does not support external interrupts | 66 | * @EINT_TYPE_NONE: bank does not support external interrupts |
65 | * @EINT_TYPE_GPIO: bank supportes external gpio interrupts | 67 | * @EINT_TYPE_GPIO: bank supportes external gpio interrupts |
66 | * @EINT_TYPE_WKUP: bank supportes external wakeup interrupts | 68 | * @EINT_TYPE_WKUP: bank supportes external wakeup interrupts |
69 | * @EINT_TYPE_WKUP_MUX: bank supports multiplexed external wakeup interrupts | ||
67 | * | 70 | * |
68 | * Samsung GPIO controller groups all the available pins into banks. The pins | 71 | * Samsung GPIO controller groups all the available pins into banks. The pins |
69 | * in a pin bank can support external gpio interrupts or external wakeup | 72 | * in a pin bank can support external gpio interrupts or external wakeup |
@@ -76,6 +79,7 @@ enum eint_type { | |||
76 | EINT_TYPE_NONE, | 79 | EINT_TYPE_NONE, |
77 | EINT_TYPE_GPIO, | 80 | EINT_TYPE_GPIO, |
78 | EINT_TYPE_WKUP, | 81 | EINT_TYPE_WKUP, |
82 | EINT_TYPE_WKUP_MUX, | ||
79 | }; | 83 | }; |
80 | 84 | ||
81 | /* maximum length of a pin in pin descriptor (example: "gpa0-0") */ | 85 | /* maximum length of a pin in pin descriptor (example: "gpa0-0") */ |
@@ -109,8 +113,12 @@ struct samsung_pinctrl_drv_data; | |||
109 | * @conpdn_width: width of the sleep mode function selector bin field. | 113 | * @conpdn_width: width of the sleep mode function selector bin field. |
110 | * @pudpdn_width: width of the sleep mode pull up/down selector bit field. | 114 | * @pudpdn_width: width of the sleep mode pull up/down selector bit field. |
111 | * @eint_type: type of the external interrupt supported by the bank. | 115 | * @eint_type: type of the external interrupt supported by the bank. |
112 | * @irq_base: starting controller local irq number of the bank. | ||
113 | * @name: name to be prefixed for each pin in this pin bank. | 116 | * @name: name to be prefixed for each pin in this pin bank. |
117 | * @of_node: OF node of the bank. | ||
118 | * @drvdata: link to controller driver data | ||
119 | * @irq_domain: IRQ domain of the bank. | ||
120 | * @gpio_chip: GPIO chip of the bank. | ||
121 | * @grange: linux gpio pin range supported by this bank. | ||
114 | */ | 122 | */ |
115 | struct samsung_pin_bank { | 123 | struct samsung_pin_bank { |
116 | u32 pctl_offset; | 124 | u32 pctl_offset; |
@@ -122,8 +130,13 @@ struct samsung_pin_bank { | |||
122 | u8 conpdn_width; | 130 | u8 conpdn_width; |
123 | u8 pudpdn_width; | 131 | u8 pudpdn_width; |
124 | enum eint_type eint_type; | 132 | enum eint_type eint_type; |
125 | u32 irq_base; | 133 | u32 eint_offset; |
126 | char *name; | 134 | char *name; |
135 | struct device_node *of_node; | ||
136 | struct samsung_pinctrl_drv_data *drvdata; | ||
137 | struct irq_domain *irq_domain; | ||
138 | struct gpio_chip gpio_chip; | ||
139 | struct pinctrl_gpio_range grange; | ||
127 | }; | 140 | }; |
128 | 141 | ||
129 | /** | 142 | /** |
@@ -132,8 +145,6 @@ struct samsung_pin_bank { | |||
132 | * @nr_banks: number of pin banks. | 145 | * @nr_banks: number of pin banks. |
133 | * @base: starting system wide pin number. | 146 | * @base: starting system wide pin number. |
134 | * @nr_pins: number of pins supported by the controller. | 147 | * @nr_pins: number of pins supported by the controller. |
135 | * @nr_gint: number of external gpio interrupts supported. | ||
136 | * @nr_wint: number of external wakeup interrupts supported. | ||
137 | * @geint_con: offset of the ext-gpio controller registers. | 148 | * @geint_con: offset of the ext-gpio controller registers. |
138 | * @geint_mask: offset of the ext-gpio interrupt mask registers. | 149 | * @geint_mask: offset of the ext-gpio interrupt mask registers. |
139 | * @geint_pend: offset of the ext-gpio interrupt pending registers. | 150 | * @geint_pend: offset of the ext-gpio interrupt pending registers. |
@@ -153,8 +164,6 @@ struct samsung_pin_ctrl { | |||
153 | 164 | ||
154 | u32 base; | 165 | u32 base; |
155 | u32 nr_pins; | 166 | u32 nr_pins; |
156 | u32 nr_gint; | ||
157 | u32 nr_wint; | ||
158 | 167 | ||
159 | u32 geint_con; | 168 | u32 geint_con; |
160 | u32 geint_mask; | 169 | u32 geint_mask; |
@@ -183,8 +192,6 @@ struct samsung_pin_ctrl { | |||
183 | * @nr_groups: number of such pin groups. | 192 | * @nr_groups: number of such pin groups. |
184 | * @pmx_functions: list of pin functions available to the driver. | 193 | * @pmx_functions: list of pin functions available to the driver. |
185 | * @nr_function: number of such pin functions. | 194 | * @nr_function: number of such pin functions. |
186 | * @gc: gpio_chip instance registered with gpiolib. | ||
187 | * @grange: linux gpio pin range supported by this controller. | ||
188 | */ | 195 | */ |
189 | struct samsung_pinctrl_drv_data { | 196 | struct samsung_pinctrl_drv_data { |
190 | void __iomem *virt_base; | 197 | void __iomem *virt_base; |
@@ -199,12 +206,6 @@ struct samsung_pinctrl_drv_data { | |||
199 | unsigned int nr_groups; | 206 | unsigned int nr_groups; |
200 | const struct samsung_pmx_func *pmx_functions; | 207 | const struct samsung_pmx_func *pmx_functions; |
201 | unsigned int nr_functions; | 208 | unsigned int nr_functions; |
202 | |||
203 | struct irq_domain *gpio_irqd; | ||
204 | struct irq_domain *wkup_irqd; | ||
205 | |||
206 | struct gpio_chip *gc; | ||
207 | struct pinctrl_gpio_range grange; | ||
208 | }; | 209 | }; |
209 | 210 | ||
210 | /** | 211 | /** |
@@ -235,5 +236,6 @@ struct samsung_pmx_func { | |||
235 | 236 | ||
236 | /* list of all exported SoC specific data */ | 237 | /* list of all exported SoC specific data */ |
237 | extern struct samsung_pin_ctrl exynos4210_pin_ctrl[]; | 238 | extern struct samsung_pin_ctrl exynos4210_pin_ctrl[]; |
239 | extern struct samsung_pin_ctrl exynos4x12_pin_ctrl[]; | ||
238 | 240 | ||
239 | #endif /* __PINCTRL_SAMSUNG_H */ | 241 | #endif /* __PINCTRL_SAMSUNG_H */ |