Title: [8276] trunk/arch/blackfin/mach-bf537/boards/stamp.c: [#5865] Enable ad7843 and ad7873 in current ads7846 driver
Revision
8276
Author
hennerich
Date
2010-02-04 09:41:39 -0500 (Thu, 04 Feb 2010)

Log Message

[#5865] Enable ad7843 and ad7873 in current ads7846 driver

Modified Paths

Diff

Modified: trunk/arch/blackfin/mach-bf537/boards/stamp.c (8275 => 8276)


--- trunk/arch/blackfin/mach-bf537/boards/stamp.c	2010-02-04 14:37:32 UTC (rev 8275)
+++ trunk/arch/blackfin/mach-bf537/boards/stamp.c	2010-02-04 14:41:39 UTC (rev 8276)
@@ -833,6 +833,29 @@
 static inline void adf702x_mac_init(void) {}
 #endif
 
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+#include <linux/spi/ads7846.h>
+static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
+	.bits_per_word	= 8,
+};
+
+static int ads7873_get_pendown_state(void)
+{
+	return gpio_get_value(GPIO_PF6);
+}
+
+static struct ads7846_platform_data __initdata ad7873_pdata = {
+	.model		= 7873,		/* AD7873 */
+	.x_max		= 0xfff,
+	.y_max		= 0xfff,
+	.x_plate_ohms	= 620,
+	.debounce_max	= 1,
+	.debounce_rep	= 0,
+	.debounce_tol	= (~0),
+	.get_pendown_state = ads7873_get_pendown_state,
+};
+#endif
+
 #if defined(CONFIG_MTD_DATAFLASH) \
 	|| defined(CONFIG_MTD_DATAFLASH_MODULE)
 
@@ -1035,7 +1058,18 @@
 		.mode = SPI_MODE_0,
 	},
 #endif
-
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+	{
+		.modalias = "ads7846",
+		.max_speed_hz = 2000000,     /* max spi clock (SCK) speed in HZ */
+		.bus_num = 0,
+		.irq = IRQ_PF6,
+		.chip_select = GPIO_PF10 + MAX_CTRL_CS,	/* GPIO controlled SSEL */
+		.controller_data = &ad7873_spi_chip_info,
+		.platform_data = &ad7873_pdata,
+		.mode = SPI_MODE_0,
+	},
+#endif
 };
 
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to