summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/board-mx6sl_arm2.c
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2012-06-18 13:14:08 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:38:51 +0800
commite6ed01871c19bc3db1bced9c0951cdf0ded40cd6 (patch)
treeb11d6a8e8ea9a3c6e4728e3e7c98f49e9ce08d10 /arch/arm/mach-mx6/board-mx6sl_arm2.c
parent662c78262b105e0a98fa85e519342963b31c1c9c (diff)
ENGR00213751: imx6sl: Add ELAN touchscreen support on EINK-DC3 board
Add ELAN capacitive TS support on EINK-DC3 stacked on MX6SL_ARM2 board - configure the iomux setting (need 4.7K Ohm pull up on 'touch_int_b') - configure the i2c slave addr - configure the GPIO setting for ELAN ce/int/rst - update the defconfig Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/board-mx6sl_arm2.c')
-rwxr-xr-xarch/arm/mach-mx6/board-mx6sl_arm2.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/board-mx6sl_arm2.c b/arch/arm/mach-mx6/board-mx6sl_arm2.c
index b17a0fff464a..8b9799d638a4 100755
--- a/arch/arm/mach-mx6/board-mx6sl_arm2.c
+++ b/arch/arm/mach-mx6/board-mx6sl_arm2.c
@@ -125,6 +125,9 @@
#define MX6SL_ARM2_EPDC_PMIC_WAKE IMX_GPIO_NR(2, 14) /* EPDC_PWRWAKEUP */
#define MX6SL_ARM2_EPDC_PMIC_INT IMX_GPIO_NR(2, 12) /* EPDC_PWRINT */
#define MX6SL_ARM2_EPDC_VCOM IMX_GPIO_NR(2, 3)
+#define MX6SL_ARM2_ELAN_CE IMX_GPIO_NR(2, 9)
+#define MX6SL_ARM2_ELAN_INT IMX_GPIO_NR(2, 10)
+#define MX6SL_ARM2_ELAN_RST IMX_GPIO_NR(4, 4)
static int max17135_regulator_init(struct max17135 *max17135);
struct clk *extern_audio_root;
@@ -525,6 +528,9 @@ static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
{
I2C_BOARD_INFO("max17135", 0x48),
.platform_data = &max17135_pdata,
+ }, {
+ I2C_BOARD_INFO("elan-touch", 0x10),
+ .irq = gpio_to_irq(MX6SL_ARM2_ELAN_INT),
},
};
@@ -1069,6 +1075,27 @@ static const struct matrix_keymap_data mx6sl_arm2_map_data __initconst = {
.keymap = mx6sl_arm2_keymap,
.keymap_size = ARRAY_SIZE(mx6sl_arm2_keymap),
};
+static void __init elan_ts_init(void)
+{
+ mxc_iomux_v3_setup_multiple_pads(mx6sl_arm2_elan_pads,
+ ARRAY_SIZE(mx6sl_arm2_elan_pads));
+
+ /* ELAN Touchscreen */
+ gpio_request(MX6SL_ARM2_ELAN_INT, "elan-interrupt");
+ gpio_direction_input(MX6SL_ARM2_ELAN_INT);
+
+ gpio_request(MX6SL_ARM2_ELAN_CE, "elan-cs");
+ gpio_direction_output(MX6SL_ARM2_ELAN_CE, 1);
+ gpio_direction_output(MX6SL_ARM2_ELAN_CE, 0);
+
+ gpio_request(MX6SL_ARM2_ELAN_RST, "elan-rst");
+ gpio_direction_output(MX6SL_ARM2_ELAN_RST, 1);
+ gpio_direction_output(MX6SL_ARM2_ELAN_RST, 0);
+ mdelay(1);
+ gpio_direction_output(MX6SL_ARM2_ELAN_RST, 1);
+ gpio_direction_output(MX6SL_ARM2_ELAN_CE, 1);
+}
+
/*!
* Board specific initialization.
*/
@@ -1076,6 +1103,8 @@ static void __init mx6_arm2_init(void)
{
mxc_iomux_v3_setup_multiple_pads(mx6sl_arm2_pads, ARRAY_SIZE(mx6sl_arm2_pads));
+ elan_ts_init();
+
gp_reg_id = "cpu_vddgp";
mx6_cpu_regulator_init();