diff options
Diffstat (limited to 'include/linux/mfd/wm831x/core.h')
-rw-r--r-- | include/linux/mfd/wm831x/core.h | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 91eb493bf14c..5184b79c700b 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #define __MFD_WM831X_CORE_H__ | 16 | #define __MFD_WM831X_CORE_H__ |
17 | 17 | ||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/workqueue.h> | ||
20 | 19 | ||
21 | /* | 20 | /* |
22 | * Register values. | 21 | * Register values. |
@@ -117,6 +116,7 @@ | |||
117 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 | 116 | #define WM831X_DC3_SLEEP_CONTROL 0x4063 |
118 | #define WM831X_DC4_CONTROL 0x4064 | 117 | #define WM831X_DC4_CONTROL 0x4064 |
119 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 | 118 | #define WM831X_DC4_SLEEP_CONTROL 0x4065 |
119 | #define WM832X_DC4_SLEEP_CONTROL 0x4067 | ||
120 | #define WM831X_EPE1_CONTROL 0x4066 | 120 | #define WM831X_EPE1_CONTROL 0x4066 |
121 | #define WM831X_EPE2_CONTROL 0x4067 | 121 | #define WM831X_EPE2_CONTROL 0x4067 |
122 | #define WM831X_LDO1_CONTROL 0x4068 | 122 | #define WM831X_LDO1_CONTROL 0x4068 |
@@ -235,6 +235,8 @@ | |||
235 | 235 | ||
236 | struct regulator_dev; | 236 | struct regulator_dev; |
237 | 237 | ||
238 | #define WM831X_NUM_IRQ_REGS 5 | ||
239 | |||
238 | struct wm831x { | 240 | struct wm831x { |
239 | struct mutex io_lock; | 241 | struct mutex io_lock; |
240 | 242 | ||
@@ -248,10 +250,11 @@ struct wm831x { | |||
248 | 250 | ||
249 | int irq; /* Our chip IRQ */ | 251 | int irq; /* Our chip IRQ */ |
250 | struct mutex irq_lock; | 252 | struct mutex irq_lock; |
251 | struct workqueue_struct *irq_wq; | ||
252 | struct work_struct irq_work; | ||
253 | unsigned int irq_base; | 253 | unsigned int irq_base; |
254 | int irq_masks[5]; | 254 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ |
255 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | ||
256 | |||
257 | int num_gpio; | ||
255 | 258 | ||
256 | struct mutex auxadc_lock; | 259 | struct mutex auxadc_lock; |
257 | 260 | ||
@@ -278,12 +281,30 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, | |||
278 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 281 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
279 | void wm831x_irq_exit(struct wm831x *wm831x); | 282 | void wm831x_irq_exit(struct wm831x *wm831x); |
280 | 283 | ||
281 | int __must_check wm831x_request_irq(struct wm831x *wm831x, | 284 | static inline int __must_check wm831x_request_irq(struct wm831x *wm831x, |
282 | unsigned int irq, irq_handler_t handler, | 285 | unsigned int irq, |
283 | unsigned long flags, const char *name, | 286 | irq_handler_t handler, |
284 | void *dev); | 287 | unsigned long flags, |
285 | void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *); | 288 | const char *name, |
286 | void wm831x_disable_irq(struct wm831x *wm831x, int irq); | 289 | void *dev) |
287 | void wm831x_enable_irq(struct wm831x *wm831x, int irq); | 290 | { |
291 | return request_threaded_irq(irq, NULL, handler, flags, name, dev); | ||
292 | } | ||
293 | |||
294 | static inline void wm831x_free_irq(struct wm831x *wm831x, | ||
295 | unsigned int irq, void *dev) | ||
296 | { | ||
297 | free_irq(irq, dev); | ||
298 | } | ||
299 | |||
300 | static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq) | ||
301 | { | ||
302 | disable_irq(irq); | ||
303 | } | ||
304 | |||
305 | static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq) | ||
306 | { | ||
307 | enable_irq(irq); | ||
308 | } | ||
288 | 309 | ||
289 | #endif | 310 | #endif |