diff options
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9m10g45ek.c | 12 | ||||
-rw-r--r-- | drivers/input/touchscreen/Kconfig | 2 |
3 files changed, 64 insertions, 1 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) | ||
817 | static u64 tsadcc_dmamask = DMA_BIT_MASK(32); | ||
818 | static struct at91_tsadcc_data tsadcc_data; | ||
819 | |||
820 | static 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 | |||
833 | static 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 | |||
845 | void __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 | ||
859 | void __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 | */ | ||
234 | static 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 */ |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 1cd9e8c8efb3..aebea71ff02a 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -309,7 +309,7 @@ config TOUCHSCREEN_TOUCHWIN | |||
309 | 309 | ||
310 | config TOUCHSCREEN_ATMEL_TSADCC | 310 | config TOUCHSCREEN_ATMEL_TSADCC |
311 | tristate "Atmel Touchscreen Interface" | 311 | tristate "Atmel Touchscreen Interface" |
312 | depends on ARCH_AT91SAM9RL | 312 | depends on ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 |
313 | help | 313 | help |
314 | Say Y here if you have a 4-wire touchscreen connected to the | 314 | Say Y here if you have a 4-wire touchscreen connected to the |
315 | ADC Controller on your Atmel SoC (such as the AT91SAM9RL). | 315 | ADC Controller on your Atmel SoC (such as the AT91SAM9RL). |