summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com>2012-10-15 14:38:32 +0530
committerRajanikanth H.V <rajanikanth.hv@stericsson.com>2012-12-14 17:07:22 +0530
commit7bf8cb67215c87b5c76e6cc954a36d7ad6fee57b (patch)
tree83b4eb2f53078727e618a3bcb79f12e4dd236d63
parent19c0305cf60bdead2b42d7bca9e358b6f1d14dc4 (diff)
mach-ux500: Load snowball touchscreen firmware from userspace
Signed-off-by: ramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/board-mop500.c35
-rw-r--r--include/linux/input/st-ftk.h54
2 files changed, 82 insertions, 7 deletions
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 <linux/kernel.h>
+#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/i2c.h>
+#include <linux/input/st-ftk.h>
#include <linux/gpio.h>
#include <linux/gpio/nomadik.h>
#include <linux/amba/bus.h>
@@ -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 */
+
+
+
+
+