aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Victor <linux@maxim.org.za>2008-09-18 14:45:35 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-21 17:58:39 -0400
commitf7647e63f32c501e8b59ccfdac50eb3d3e897c41 (patch)
treec6987bc3c06b09f0c21b3b16077a2032d00a4d29
parenta7307bf22557e1e029df0ea6f2a2973de4d9c135 (diff)
[ARM] 5260/1: [AT91] Touchscreen on AT91SAM9RL
This patch adds initialization of the Touchscreen controller for the AT91SAM9RL processor. Signed-off-by: Justin Waters <justin.waters@timesys.com> Signed-off-by: Dan Liang <dan.liang@atmel.com> Signed-off-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/configs/at91sam9rlek_defconfig1
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c45
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c2
-rw-r--r--arch/arm/mach-at91/include/mach/board.h3
4 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/configs/at91sam9rlek_defconfig b/arch/arm/configs/at91sam9rlek_defconfig
index 1c76642272a1..811bebbdc784 100644
--- a/arch/arm/configs/at91sam9rlek_defconfig
+++ b/arch/arm/configs/at91sam9rlek_defconfig
@@ -496,6 +496,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
496# CONFIG_TOUCHSCREEN_PENMOUNT is not set 496# CONFIG_TOUCHSCREEN_PENMOUNT is not set
497# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 497# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
498# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 498# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
499CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
499# CONFIG_TOUCHSCREEN_UCB1400 is not set 500# CONFIG_TOUCHSCREEN_UCB1400 is not set
500# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 501# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
501# CONFIG_INPUT_MISC is not set 502# CONFIG_INPUT_MISC is not set
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 3f9fed4902b8..87deb1e1b529 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -527,6 +527,51 @@ static void __init at91_add_device_tc(void) { }
527 527
528 528
529/* -------------------------------------------------------------------- 529/* --------------------------------------------------------------------
530 * Touchscreen
531 * -------------------------------------------------------------------- */
532
533#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
534static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
535
536static struct resource tsadcc_resources[] = {
537 [0] = {
538 .start = AT91SAM9RL_BASE_TSC,
539 .end = AT91SAM9RL_BASE_TSC + SZ_16K - 1,
540 .flags = IORESOURCE_MEM,
541 },
542 [1] = {
543 .start = AT91SAM9RL_ID_TSC,
544 .end = AT91SAM9RL_ID_TSC,
545 .flags = IORESOURCE_IRQ,
546 }
547};
548
549static struct platform_device at91sam9rl_tsadcc_device = {
550 .name = "atmel_tsadcc",
551 .id = -1,
552 .dev = {
553 .dma_mask = &tsadcc_dmamask,
554 .coherent_dma_mask = DMA_BIT_MASK(32),
555 },
556 .resource = tsadcc_resources,
557 .num_resources = ARRAY_SIZE(tsadcc_resources),
558};
559
560void __init at91_add_device_tsadcc(void)
561{
562 at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */
563 at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */
564 at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */
565 at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */
566
567 platform_device_register(&at91sam9rl_tsadcc_device);
568}
569#else
570void __init at91_add_device_tsadcc(void) {}
571#endif
572
573
574/* --------------------------------------------------------------------
530 * RTC 575 * RTC
531 * -------------------------------------------------------------------- */ 576 * -------------------------------------------------------------------- */
532 577
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 3d3f61572cff..270851864308 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -195,6 +195,8 @@ static void __init ek_board_init(void)
195 at91_add_device_mmc(0, &ek_mmc_data); 195 at91_add_device_mmc(0, &ek_mmc_data);
196 /* LCD Controller */ 196 /* LCD Controller */
197 at91_add_device_lcdc(&ek_lcdc_data); 197 at91_add_device_lcdc(&ek_lcdc_data);
198 /* Touch Screen Controller */
199 at91_add_device_tsadcc();
198} 200}
199 201
200MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") 202MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index e852609d802f..fb51f0e0a83f 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -172,6 +172,9 @@ extern void __init at91_add_device_ac97(struct atmel_ac97_data *data);
172 /* ISI */ 172 /* ISI */
173extern void __init at91_add_device_isi(void); 173extern void __init at91_add_device_isi(void);
174 174
175 /* Touchscreen Controller */
176extern void __init at91_add_device_tsadcc(void);
177
175 /* LEDs */ 178 /* LEDs */
176extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); 179extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
177extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 180extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);