aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/stmpe.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd/stmpe.h')
-rw-r--r--include/linux/mfd/stmpe.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index 48395a69a7e9..575a86c7fcbd 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -11,6 +11,7 @@
11#include <linux/mutex.h> 11#include <linux/mutex.h>
12 12
13struct device; 13struct device;
14struct regulator;
14 15
15enum stmpe_block { 16enum stmpe_block {
16 STMPE_BLOCK_GPIO = 1 << 0, 17 STMPE_BLOCK_GPIO = 1 << 0,
@@ -62,6 +63,8 @@ struct stmpe_client_info;
62 63
63/** 64/**
64 * struct stmpe - STMPE MFD structure 65 * struct stmpe - STMPE MFD structure
66 * @vcc: optional VCC regulator
67 * @vio: optional VIO regulator
65 * @lock: lock protecting I/O operations 68 * @lock: lock protecting I/O operations
66 * @irq_lock: IRQ bus lock 69 * @irq_lock: IRQ bus lock
67 * @dev: device, mostly for dev_dbg() 70 * @dev: device, mostly for dev_dbg()
@@ -73,13 +76,14 @@ struct stmpe_client_info;
73 * @regs: list of addresses of registers which are at different addresses on 76 * @regs: list of addresses of registers which are at different addresses on
74 * different variants. Indexed by one of STMPE_IDX_*. 77 * different variants. Indexed by one of STMPE_IDX_*.
75 * @irq: irq number for stmpe 78 * @irq: irq number for stmpe
76 * @irq_base: starting IRQ number for internal IRQs
77 * @num_gpios: number of gpios, differs for variants 79 * @num_gpios: number of gpios, differs for variants
78 * @ier: cache of IER registers for bus_lock 80 * @ier: cache of IER registers for bus_lock
79 * @oldier: cache of IER registers for bus_lock 81 * @oldier: cache of IER registers for bus_lock
80 * @pdata: platform data 82 * @pdata: platform data
81 */ 83 */
82struct stmpe { 84struct stmpe {
85 struct regulator *vcc;
86 struct regulator *vio;
83 struct mutex lock; 87 struct mutex lock;
84 struct mutex irq_lock; 88 struct mutex irq_lock;
85 struct device *dev; 89 struct device *dev;
@@ -91,7 +95,6 @@ struct stmpe {
91 const u8 *regs; 95 const u8 *regs;
92 96
93 int irq; 97 int irq;
94 int irq_base;
95 int num_gpios; 98 int num_gpios;
96 u8 ier[2]; 99 u8 ier[2];
97 u8 oldier[2]; 100 u8 oldier[2];
@@ -132,8 +135,6 @@ struct stmpe_keypad_platform_data {
132 135
133/** 136/**
134 * struct stmpe_gpio_platform_data - STMPE GPIO platform data 137 * struct stmpe_gpio_platform_data - STMPE GPIO platform data
135 * @gpio_base: first gpio number assigned. A maximum of
136 * %STMPE_NR_GPIOS GPIOs will be allocated.
137 * @norequest_mask: bitmask specifying which GPIOs should _not_ be 138 * @norequest_mask: bitmask specifying which GPIOs should _not_ be
138 * requestable due to different usage (e.g. touch, keypad) 139 * requestable due to different usage (e.g. touch, keypad)
139 * STMPE_GPIO_NOREQ_* macros can be used here. 140 * STMPE_GPIO_NOREQ_* macros can be used here.
@@ -141,7 +142,6 @@ struct stmpe_keypad_platform_data {
141 * @remove: board specific remove callback 142 * @remove: board specific remove callback
142 */ 143 */
143struct stmpe_gpio_platform_data { 144struct stmpe_gpio_platform_data {
144 int gpio_base;
145 unsigned norequest_mask; 145 unsigned norequest_mask;
146 void (*setup)(struct stmpe *stmpe, unsigned gpio_base); 146 void (*setup)(struct stmpe *stmpe, unsigned gpio_base);
147 void (*remove)(struct stmpe *stmpe, unsigned gpio_base); 147 void (*remove)(struct stmpe *stmpe, unsigned gpio_base);
@@ -195,8 +195,6 @@ struct stmpe_ts_platform_data {
195 * @irq_trigger: IRQ trigger to use for the interrupt to the host 195 * @irq_trigger: IRQ trigger to use for the interrupt to the host
196 * @autosleep: bool to enable/disable stmpe autosleep 196 * @autosleep: bool to enable/disable stmpe autosleep
197 * @autosleep_timeout: inactivity timeout in milliseconds for autosleep 197 * @autosleep_timeout: inactivity timeout in milliseconds for autosleep
198 * @irq_base: base IRQ number. %STMPE_NR_IRQS irqs will be used, or
199 * %STMPE_NR_INTERNAL_IRQS if the GPIO driver is not used.
200 * @irq_over_gpio: true if gpio is used to get irq 198 * @irq_over_gpio: true if gpio is used to get irq
201 * @irq_gpio: gpio number over which irq will be requested (significant only if 199 * @irq_gpio: gpio number over which irq will be requested (significant only if
202 * irq_over_gpio is true) 200 * irq_over_gpio is true)
@@ -207,7 +205,6 @@ struct stmpe_ts_platform_data {
207struct stmpe_platform_data { 205struct stmpe_platform_data {
208 int id; 206 int id;
209 unsigned int blocks; 207 unsigned int blocks;
210 int irq_base;
211 unsigned int irq_trigger; 208 unsigned int irq_trigger;
212 bool autosleep; 209 bool autosleep;
213 bool irq_over_gpio; 210 bool irq_over_gpio;
@@ -219,10 +216,4 @@ struct stmpe_platform_data {
219 struct stmpe_ts_platform_data *ts; 216 struct stmpe_ts_platform_data *ts;
220}; 217};
221 218
222#define STMPE_NR_INTERNAL_IRQS 9
223#define STMPE_INT_GPIO(x) (STMPE_NR_INTERNAL_IRQS + (x))
224
225#define STMPE_NR_GPIOS 24
226#define STMPE_NR_IRQS STMPE_INT_GPIO(STMPE_NR_GPIOS)
227
228#endif 219#endif