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 /drivers/input/touchscreen | |
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>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/wm831x-ts.c | 16 |
1 files changed, 13 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", |