]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/at91sam9263_devices.c
[ARM] 4752/1: [AT91] RTT, RTC and WDT peripherals on SAM9
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / at91sam9263_devices.c
index ac329a98e9596ce1e56e784cab86b0c4f1fdab62..b4eb21769db917421c5e173989768fa0cfdc19b5 100644 (file)
@@ -731,6 +731,117 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Image Sensor Interface
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_VIDEO_AT91_ISI) || defined(CONFIG_VIDEO_AT91_ISI_MODULE)
+
+struct resource isi_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_ISI,
+               .end    = AT91SAM9263_BASE_ISI + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_ISI,
+               .end    = AT91SAM9263_ID_ISI,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_isi_device = {
+       .name           = "at91_isi",
+       .id             = -1,
+       .resource       = isi_resources,
+       .num_resources  = ARRAY_SIZE(isi_resources),
+};
+
+void __init at91_add_device_isi(void)
+{
+       at91_set_A_periph(AT91_PIN_PE0, 0);     /* ISI_D0 */
+       at91_set_A_periph(AT91_PIN_PE1, 0);     /* ISI_D1 */
+       at91_set_A_periph(AT91_PIN_PE2, 0);     /* ISI_D2 */
+       at91_set_A_periph(AT91_PIN_PE3, 0);     /* ISI_D3 */
+       at91_set_A_periph(AT91_PIN_PE4, 0);     /* ISI_D4 */
+       at91_set_A_periph(AT91_PIN_PE5, 0);     /* ISI_D5 */
+       at91_set_A_periph(AT91_PIN_PE6, 0);     /* ISI_D6 */
+       at91_set_A_periph(AT91_PIN_PE7, 0);     /* ISI_D7 */
+       at91_set_A_periph(AT91_PIN_PE8, 0);     /* ISI_PCK */
+       at91_set_A_periph(AT91_PIN_PE9, 0);     /* ISI_HSYNC */
+       at91_set_A_periph(AT91_PIN_PE10, 0);    /* ISI_VSYNC */
+       at91_set_B_periph(AT91_PIN_PE11, 0);    /* ISI_MCK (PCK3) */
+       at91_set_B_periph(AT91_PIN_PE12, 0);    /* ISI_PD8 */
+       at91_set_B_periph(AT91_PIN_PE13, 0);    /* ISI_PD9 */
+       at91_set_B_periph(AT91_PIN_PE14, 0);    /* ISI_PD10 */
+       at91_set_B_periph(AT91_PIN_PE15, 0);    /* ISI_PD11 */
+}
+#else
+void __init at91_add_device_isi(void) {}
+#endif
+
+
+/* --------------------------------------------------------------------
+ *  RTT
+ * -------------------------------------------------------------------- */
+
+static struct resource rtt0_resources[] = {
+       {
+               .start  = AT91_BASE_SYS + AT91_RTT0,
+               .end    = AT91_BASE_SYS + AT91_RTT0 + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91sam9263_rtt0_device = {
+       .name           = "at91_rtt",
+       .id             = 0,
+       .resource       = rtt0_resources,
+       .num_resources  = ARRAY_SIZE(rtt0_resources),
+};
+
+static struct resource rtt1_resources[] = {
+       {
+               .start  = AT91_BASE_SYS + AT91_RTT1,
+               .end    = AT91_BASE_SYS + AT91_RTT1 + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device at91sam9263_rtt1_device = {
+       .name           = "at91_rtt",
+       .id             = 1,
+       .resource       = rtt1_resources,
+       .num_resources  = ARRAY_SIZE(rtt1_resources),
+};
+
+static void __init at91_add_device_rtt(void)
+{
+       platform_device_register(&at91sam9263_rtt0_device);
+       platform_device_register(&at91sam9263_rtt1_device);
+}
+
+
+/* --------------------------------------------------------------------
+ *  Watchdog
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
+static struct platform_device at91sam9263_wdt_device = {
+       .name           = "at91_wdt",
+       .id             = -1,
+       .num_resources  = 0,
+};
+
+static void __init at91_add_device_watchdog(void)
+{
+       platform_device_register(&at91sam9263_wdt_device);
+}
+#else
+static void __init at91_add_device_watchdog(void) {}
+#endif
+
+
 /* --------------------------------------------------------------------
  *  LEDs
  * -------------------------------------------------------------------- */
@@ -971,6 +1082,8 @@ void __init at91_add_device_serial(void) {}
  */
 static int __init at91_add_standard_devices(void)
 {
+       at91_add_device_rtt();
+       at91_add_device_watchdog();
        return 0;
 }