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>

authored by Mark Brown and committed by Dmitry Torokhov acad9853 f5346668

+15 -3
+13 -3
drivers/input/touchscreen/wm831x-ts.c
··· 241 241 struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent); 242 242 struct wm831x_touch_pdata *pdata = NULL; 243 243 struct input_dev *input_dev; 244 - int error; 244 + int error, irqf; 245 245 246 246 if (core_pdata) 247 247 pdata = core_pdata->touch; ··· 314 314 wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1, 315 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 322 error = request_threaded_irq(wm831x_ts->data_irq, 318 323 NULL, wm831x_ts_data_irq, 319 - IRQF_ONESHOT, 324 + irqf | IRQF_ONESHOT, 320 325 "Touchscreen data", wm831x_ts); 321 326 if (error) { 322 327 dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n", ··· 330 325 } 331 326 disable_irq(wm831x_ts->data_irq); 332 327 328 + if (pdata && pdata->pd_irqf) 329 + irqf = pdata->pd_irqf; 330 + else 331 + irqf = IRQF_TRIGGER_HIGH; 332 + 333 333 error = request_threaded_irq(wm831x_ts->pd_irq, 334 334 NULL, wm831x_ts_pen_down_irq, 335 - IRQF_ONESHOT, 335 + irqf | IRQF_ONESHOT, 336 336 "Touchscreen pen down", wm831x_ts); 337 337 if (error) { 338 338 dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n",
+2
include/linux/mfd/wm831x/pdata.h
··· 81 81 int rpu; /** Pen down sensitivity resistor divider */ 82 82 int pressure; /** Report pressure (boolean) */ 83 83 unsigned int data_irq; /** Touch data ready IRQ */ 84 + int data_irqf; /** IRQ flags for data ready IRQ */ 84 85 unsigned int pd_irq; /** Touch pendown detect IRQ */ 86 + int pd_irqf; /** IRQ flags for pen down IRQ */ 85 87 }; 86 88 87 89 enum wm831x_watchdog_action {