Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Miguel Aguilar and committed by
Dmitry Torokhov
861a6442 30a589fd

+9
+1
arch/arm/mach-davinci/include/mach/keyscan.h
··· 29 29 }; 30 30 31 31 struct davinci_ks_platform_data { 32 + int (*device_enable)(struct device *dev); 32 33 unsigned short *keymap; 33 34 u32 keymapsize; 34 35 u8 rep:1;
+8
drivers/input/keyboard/davinci_keyscan.c
··· 174 174 struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; 175 175 int error, i; 176 176 177 + if (pdata->device_enable) { 178 + error = pdata->device_enable(dev); 179 + if (error < 0) { 180 + dev_dbg(dev, "device enable function failed\n"); 181 + return error; 182 + } 183 + } 184 + 177 185 if (!pdata->keymap) { 178 186 dev_dbg(dev, "no keymap from pdata\n"); 179 187 return -EINVAL;