aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2009-11-19 12:32:52 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-20 03:55:38 -0500
commit985f37f827f5012f88e286914cdbae87b9f50ed1 (patch)
tree6dbb690f3a34f6728aba392f8644ce48af1b7b95 /arch/arm/mach-at91
parent423c9b0dc3d01e50a4df4e48e8477bfb33638d6e (diff)
AT91: add touchscreen support for at91sam9g45ekes
New at91sam9g45ekes board provides a LCD with resistive touchscreen. This is the support of this feature by atmel_tsadcc driver. This also sets up platform parameters to be passed to the driver. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c51
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c12
2 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 332b784050b2..a5a4eb19fbbe 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -810,6 +810,57 @@ static void __init at91_add_device_rtc(void) {}
810 810
811 811
812/* -------------------------------------------------------------------- 812/* --------------------------------------------------------------------
813 * Touchscreen
814 * -------------------------------------------------------------------- */
815
816#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
817static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
818static struct at91_tsadcc_data tsadcc_data;
819
820static struct resource tsadcc_resources[] = {
821 [0] = {
822 .start = AT91SAM9G45_BASE_TSC,
823 .end = AT91SAM9G45_BASE_TSC + SZ_16K - 1,
824 .flags = IORESOURCE_MEM,
825 },
826 [1] = {
827 .start = AT91SAM9G45_ID_TSC,
828 .end = AT91SAM9G45_ID_TSC,
829 .flags = IORESOURCE_IRQ,
830 }
831};
832
833static struct platform_device at91sam9g45_tsadcc_device = {
834 .name = "atmel_tsadcc",
835 .id = -1,
836 .dev = {
837 .dma_mask = &tsadcc_dmamask,
838 .coherent_dma_mask = DMA_BIT_MASK(32),
839 .platform_data = &tsadcc_data,
840 },
841 .resource = tsadcc_resources,
842 .num_resources = ARRAY_SIZE(tsadcc_resources),
843};
844
845void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data)
846{
847 if (!data)
848 return;
849
850 at91_set_gpio_input(AT91_PIN_PD20, 0); /* AD0_XR */
851 at91_set_gpio_input(AT91_PIN_PD21, 0); /* AD1_XL */
852 at91_set_gpio_input(AT91_PIN_PD22, 0); /* AD2_YT */
853 at91_set_gpio_input(AT91_PIN_PD23, 0); /* AD3_TB */
854
855 tsadcc_data = *data;
856 platform_device_register(&at91sam9g45_tsadcc_device);
857}
858#else
859void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
860#endif
861
862
863/* --------------------------------------------------------------------
813 * RTT 864 * RTT
814 * -------------------------------------------------------------------- */ 865 * -------------------------------------------------------------------- */
815 866
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 64c3843f323d..3d6764b3ad7a 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -229,6 +229,16 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;
229 229
230 230
231/* 231/*
232 * Touchscreen
233 */
234static struct at91_tsadcc_data ek_tsadcc_data = {
235 .adc_clock = 300000,
236 .pendet_debounce = 0x0d,
237 .ts_sample_hold_time = 0x0a,
238};
239
240
241/*
232 * GPIO Buttons 242 * GPIO Buttons
233 */ 243 */
234#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 244#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
@@ -378,6 +388,8 @@ static void __init ek_board_init(void)
378 at91_add_device_i2c(0, NULL, 0); 388 at91_add_device_i2c(0, NULL, 0);
379 /* LCD Controller */ 389 /* LCD Controller */
380 at91_add_device_lcdc(&ek_lcdc_data); 390 at91_add_device_lcdc(&ek_lcdc_data);
391 /* Touch Screen */
392 at91_add_device_tsadcc(&ek_tsadcc_data);
381 /* Push Buttons */ 393 /* Push Buttons */
382 ek_add_device_buttons(); 394 ek_add_device_buttons();
383 /* AC97 */ 395 /* AC97 */