summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-touch-raydium_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/board-touch-raydium_spi.c')
-rw-r--r--arch/arm/mach-tegra/board-touch-raydium_spi.c204
1 files changed, 5 insertions, 199 deletions
diff --git a/arch/arm/mach-tegra/board-touch-raydium_spi.c b/arch/arm/mach-tegra/board-touch-raydium_spi.c
index 601541838756..b12f1bd1f98d 100644
--- a/arch/arm/mach-tegra/board-touch-raydium_spi.c
+++ b/arch/arm/mach-tegra/board-touch-raydium_spi.c
@@ -27,180 +27,7 @@
#include <mach/gpio-tegra.h>
-/* Raydium touchscreen Driver data */
-/*-----------------------------------------------------*/
-static const u8 rm31080_config_cardhu[] = {
- 0x00, 0x00, 0x00, 0x00, 0x30, 0x1e, 0x20, 0x0f,
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x10, 0x06, 0x06, 0x04, 0x01, 0x02, 0x00,
- 0x00, 0x0a, 0x00, 0xd5, 0x2b, 0x00, 0x00, 0x09,
- 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x28, 0xf8, 0x50, 0xce, 0x0a, 0x0c, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x16, 0x1b, 0x14, 0x16, 0x16, 0x18, 0x32, 0x19,
- 0x1d, 0x08, 0x30, 0x19, 0x10, 0xf6, 0xe2, 0x08,
- 0x28, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x21, 0x00, 0x00, 0x21, 0x00, 0x00, 0x21,
- 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x80,
- 0x00, 0xc0, 0x00, 0xc2, 0x00, 0xf0, 0xed, 0x02,
- 0xed, 0x02, 0x00, 0x90, 0x0a, 0x06, 0x80, 0x02,
- 0x00, 0x04, 0x00, 0x20, 0x03, 0x02, 0x08, 0x03,
- 0x10, 0x20, 0x20, 0x40, 0x10, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x10, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x50, 0x80, 0x02, 0x02, 0x02, 0x00, 0x00, 0x33,
- 0x32, 0x00, 0x01, 0x4c, 0xfa, 0x00, 0x00, 0x43,
- 0x3c, 0x00, 0x01, 0x38, 0xe6, 0x00, 0x00, 0x26,
- 0x19, 0x00, 0x02, 0x66, 0x19, 0x00, 0x02, 0x50,
- 0x64, 0x00, 0x00, 0x36, 0x4a, 0x00, 0x00, 0x0c,
- 0x19, 0x00, 0x02, 0x64, 0x96, 0xab, 0x88, 0x78,
- 0x88, 0x78, 0x04, 0x0f, 0x38, 0xff, 0x02, 0x04,
- 0x80, 0xe0, 0x13, 0x01, 0x00, 0x44, 0x61, 0x12,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x97, 0x01, 0x0c,
- 0x44, 0x61, 0x12, 0x29, 0x29, 0x41, 0x00, 0x00,
- 0x97, 0x06, 0x0c, 0x12, 0x41, 0x44, 0x52, 0x52,
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x80, 0x01, 0x80, 0x01, 0x80,
- 0x22, 0x33, 0x22, 0x33, 0x66, 0x20, 0xff, 0xc9,
- 0x19, 0xd0, 0xd0, 0x44, 0x00, 0x10, 0x00, 0x80,
- 0x05, 0x44, 0xff, 0x00, 0x00, 0x10, 0x50, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x18, 0x18, 0x0f,
- 0x0f, 0xf0, 0xf0, 0x00, 0x00, 0x10, 0x10, 0x00,
- 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00,
- 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x10, 0x01, 0x10, 0x01, 0x02,
-};
-
-/* Wintek 7" MB (01.18.10.01.10) */
-static const u8 rm31080_config_kai_mainboard[] = {
- 0x00, 0x00, 0x00, 0x00, 0x1e, 0x12, 0x20, 0x0f,
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x19, 0x19, 0x06, 0x06, 0x04, 0x10, 0x02, 0x00,
- 0x00, 0x0a, 0x00, 0xd5, 0x2b, 0x00, 0x00, 0x09,
- 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x28, 0xec, 0x5f, 0xce, 0x14, 0x0a, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x14, 0x19, 0x14, 0x19, 0x10, 0x10, 0x32, 0x12,
- 0x1d, 0x08, 0x20, 0x19, 0x10, 0xf6, 0xe2, 0x08,
- 0x1c, 0x04, 0x04, 0x20, 0x0f, 0x1c, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x28, 0x00, 0x10, 0x22, 0x00, 0x00, 0x21,
- 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x60,
- 0x00, 0xa8, 0x00, 0xa8, 0x00, 0xd0, 0xed, 0x02,
- 0xed, 0x02, 0x00, 0x90, 0x0a, 0x06, 0x20, 0x02,
- 0x70, 0x03, 0x20, 0x1b, 0x03, 0x02, 0x08, 0x03,
- 0x10, 0x20, 0x20, 0x40, 0x10, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x20, 0x20, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x50, 0x80, 0x02, 0x02, 0x02, 0x00, 0x00, 0x33,
- 0x32, 0x00, 0x01, 0x60, 0xfa, 0x00, 0x00, 0x43,
- 0x3c, 0x00, 0x01, 0x4c, 0xe6, 0x00, 0x00, 0x26,
- 0x19, 0x00, 0x02, 0x7a, 0x19, 0x00, 0x02, 0x50,
- 0x64, 0x00, 0x00, 0x36, 0x4a, 0x00, 0x00, 0x0c,
- 0x19, 0x00, 0x02, 0x64, 0x96, 0xab, 0x88, 0x78,
- 0x88, 0x78, 0x04, 0x0f, 0x38, 0xff, 0x02, 0x04,
- 0x80, 0xe0, 0x13, 0x02, 0x00, 0x2c, 0x1b, 0x4b,
- 0x2e, 0x00, 0x00, 0x00, 0x00, 0x97, 0x06, 0x0c,
- 0x2c, 0x1b, 0x2e, 0x3c, 0x3c, 0x4b, 0x00, 0x00,
- 0x97, 0x06, 0x0c, 0x12, 0x41, 0x44, 0x52, 0x52,
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x80, 0x01, 0x80, 0x01, 0x80,
- 0x21, 0x33, 0x21, 0x33, 0x66, 0x20, 0xff, 0xc9,
- 0x19, 0xd0, 0xd0, 0x44, 0x00, 0x10, 0x00, 0x80,
- 0x05, 0x44, 0xff, 0x00, 0x00, 0x10, 0x50, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x18, 0x18, 0x0f,
- 0x0f, 0xf0, 0xf0, 0x00, 0x00, 0x10, 0x10, 0x00,
- 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00,
- 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x10, 0x01, 0x10, 0x01, 0x02,
-};
-
-/* Wintek 7" PCB (01.18.10.01.10), TS IC is on the mainboard */
-static const u8 rm31080_config_kai_pcb[] = {
- 0x00, 0x00, 0x00, 0x00, 0x1e, 0x12, 0x20, 0x0f,
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x19, 0x19, 0x06, 0x06, 0x04, 0x10, 0x02, 0x00,
- 0x00, 0x0a, 0x00, 0xd5, 0x2b, 0x00, 0x00, 0x09,
- 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x28, 0xec, 0x5f, 0xce, 0x14, 0x0a, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x14, 0x19, 0x14, 0x19, 0x10, 0x10, 0x32, 0x12,
- 0x1d, 0x08, 0x20, 0x19, 0x10, 0xf6, 0xe2, 0x08,
- 0x1c, 0x04, 0x04, 0x20, 0x0f, 0x1c, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x28, 0x00, 0x10, 0x22, 0x00, 0x00, 0x21,
- 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x60,
- 0x00, 0xa8, 0x00, 0xa8, 0x00, 0xd0, 0xed, 0x02,
- 0xed, 0x02, 0x00, 0x90, 0x0a, 0x06, 0x20, 0x02,
- 0x70, 0x03, 0x20, 0x1b, 0x03, 0x02, 0x08, 0x03,
- 0x10, 0x20, 0x20, 0x40, 0x10, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x20, 0x20, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x50, 0x80, 0x02, 0x02, 0x02, 0x00, 0x00, 0x33,
- 0x32, 0x00, 0x01, 0x60, 0xfa, 0x00, 0x00, 0x43,
- 0x3c, 0x00, 0x01, 0x4c, 0xe6, 0x00, 0x00, 0x26,
- 0x19, 0x00, 0x02, 0x7a, 0x19, 0x00, 0x02, 0x50,
- 0x64, 0x00, 0x00, 0x36, 0x4a, 0x00, 0x00, 0x0c,
- 0x19, 0x00, 0x02, 0x64, 0x96, 0xab, 0x88, 0x78,
- 0x88, 0x78, 0x04, 0x0f, 0x38, 0xff, 0x02, 0x04,
- 0x80, 0xe0, 0x13, 0x02, 0x00, 0x28, 0x17, 0x4b,
- 0x2e, 0x00, 0x00, 0x00, 0x00, 0x97, 0x06, 0x0c,
- 0x28, 0x17, 0x2e, 0x3c, 0x3c, 0x4b, 0x00, 0x00,
- 0x97, 0x06, 0x0c, 0x12, 0x41, 0x44, 0x52, 0x52,
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x80, 0x01, 0x80, 0x01, 0x80,
- 0x21, 0x33, 0x21, 0x33, 0x66, 0x20, 0xff, 0xc9,
- 0x19, 0xd0, 0xd0, 0x44, 0x00, 0x10, 0x00, 0x80,
- 0x05, 0x44, 0xff, 0x00, 0x00, 0x10, 0x50, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x18, 0x18, 0x0f,
- 0x0f, 0xf0, 0xf0, 0x00, 0x00, 0x10, 0x10, 0x00,
- 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00,
- 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x10, 0x01, 0x10, 0x01, 0x02,
-};
-
-struct rm_spi_ts_platform_data rm31080ts_data = {
- .gpio_reset = 0,
- .config = 0,
-};
-
-struct spi_board_info rm31080a_spi_board[1] = {
- {
- .modalias = "rm_ts_spidev",
- .bus_num = 0,
- .chip_select = 0,
- .max_speed_hz = 13 * 1000 * 1000,
- .mode = SPI_MODE_0,
- .platform_data = &rm31080ts_data,
- },
-};
-
-int __init touch_init_raydium(int irq_gpio, int reset_gpio, int platform)
+int __init touch_init_raydium(int irq_gpio, int reset_gpio, struct rm_spi_ts_platform_data *rm31080ts_data, struct spi_board_info *rm31080a_spi_board, int asize)
{
int err = 0;
gpio_request(irq_gpio, "raydium-irq");
@@ -209,35 +36,14 @@ int __init touch_init_raydium(int irq_gpio, int reset_gpio, int platform)
gpio_request(reset_gpio, "raydium-reset");
gpio_direction_output(reset_gpio, 0);
- rm31080ts_data.gpio_reset = reset_gpio;
+ rm31080ts_data->gpio_reset = reset_gpio;
- msleep(1);
+ msleep(5);
gpio_set_value(reset_gpio, 1);
- msleep(100);
-
- rm31080a_spi_board[0].irq = gpio_to_irq(irq_gpio);
-
- switch (platform) {
- case 0:
- pr_info("Raydium Kai PCB based touch init\n");
- rm31080ts_data.config = (char *) rm31080_config_kai_pcb;
- break;
- case 1:
- pr_info("Raydium Kai On-Board touch init\n");
- rm31080ts_data.config = (char *) rm31080_config_kai_mainboard;
- break;
- case 2:
- pr_info("Raydium cardhu touch init\n");
- rm31080ts_data.config = (char *) rm31080_config_cardhu;
- break;
- default:
- pr_err("touch_id error, no touch\n");
- err = -ENODEV;
- }
+ msleep(5);
if(!err)
- spi_register_board_info(rm31080a_spi_board,
- ARRAY_SIZE(rm31080a_spi_board));
+ spi_register_board_info(rm31080a_spi_board, asize);
return err;
}