[PATCH 10/11] tsc2301 - Add optional keypad name via platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Daniel Stone <daniel.stone@xxxxxxxxx>

Allow the keypad device name to be customised via platform data.

Signed-off-by: Daniel Stone <daniel.stone@xxxxxxxxx>
Signed-off-by: Klaus Pedersen <klaus.k.pedersen@xxxxxxxxx>
---
 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 deletions(-)

diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index 2682acb..34f1c37 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 6308ee5..58669f9 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 d2c9dda..4552eba 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
-- 
1.5.3.3

-
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux