From 8266ac4e5940569f237ffbde7b3b6ab9de1cf4de Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 15 Feb 2008 23:31:44 +0200 Subject: [PATCH] tsc2301 - Add optional keypad name via platform data Allow the keypad device name to be customised via platform data. Signed-off-by: Daniel Stone Signed-off-by: Klaus Pedersen Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-n800.c | 1 + drivers/input/keyboard/tsc2301_kp.c | 5 ++++- include/linux/spi/tsc2301.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c index 2682acbf68c..34f1c37b99e 100644 --- a/arch/arm/mach-omap2/board-n800.c +++ b/arch/arm/mach-omap2/board-n800.c @@ -232,6 +232,7 @@ static struct tsc2301_platform_data tsc2301_config = { -1, /* Event for bit 15 */ }, .kp_rep = 0, + .keyb_name = "Internal keypad", }; static void tsc2301_dev_init(void) diff --git a/drivers/input/keyboard/tsc2301_kp.c b/drivers/input/keyboard/tsc2301_kp.c index 6308ee51507..58669f93f73 100644 --- a/drivers/input/keyboard/tsc2301_kp.c +++ b/drivers/input/keyboard/tsc2301_kp.c @@ -385,7 +385,10 @@ int __devinit tsc2301_kp_init(struct tsc2301 *tsc, r = -ENOMEM; goto err1; } - idev->name = "TSC2301 keypad"; + if (pdata->keyb_name) + idev->name = pdata->keyb_name; + else + idev->name = "TSC2301 keypad"; snprintf(kp->phys, sizeof(kp->phys), "%s/input-kp", tsc->spi->dev.bus_id); idev->phys = kp->phys; diff --git a/include/linux/spi/tsc2301.h b/include/linux/spi/tsc2301.h index d2c9ddada51..4552ebaad56 100644 --- a/include/linux/spi/tsc2301.h +++ b/include/linux/spi/tsc2301.h @@ -12,6 +12,7 @@ struct tsc2301_platform_data { s16 keyb_int; s16 keymap[16]; /* Set a key to a negative value if not used */ unsigned kp_rep:1; /* Enable keypad repeating */ + char *keyb_name; /* Keyboard device name */ /* * Touchscreen -- 2.41.0