aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tc3589x.c
diff options
context:
space:
mode:
authorSundar Iyer <sundar.iyer@stericsson.com>2010-12-21 05:23:31 -0500
committerLinus Walleij <linus.walleij@stericsson.com>2010-12-29 16:02:24 -0500
commit09c730a488c32c2cadb31cdb8dcc4df528441197 (patch)
treeda84e298a2bc5d6a6bd4cdacfdd1a2125c3e301d /drivers/mfd/tc3589x.c
parent11c8ea81cc639c2ea56f94a9cdaa6242ff13a3af (diff)
input/tc3589x: add tc3589x keypad support
Add support for the keypad controller module found on the TC3589X devices. This driver default adds the support for TC35893 device. Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> [Some minor fixups for compilation] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'drivers/mfd/tc3589x.c')
-rw-r--r--drivers/mfd/tc3589x.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 112efd3c4940..729dbeed2ce0 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -132,6 +132,14 @@ static struct resource gpio_resources[] = {
132 }, 132 },
133}; 133};
134 134
135static struct resource keypad_resources[] = {
136 {
137 .start = TC3589x_INT_KBDIRQ,
138 .end = TC3589x_INT_KBDIRQ,
139 .flags = IORESOURCE_IRQ,
140 },
141};
142
135static struct mfd_cell tc3589x_dev_gpio[] = { 143static struct mfd_cell tc3589x_dev_gpio[] = {
136 { 144 {
137 .name = "tc3589x-gpio", 145 .name = "tc3589x-gpio",
@@ -140,6 +148,14 @@ static struct mfd_cell tc3589x_dev_gpio[] = {
140 }, 148 },
141}; 149};
142 150
151static struct mfd_cell tc3589x_dev_keypad[] = {
152 {
153 .name = "tc3589x-keypad",
154 .num_resources = ARRAY_SIZE(keypad_resources),
155 .resources = &keypad_resources[0],
156 },
157};
158
143static irqreturn_t tc3589x_irq(int irq, void *data) 159static irqreturn_t tc3589x_irq(int irq, void *data)
144{ 160{
145 struct tc3589x *tc3589x = data; 161 struct tc3589x *tc3589x = data;
@@ -255,8 +271,18 @@ static int __devinit tc3589x_device_init(struct tc3589x *tc3589x)
255 dev_info(tc3589x->dev, "added gpio block\n"); 271 dev_info(tc3589x->dev, "added gpio block\n");
256 } 272 }
257 273
258 return ret; 274 if (blocks & TC3589x_BLOCK_KEYPAD) {
275 ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad,
276 ARRAY_SIZE(tc3589x_dev_keypad), NULL,
277 tc3589x->irq_base);
278 if (ret) {
279 dev_err(tc3589x->dev, "failed to keypad child\n");
280 return ret;
281 }
282 dev_info(tc3589x->dev, "added keypad block\n");
283 }
259 284
285 return ret;
260} 286}
261 287
262static int __devinit tc3589x_probe(struct i2c_client *i2c, 288static int __devinit tc3589x_probe(struct i2c_client *i2c,