blob: a01de3958ec6f46c5f9a939610975e47293608e1 [file] [log] [blame]
From ce9a312895c8fb5fc0115d5ed5f4434382d4ed8c Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Tue, 10 Apr 2012 20:58:45 -0700
Subject: ARM: mach-shmobile: kzm9g: add ST1232 Touchscreen support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Simon Horman <horms@verge.net.au>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
(cherry picked from commit 3ab21c0e494efe064b425d48ac985cde5ee7f84b)
N.B: Not present in mainline yet
Signed-off-by: Simon Horman <horms@verge.net.au>
---
arch/arm/mach-shmobile/board-kzm9g.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 3e3da46..f6a0b4f 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -21,6 +21,7 @@
#include <linux/gpio.h>
#include <linux/io.h>
#include <linux/irq.h>
+#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/videodev2.h>
#include <mach/irqs.h>
@@ -86,6 +87,13 @@ static struct platform_device lcdc_device = {
},
};
+static struct i2c_board_info i2c1_devices[] = {
+ {
+ I2C_BOARD_INFO("st1232-ts", 0x55),
+ .irq = intcs_evt2irq(0x300), /* IRQ8 */
+ },
+};
+
static struct platform_device *kzm_devices[] __initdata = {
&lcdc_device,
};
@@ -184,11 +192,17 @@ static void __init kzm_init(void)
gpio_request(GPIO_PORT222, NULL);
gpio_direction_output(GPIO_PORT222, 1);
+ /* Touchscreen */
+ gpio_request(GPIO_PORT223, NULL); /* IRQ8 */
+ gpio_direction_input(GPIO_PORT223);
+
#ifdef CONFIG_CACHE_L2X0
/* Early BRESP enable, Shared attribute override enable, 64K*8way */
l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
#endif
+ i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
+
sh73a0_add_standard_devices();
platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
}
--
1.7.10.2.565.gbd578b5