]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 5260/1: [AT91] Touchscreen on AT91SAM9RL
authorAndrew Victor <linux@maxim.org.za>
Thu, 18 Sep 2008 18:45:35 +0000 (19:45 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 21 Sep 2008 21:58:39 +0000 (22:58 +0100)
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>
arch/arm/configs/at91sam9rlek_defconfig
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/include/mach/board.h

index 1c76642272a1bde973eabeb7a4f0164bded8b36a..811bebbdc7845adc837ee62597660c76b55a1aca 100644 (file)
@@ -496,6 +496,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_PENMOUNT is not set
 # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
 # CONFIG_TOUCHSCREEN_UCB1400 is not set
 # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
 # CONFIG_INPUT_MISC is not set
index 3f9fed4902b886381a7e7000826cb14b4a30c3da..87deb1e1b529854fd74c330adce5f02daa5f5599 100644 (file)
@@ -526,6 +526,51 @@ static void __init at91_add_device_tc(void) { }
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Touchscreen
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
+static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
+
+static struct resource tsadcc_resources[] = {
+       [0] = {
+               .start  = AT91SAM9RL_BASE_TSC,
+               .end    = AT91SAM9RL_BASE_TSC + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9RL_ID_TSC,
+               .end    = AT91SAM9RL_ID_TSC,
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device at91sam9rl_tsadcc_device = {
+       .name           = "atmel_tsadcc",
+       .id             = -1,
+       .dev            = {
+                               .dma_mask               = &tsadcc_dmamask,
+                               .coherent_dma_mask      = DMA_BIT_MASK(32),
+       },
+       .resource       = tsadcc_resources,
+       .num_resources  = ARRAY_SIZE(tsadcc_resources),
+};
+
+void __init at91_add_device_tsadcc(void)
+{
+       at91_set_A_periph(AT91_PIN_PA17, 0);    /* AD0_XR */
+       at91_set_A_periph(AT91_PIN_PA18, 0);    /* AD1_XL */
+       at91_set_A_periph(AT91_PIN_PA19, 0);    /* AD2_YT */
+       at91_set_A_periph(AT91_PIN_PA20, 0);    /* AD3_TB */
+
+       platform_device_register(&at91sam9rl_tsadcc_device);
+}
+#else
+void __init at91_add_device_tsadcc(void) {}
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTC
  * -------------------------------------------------------------------- */
index 3d3f61572cff560f7ae175cc454da59c5cdb414c..2708518643084f78d6eacd5d1e04c3a214ec53b9 100644 (file)
@@ -195,6 +195,8 @@ static void __init ek_board_init(void)
        at91_add_device_mmc(0, &ek_mmc_data);
        /* LCD Controller */
        at91_add_device_lcdc(&ek_lcdc_data);
+       /* Touch Screen Controller */
+       at91_add_device_tsadcc();
 }
 
 MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
index e852609d802f18a94dc4371d2300a5cc3df1b82d..fb51f0e0a83fb933b718c80960a46cd60b831ce8 100644 (file)
@@ -172,6 +172,9 @@ extern void __init at91_add_device_ac97(struct atmel_ac97_data *data);
  /* ISI */
 extern void __init at91_add_device_isi(void);
 
+ /* Touchscreen Controller */
+extern void __init at91_add_device_tsadcc(void);
+
  /* LEDs */
 extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
 extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);