diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-28 02:08:51 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-04-28 02:12:16 -0400 |
commit | acad9853b95df6a3887f52e0ec88e4a77119ee28 (patch) | |
tree | 8e43801e6e5ebb245d5e90f73ef36bbfce3f6184 | |
parent | f5346668150c37094b42cc2d07ec5fd1451eb980 (diff) |
Input: wm831x-ts - allow IRQ flags to be specified
This allows maximum flexibility for configuring the direct GPIO based
interrupts.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/touchscreen/wm831x-ts.c | 16 | ||||
-rw-r--r-- | include/linux/mfd/wm831x/pdata.h | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index b9373012b3e6..78e8705df20d 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c | |||
@@ -241,7 +241,7 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
241 | struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent); | 241 | struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent); |
242 | struct wm831x_touch_pdata *pdata = NULL; | 242 | struct wm831x_touch_pdata *pdata = NULL; |
243 | struct input_dev *input_dev; | 243 | struct input_dev *input_dev; |
244 | int error; | 244 | int error, irqf; |
245 | 245 | ||
246 | if (core_pdata) | 246 | if (core_pdata) |
247 | pdata = core_pdata->touch; | 247 | pdata = core_pdata->touch; |
@@ -314,9 +314,14 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
314 | wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, | 314 | wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, |
315 | WM831X_TCH_RATE_MASK, 6); | 315 | WM831X_TCH_RATE_MASK, 6); |
316 | 316 | ||
317 | if (pdata && pdata->data_irqf) | ||
318 | irqf = pdata->data_irqf; | ||
319 | else | ||
320 | irqf = IRQF_TRIGGER_HIGH; | ||
321 | |||
317 | error = request_threaded_irq(wm831x_ts->data_irq, | 322 | error = request_threaded_irq(wm831x_ts->data_irq, |
318 | NULL, wm831x_ts_data_irq, | 323 | NULL, wm831x_ts_data_irq, |
319 | IRQF_ONESHOT, | 324 | irqf | IRQF_ONESHOT, |
320 | "Touchscreen data", wm831x_ts); | 325 | "Touchscreen data", wm831x_ts); |
321 | if (error) { | 326 | if (error) { |
322 | dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n", | 327 | dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n", |
@@ -325,9 +330,14 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
325 | } | 330 | } |
326 | disable_irq(wm831x_ts->data_irq); | 331 | disable_irq(wm831x_ts->data_irq); |
327 | 332 | ||
333 | if (pdata && pdata->pd_irqf) | ||
334 | irqf = pdata->pd_irqf; | ||
335 | else | ||
336 | irqf = IRQF_TRIGGER_HIGH; | ||
337 | |||
328 | error = request_threaded_irq(wm831x_ts->pd_irq, | 338 | error = request_threaded_irq(wm831x_ts->pd_irq, |
329 | NULL, wm831x_ts_pen_down_irq, | 339 | NULL, wm831x_ts_pen_down_irq, |
330 | IRQF_ONESHOT, | 340 | irqf | IRQF_ONESHOT, |
331 | "Touchscreen pen down", wm831x_ts); | 341 | "Touchscreen pen down", wm831x_ts); |
332 | if (error) { | 342 | if (error) { |
333 | dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n", | 343 | dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n", |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 173086d42af4..6b0eb130efb8 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
@@ -81,7 +81,9 @@ struct wm831x_touch_pdata { | |||
81 | int rpu; /** Pen down sensitivity resistor divider */ | 81 | int rpu; /** Pen down sensitivity resistor divider */ |
82 | int pressure; /** Report pressure (boolean) */ | 82 | int pressure; /** Report pressure (boolean) */ |
83 | unsigned int data_irq; /** Touch data ready IRQ */ | 83 | unsigned int data_irq; /** Touch data ready IRQ */ |
84 | int data_irqf; /** IRQ flags for data ready IRQ */ | ||
84 | unsigned int pd_irq; /** Touch pendown detect IRQ */ | 85 | unsigned int pd_irq; /** Touch pendown detect IRQ */ |
86 | int pd_irqf; /** IRQ flags for pen down IRQ */ | ||
85 | }; | 87 | }; |
86 | 88 | ||
87 | enum wm831x_watchdog_action { | 89 | enum wm831x_watchdog_action { |