aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/wm831x/core.h40
-rw-r--r--include/linux/mfd/wm831x/pdata.h1
2 files changed, 30 insertions, 11 deletions
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index d01d293a6b25..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.
@@ -236,6 +235,8 @@
236 235
237struct regulator_dev; 236struct regulator_dev;
238 237
238#define WM831X_NUM_IRQ_REGS 5
239
239struct wm831x { 240struct wm831x {
240 struct mutex io_lock; 241 struct mutex io_lock;
241 242
@@ -249,10 +250,9 @@ struct wm831x {
249 250
250 int irq; /* Our chip IRQ */ 251 int irq; /* Our chip IRQ */
251 struct mutex irq_lock; 252 struct mutex irq_lock;
252 struct workqueue_struct *irq_wq;
253 struct work_struct irq_work;
254 unsigned int irq_base; 253 unsigned int irq_base;
255 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 256
257 int num_gpio; 257 int num_gpio;
258 258
@@ -281,12 +281,30 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
281int wm831x_irq_init(struct wm831x *wm831x, int irq); 281int wm831x_irq_init(struct wm831x *wm831x, int irq);
282void wm831x_irq_exit(struct wm831x *wm831x); 282void wm831x_irq_exit(struct wm831x *wm831x);
283 283
284int __must_check wm831x_request_irq(struct wm831x *wm831x, 284static inline int __must_check wm831x_request_irq(struct wm831x *wm831x,
285 unsigned int irq, irq_handler_t handler, 285 unsigned int irq,
286 unsigned long flags, const char *name, 286 irq_handler_t handler,
287 void *dev); 287 unsigned long flags,
288void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *); 288 const char *name,
289void wm831x_disable_irq(struct wm831x *wm831x, int irq); 289 void *dev)
290void wm831x_enable_irq(struct wm831x *wm831x, int irq); 290{
291 return request_threaded_irq(irq, NULL, handler, flags, name, dev);
292}
293
294static inline void wm831x_free_irq(struct wm831x *wm831x,
295 unsigned int irq, void *dev)
296{
297 free_irq(irq, dev);
298}
299
300static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq)
301{
302 disable_irq(irq);
303}
304
305static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq)
306{
307 enable_irq(irq);
308}
291 309
292#endif 310#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index 90d820260aad..415c228743d5 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -91,6 +91,7 @@ struct wm831x_pdata {
91 /** Called after subdevices are set up */ 91 /** Called after subdevices are set up */
92 int (*post_init)(struct wm831x *wm831x); 92 int (*post_init)(struct wm831x *wm831x);
93 93
94 int irq_base;
94 int gpio_base; 95 int gpio_base;
95 struct wm831x_backlight_pdata *backlight; 96 struct wm831x_backlight_pdata *backlight;
96 struct wm831x_backup_pdata *backup; 97 struct wm831x_backup_pdata *backup;