diff options
author | Sundar Iyer <sundar.iyer@stericsson.com> | 2010-12-21 15:53:31 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@stericsson.com> | 2010-12-29 22:02:24 +0100 |
commit | 09c730a488c32c2cadb31cdb8dcc4df528441197 (patch) | |
tree | da84e298a2bc5d6a6bd4cdacfdd1a2125c3e301d /drivers/mfd | |
parent | 11c8ea81cc639c2ea56f94a9cdaa6242ff13a3af (diff) | |
download | linux-3.10-09c730a488c32c2cadb31cdb8dcc4df528441197.tar.gz linux-3.10-09c730a488c32c2cadb31cdb8dcc4df528441197.tar.bz2 linux-3.10-09c730a488c32c2cadb31cdb8dcc4df528441197.zip |
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')
-rw-r--r-- | drivers/mfd/tc3589x.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c index 112efd3c494..729dbeed2ce 100644 --- a/drivers/mfd/tc3589x.c +++ b/drivers/mfd/tc3589x.c @@ -132,6 +132,14 @@ static struct resource gpio_resources[] = { }, }; +static struct resource keypad_resources[] = { + { + .start = TC3589x_INT_KBDIRQ, + .end = TC3589x_INT_KBDIRQ, + .flags = IORESOURCE_IRQ, + }, +}; + static struct mfd_cell tc3589x_dev_gpio[] = { { .name = "tc3589x-gpio", @@ -140,6 +148,14 @@ static struct mfd_cell tc3589x_dev_gpio[] = { }, }; +static struct mfd_cell tc3589x_dev_keypad[] = { + { + .name = "tc3589x-keypad", + .num_resources = ARRAY_SIZE(keypad_resources), + .resources = &keypad_resources[0], + }, +}; + static irqreturn_t tc3589x_irq(int irq, void *data) { struct tc3589x *tc3589x = data; @@ -255,8 +271,18 @@ static int __devinit tc3589x_device_init(struct tc3589x *tc3589x) dev_info(tc3589x->dev, "added gpio block\n"); } - return ret; + if (blocks & TC3589x_BLOCK_KEYPAD) { + ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad, + ARRAY_SIZE(tc3589x_dev_keypad), NULL, + tc3589x->irq_base); + if (ret) { + dev_err(tc3589x->dev, "failed to keypad child\n"); + return ret; + } + dev_info(tc3589x->dev, "added keypad block\n"); + } + return ret; } static int __devinit tc3589x_probe(struct i2c_client *i2c, |