Commit 861a6442 authored by Miguel Aguilar's avatar Miguel Aguilar Committed by Dmitry Torokhov

Input: davinci_keyscan - add device_enable method to platform data

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: default avatarMiguel Aguilar <miguel.aguilar@ridgerun.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 30a589fd
...@@ -29,6 +29,7 @@ enum davinci_matrix_types { ...@@ -29,6 +29,7 @@ enum davinci_matrix_types {
}; };
struct davinci_ks_platform_data { struct davinci_ks_platform_data {
int (*device_enable)(struct device *dev);
unsigned short *keymap; unsigned short *keymap;
u32 keymapsize; u32 keymapsize;
u8 rep:1; u8 rep:1;
......
...@@ -174,6 +174,14 @@ static int __init davinci_ks_probe(struct platform_device *pdev) ...@@ -174,6 +174,14 @@ static int __init davinci_ks_probe(struct platform_device *pdev)
struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; struct davinci_ks_platform_data *pdata = pdev->dev.platform_data;
int error, i; 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) { if (!pdata->keymap) {
dev_dbg(dev, "no keymap from pdata\n"); dev_dbg(dev, "no keymap from pdata\n");
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment