Input: davinci_keyscan - add device_enable method to platform data
authorMiguel Aguilar <miguel.aguilar@ridgerun.com>
Wed, 6 Jan 2010 08:06:50 +0000 (00:06 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 6 Jan 2010 08:17:11 +0000 (00:17 -0800)
Add a function pointer in the platform data of the DaVinci Keyscan driver
called device_enable, in order to perform board specific actions when
the device is initialized, like setup the PINMUX configuration.

Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
arch/arm/mach-davinci/include/mach/keyscan.h
drivers/input/keyboard/davinci_keyscan.c

index b4e21a2976d13ce16e9f4c6884d99f5812342ddf..7a560e05bda818290a7ebd86749055e2bf712a78 100644 (file)
@@ -29,6 +29,7 @@ enum davinci_matrix_types {
 };
 
 struct davinci_ks_platform_data {
+       int             (*device_enable)(struct device *dev);
        unsigned short  *keymap;
        u32             keymapsize;
        u8              rep:1;
index 6e52d855f637661a5082d429cd686a50ce3b7103..d410d7a52f1d6bd3c60f85564203fb685f76f89b 100644 (file)
@@ -174,6 +174,14 @@ static int __init davinci_ks_probe(struct platform_device *pdev)
        struct davinci_ks_platform_data *pdata = pdev->dev.platform_data;
        int error, i;
 
+       if (pdata->device_enable) {
+               error = pdata->device_enable(dev);
+               if (error < 0) {
+                       dev_dbg(dev, "device enable function failed\n");
+                       return error;
+               }
+       }
+
        if (!pdata->keymap) {
                dev_dbg(dev, "no keymap from pdata\n");
                return -EINVAL;