RX51: tsc2005 platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Please add tsc2005 to board-rx51-peripherals.c. The code should
have gone through the input queue according to [0], but only
the touchscreen driver is part of the mainline linux kernel
since 2.6.39-rc1.

I attached the patch adding tsc2005 support to the rx51 board
file, updated to apply cleanly against the mainline 3.1 kernel.

[0] http://comments.gmane.org/gmane.linux.ports.arm.omap/34198

-- Sebastian
Description: Add tsc2005 touchscreen driver to rx51 peripherals board code
 This patch adds the boardcode for tsc2005 touchscreen support
 to board-rx51-peripherals.c.
Author: Aaro Koskinen <aaro.koskinen@xxxxxxxxx>
Reviewed-by: Sebastian Reichel <sre@xxxxxxxxxx>
Origin: http://permalink.gmane.org/gmane.linux.kernel.input/12218
Last-Update: 2011-11-06

--- a/arch/arm/mach-omap2/board-rx51-peripherals.c	2011-11-06 00:39:36.000000000 +0100
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c	2011-11-06 00:39:40.000000000 +0100
@@ -15,6 +15,7 @@
 #include <linux/input/matrix_keypad.h>
 #include <linux/spi/spi.h>
 #include <linux/wl12xx.h>
+#include <linux/spi/tsc2005.h>
 #include <linux/i2c.h>
 #include <linux/i2c/twl.h>
 #include <linux/clk.h>
@@ -56,6 +57,9 @@
 
 #define RX51_USB_TRANSCEIVER_RST_GPIO	67
 
+#define RX51_TSC2005_RESET_GPIO         104
+#define RX51_TSC2005_IRQ_GPIO           100
+
 /* list all spi devices here */
 enum {
 	RX51_SPI_WL1251,
@@ -64,6 +68,7 @@
 };
 
 static struct wl12xx_platform_data wl1251_pdata;
+static struct tsc2005_platform_data tsc2005_pdata;
 
 #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
 static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
@@ -107,10 +112,10 @@
 		.modalias		= "tsc2005",
 		.bus_num		= 1,
 		.chip_select		= 0,
-		/* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/
+		.irq                    = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
 		.max_speed_hz		= 6000000,
 		.controller_data	= &tsc2005_mcspi_config,
-		/* .platform_data = &tsc2005_config,*/
+		.platform_data          = &tsc2005_pdata,
 	},
 };
 
@@ -970,6 +975,42 @@
 	 */
 }
 
+static struct tsc2005_platform_data tsc2005_pdata = {
+       .ts_pressure_max   = 2048,
+       .ts_pressure_fudge = 2,
+       .ts_x_max          = 4096,
+       .ts_x_fudge        = 4,
+       .ts_y_max          = 4096,
+       .ts_y_fudge        = 7,
+       .ts_x_plate_ohm    = 280,
+       .esd_timeout_ms    = 8000,
+};
+
+static void rx51_tsc2005_set_reset(bool enable)
+{
+       gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
+}
+
+static void __init rx51_init_tsc2005(void)
+{
+       int r;
+
+       r = gpio_request(RX51_TSC2005_IRQ_GPIO, "tsc2005 IRQ");
+       if (r >= 0)
+               gpio_direction_input(RX51_TSC2005_IRQ_GPIO);
+       else
+               printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 IRQ");
+
+       r = gpio_request(RX51_TSC2005_RESET_GPIO, "tsc2005 reset");
+       if (r >= 0) {
+               gpio_direction_output(RX51_TSC2005_RESET_GPIO, 1);
+               tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
+       } else {
+               printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 reset");
+               tsc2005_pdata.esd_timeout_ms = 0;
+       }
+}
+
 void __init rx51_peripherals_init(void)
 {
 	rx51_i2c_init();
@@ -977,6 +1018,7 @@
 	board_smc91x_init();
 	rx51_add_gpio_keys();
 	rx51_init_wl1251();
+	rx51_init_tsc2005();
 	rx51_init_si4713();
 	spi_register_board_info(rx51_peripherals_spi_board_info,
 				ARRAY_SIZE(rx51_peripherals_spi_board_info));

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux