summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorRobert Collins <rcollins@nvidia.com>2012-09-16 11:10:45 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:36:00 -0700
commit70936e6e8eb7c2a4e56d675390124b07bb907559 (patch)
tree6c858ce7869830a4388aeab5b62ca4aebbf62169 /arch/arm/mach-tegra
parent017b82dd86d80d87fa9576527fad1ecef1cc7426 (diff)
touch: Radyium: Move panel config structures to board files.
Reviewed-on: http://git-master/r/133110 Change-Id: I93343d2d67982fd05cb2c72b2d983c0f0cff5bf7 Signed-off-by: Robert Collins <rcollins@nvidia.com> Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/143115 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Rebase-Id: R8e0c81e45ec3f10cb3e470419191acd3bf52f68c
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-touch-raydium.h24
-rw-r--r--arch/arm/mach-tegra/board-touch-raydium_spi.c204
-rw-r--r--arch/arm/mach-tegra/board-touch.h3
3 files changed, 29 insertions, 202 deletions
diff --git a/arch/arm/mach-tegra/board-touch-raydium.h b/arch/arm/mach-tegra/board-touch-raydium.h
new file mode 100644
index 000000000000..7535a8931b38
--- /dev/null
+++ b/arch/arm/mach-tegra/board-touch-raydium.h
@@ -0,0 +1,24 @@
+/*
+ * arch/arm/mach-tegra/board-touch-raydium.h
+ *
+ * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _MACH_TEGRA_BOARD_TOUCH_RAYDIUM_H
+#define _MACH_TEGRA_BOARD_TOUCH_RAYDIUM_H
+
+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 size);
+
+#endif
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;
}
diff --git a/arch/arm/mach-tegra/board-touch.h b/arch/arm/mach-tegra/board-touch.h
index 61b64d3f495a..96ee6701fd2d 100644
--- a/arch/arm/mach-tegra/board-touch.h
+++ b/arch/arm/mach-tegra/board-touch.h
@@ -19,7 +19,4 @@
#ifndef _MACH_TEGRA_BOARD_TOUCH_H
#define _MACH_TEGRA_BOARD_TOUCH_H
-
-int __init touch_init_raydium(int irq_gpio, int reset_gpio, int platform);
-
#endif