diff options
Diffstat (limited to 'include/linux/mfd/ucb1x00.h')
-rw-r--r-- | include/linux/mfd/ucb1x00.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h index 4321f044d1e4..28af41756360 100644 --- a/include/linux/mfd/ucb1x00.h +++ b/include/linux/mfd/ucb1x00.h | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/mfd/mcp.h> | 13 | #include <linux/mfd/mcp.h> |
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
15 | #include <linux/semaphore.h> | 15 | #include <linux/mutex.h> |
16 | 16 | ||
17 | #define UCB_IO_DATA 0x00 | 17 | #define UCB_IO_DATA 0x00 |
18 | #define UCB_IO_DIR 0x01 | 18 | #define UCB_IO_DIR 0x01 |
@@ -104,17 +104,27 @@ | |||
104 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) | 104 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) |
105 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) | 105 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) |
106 | 106 | ||
107 | enum ucb1x00_reset { | ||
108 | UCB_RST_PROBE, | ||
109 | UCB_RST_RESUME, | ||
110 | UCB_RST_SUSPEND, | ||
111 | UCB_RST_REMOVE, | ||
112 | UCB_RST_PROBE_FAIL, | ||
113 | }; | ||
107 | 114 | ||
108 | struct ucb1x00_irq { | 115 | struct ucb1x00_plat_data { |
109 | void *devid; | 116 | void (*reset)(enum ucb1x00_reset); |
110 | void (*fn)(int, void *); | 117 | unsigned irq_base; |
118 | int gpio_base; | ||
119 | unsigned can_wakeup; | ||
111 | }; | 120 | }; |
112 | 121 | ||
113 | struct ucb1x00 { | 122 | struct ucb1x00 { |
114 | spinlock_t lock; | 123 | raw_spinlock_t irq_lock; |
115 | struct mcp *mcp; | 124 | struct mcp *mcp; |
116 | unsigned int irq; | 125 | unsigned int irq; |
117 | struct semaphore adc_sem; | 126 | int irq_base; |
127 | struct mutex adc_mutex; | ||
118 | spinlock_t io_lock; | 128 | spinlock_t io_lock; |
119 | u16 id; | 129 | u16 id; |
120 | u16 io_dir; | 130 | u16 io_dir; |
@@ -122,7 +132,8 @@ struct ucb1x00 { | |||
122 | u16 adc_cr; | 132 | u16 adc_cr; |
123 | u16 irq_fal_enbl; | 133 | u16 irq_fal_enbl; |
124 | u16 irq_ris_enbl; | 134 | u16 irq_ris_enbl; |
125 | struct ucb1x00_irq irq_handler[16]; | 135 | u16 irq_mask; |
136 | u16 irq_wake; | ||
126 | struct device dev; | 137 | struct device dev; |
127 | struct list_head node; | 138 | struct list_head node; |
128 | struct list_head devs; | 139 | struct list_head devs; |
@@ -144,7 +155,7 @@ struct ucb1x00_driver { | |||
144 | struct list_head devs; | 155 | struct list_head devs; |
145 | int (*add)(struct ucb1x00_dev *dev); | 156 | int (*add)(struct ucb1x00_dev *dev); |
146 | void (*remove)(struct ucb1x00_dev *dev); | 157 | void (*remove)(struct ucb1x00_dev *dev); |
147 | int (*suspend)(struct ucb1x00_dev *dev, pm_message_t state); | 158 | int (*suspend)(struct ucb1x00_dev *dev); |
148 | int (*resume)(struct ucb1x00_dev *dev); | 159 | int (*resume)(struct ucb1x00_dev *dev); |
149 | }; | 160 | }; |
150 | 161 | ||
@@ -245,15 +256,4 @@ unsigned int ucb1x00_adc_read(struct ucb1x00 *ucb, int adc_channel, int sync); | |||
245 | void ucb1x00_adc_enable(struct ucb1x00 *ucb); | 256 | void ucb1x00_adc_enable(struct ucb1x00 *ucb); |
246 | void ucb1x00_adc_disable(struct ucb1x00 *ucb); | 257 | void ucb1x00_adc_disable(struct ucb1x00 *ucb); |
247 | 258 | ||
248 | /* | ||
249 | * Which edges of the IRQ do you want to control today? | ||
250 | */ | ||
251 | #define UCB_RISING (1 << 0) | ||
252 | #define UCB_FALLING (1 << 1) | ||
253 | |||
254 | int ucb1x00_hook_irq(struct ucb1x00 *ucb, unsigned int idx, void (*fn)(int, void *), void *devid); | ||
255 | void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
256 | void ucb1x00_disable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
257 | int ucb1x00_free_irq(struct ucb1x00 *ucb, unsigned int idx, void *devid); | ||
258 | |||
259 | #endif | 259 | #endif |