From db60e5845c840a481a22f86cea5c2220ee76db9e Mon Sep 17 00:00:00 2001 From: "ramesh.chandrasekaran" Date: Mon, 15 Oct 2012 14:38:32 +0530 Subject: mach-ux500: Load snowball touchscreen firmware from userspace Signed-off-by: ramesh.chandrasekaran --- arch/arm/mach-ux500/board-mop500.c | 35 +++++++++++++++++++----- include/linux/input/st-ftk.h | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 include/linux/input/st-ftk.h diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 1e68e6aa1b6..ff30b835871 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -9,11 +9,13 @@ * */ #include +#include #include #include #include #include #include +#include #include #include #include @@ -719,12 +721,26 @@ static struct i2c_board_info __initdata snowball_i2c0_devices[] = { #endif }; -#ifdef CONFIG_TOUCHSCREEN_STMT07 -static struct i2c_board_info __initdata snowball_i2c1_devices[] = { +#ifdef CONFIG_TOUCHSCREEN_STMT07_MODULE +struct ftk_platform_data ftk_platdata_snowball = { + .gpio_rst = -1, + .x_min = 0, + .x_max = 1280, + .y_min = 0, + .y_max = 800, + .p_min = 0, + .p_max = 256, + .portrait = 0, + .patch_file = "st-ftkt.bin", + .busnum = 1, +}; + +static struct i2c_board_info snowball_i2c1_devices[] = { { - /* STM TS controller */ + /* STM TS controller */ I2C_BOARD_INFO("ftk", 0x4B), .irq = NOMADIK_GPIO_TO_IRQ(152), + .platform_data = &ftk_platdata_snowball, }, }; #endif @@ -1075,6 +1091,14 @@ static struct platform_device *mop500_platform_devs[] __initdata = { #endif }; +#ifdef CONFIG_TOUCHSCREEN_STMT07_MODULE +const struct i2c_board_info *snowball_touch_get_plat_data(void) +{ + return snowball_i2c1_devices; +} +EXPORT_SYMBOL_GPL(snowball_touch_get_plat_data); +#endif + #ifdef CONFIG_STM_MSP_SPI /* * MSP-SPI @@ -1418,10 +1442,7 @@ static void __init snowball_init_machine(void) i2c_register_board_info(0, snowball_i2c0_devices, ARRAY_SIZE(snowball_i2c0_devices)); -#ifdef CONFIG_TOUCHSCREEN_STMT07 - i2c_register_board_info(1, snowball_i2c1_devices, - ARRAY_SIZE(snowball_i2c1_devices)); -#endif + /* This board has full regulator constraints */ regulator_has_full_constraints(); } diff --git a/include/linux/input/st-ftk.h b/include/linux/input/st-ftk.h new file mode 100644 index 00000000000..398c437b6d4 --- /dev/null +++ b/include/linux/input/st-ftk.h @@ -0,0 +1,54 @@ +/* + * STMicroelectronics FingertipK touchscreen driver + * + * Copyright (C) ST-Ericsson SA 2012 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * THE PRESENT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, FOR THE SOLE + * PURPOSE TO SUPPORT YOUR APPLICATION DEVELOPMENT. + * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, + * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE + * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING + * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. + * + */ + +#ifndef _LINUX_INPUT_FTK_H +#define _LINUX_INPUT_FTK_H + + +/* + * STMT05/STMT07 FingerTipK driver platform data + * gpio_rst: hardware reset pin (optional set -1) + * x_min/x_max : X pixel resolution + * y_min/y_max : Y pixel resolution + * p_min/p_max : pressure + * portrait : portrait (1) / landscape (0 - default) mode (optional) + * patch_file : name of the firmware binary file + * + */ +struct ftk_platform_data { + int gpio_rst; + u32 x_min; + u32 x_max; + u32 y_min; + u32 y_max; + u32 p_min; + u32 p_max; + bool portrait; + char patch_file[32]; + int busnum; +}; + +const struct i2c_board_info *snowball_touch_get_plat_data(void); + +#endif /* _LINUX_INPUT_FTK_H */ + + + + + -- cgit v1.2.3