aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9g45_devices.c
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/at91sam9g45_devices.c
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/at91sam9g45_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c51
1 files changed, 51 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