aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ucb1400_core.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2009-11-08 22:45:54 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-20 03:52:05 -0500
commitfb141597550243b471f3bd526fe689aa3b74df25 (patch)
tree45083cd95cd520effed623449413ac21efa7b8a1 /drivers/mfd/ucb1400_core.c
parent765af10de6d93820def9978c53ed828e4d3bd4f4 (diff)
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>
Diffstat (limited to 'drivers/mfd/ucb1400_core.c')
-rw-r--r--drivers/mfd/ucb1400_core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
index fa294b6d600a..85fd9421be94 100644
--- a/drivers/mfd/ucb1400_core.c
+++ b/drivers/mfd/ucb1400_core.c
@@ -51,6 +51,7 @@ static int ucb1400_core_probe(struct device *dev)
51 struct ucb1400_ts ucb_ts; 51 struct ucb1400_ts ucb_ts;
52 struct ucb1400_gpio ucb_gpio; 52 struct ucb1400_gpio ucb_gpio;
53 struct snd_ac97 *ac97; 53 struct snd_ac97 *ac97;
54 struct ucb1400_pdata *pdata = dev->platform_data;
54 55
55 memset(&ucb_ts, 0, sizeof(ucb_ts)); 56 memset(&ucb_ts, 0, sizeof(ucb_ts));
56 memset(&ucb_gpio, 0, sizeof(ucb_gpio)); 57 memset(&ucb_gpio, 0, sizeof(ucb_gpio));
@@ -88,6 +89,12 @@ static int ucb1400_core_probe(struct device *dev)
88 89
89 /* TOUCHSCREEN */ 90 /* TOUCHSCREEN */
90 ucb_ts.ac97 = ac97; 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 ucb->ucb1400_ts = platform_device_alloc("ucb1400_ts", -1); 98 ucb->ucb1400_ts = platform_device_alloc("ucb1400_ts", -1);
92 if (!ucb->ucb1400_ts) { 99 if (!ucb->ucb1400_ts) {
93 err = -ENOMEM; 100 err = -ENOMEM;