Commit fb141597550243b471f3bd526fe689aa3b74df25
Committed by
Dmitry Torokhov
1 parent
765af10de6
Exists in
master
and in
7 other branches
Input: ucb1400_ts - allow passing IRQ through platfrom_data
This patch allows UCB1400 to get IRQ GPIO from platform data. In case platform_data are not supplied or the IRQ supplied in the platform_data is negative, fall back to the old IRQ detection algorithm. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Showing 3 changed files with 18 additions and 4 deletions Side-by-side Diff
drivers/input/touchscreen/ucb1400_ts.c
... | ... | @@ -355,10 +355,13 @@ |
355 | 355 | goto err; |
356 | 356 | } |
357 | 357 | |
358 | - error = ucb1400_ts_detect_irq(ucb); | |
359 | - if (error) { | |
360 | - printk(KERN_ERR "UCB1400: IRQ probe failed\n"); | |
361 | - goto err_free_devs; | |
358 | + /* Only in case the IRQ line wasn't supplied, try detecting it */ | |
359 | + if (ucb->irq < 0) { | |
360 | + error = ucb1400_ts_detect_irq(ucb); | |
361 | + if (error) { | |
362 | + printk(KERN_ERR "UCB1400: IRQ probe failed\n"); | |
363 | + goto err_free_devs; | |
364 | + } | |
362 | 365 | } |
363 | 366 | |
364 | 367 | init_waitqueue_head(&ucb->ts_wait); |
drivers/mfd/ucb1400_core.c
... | ... | @@ -51,6 +51,7 @@ |
51 | 51 | struct ucb1400_ts ucb_ts; |
52 | 52 | struct ucb1400_gpio ucb_gpio; |
53 | 53 | struct snd_ac97 *ac97; |
54 | + struct ucb1400_pdata *pdata = dev->platform_data; | |
54 | 55 | |
55 | 56 | memset(&ucb_ts, 0, sizeof(ucb_ts)); |
56 | 57 | memset(&ucb_gpio, 0, sizeof(ucb_gpio)); |
... | ... | @@ -88,6 +89,12 @@ |
88 | 89 | |
89 | 90 | /* TOUCHSCREEN */ |
90 | 91 | ucb_ts.ac97 = ac97; |
92 | + | |
93 | + if (pdata != NULL && pdata->irq >= 0) | |
94 | + ucb_ts.irq = pdata->irq; | |
95 | + else | |
96 | + ucb_ts.irq = -1; | |
97 | + | |
91 | 98 | ucb->ucb1400_ts = platform_device_alloc("ucb1400_ts", -1); |
92 | 99 | if (!ucb->ucb1400_ts) { |
93 | 100 | err = -ENOMEM; |
include/linux/ucb1400.h