Merge branch 'at91/defconfig' into next/cleanup
[deliverable/linux.git] / arch / arm / mach-at91 / at91rm9200_devices.c
index ad930688358ca1c5683e984dc1b85799b582c5c0..18bacec2b094c202bc9dd60be5b69be0c56a683f 100644 (file)
@@ -114,11 +114,11 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
        if (!data)
                return;
 
-       if (data->vbus_pin) {
+       if (gpio_is_valid(data->vbus_pin)) {
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
        }
-       if (data->pullup_pin)
+       if (gpio_is_valid(data->pullup_pin))
                at91_set_gpio_output(data->pullup_pin, 0);
 
        udc_data = *data;
@@ -135,7 +135,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
 
 #if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
 static u64 eth_dmamask = DMA_BIT_MASK(32);
-static struct at91_eth_data eth_data;
+static struct macb_platform_data eth_data;
 
 static struct resource eth_resources[] = {
        [0] = {
@@ -162,12 +162,12 @@ static struct platform_device at91rm9200_eth_device = {
        .num_resources  = ARRAY_SIZE(eth_resources),
 };
 
-void __init at91_add_device_eth(struct at91_eth_data *data)
+void __init at91_add_device_eth(struct macb_platform_data *data)
 {
        if (!data)
                return;
 
-       if (data->phy_irq_pin) {
+       if (gpio_is_valid(data->phy_irq_pin)) {
                at91_set_gpio_input(data->phy_irq_pin, 0);
                at91_set_deglitch(data->phy_irq_pin, 1);
        }
@@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
        platform_device_register(&at91rm9200_eth_device);
 }
 #else
-void __init at91_add_device_eth(struct at91_eth_data *data) {}
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
 #endif
 
 
@@ -260,7 +260,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        );
 
        /* input/irq */
-       if (data->irq_pin) {
+       if (gpio_is_valid(data->irq_pin)) {
                at91_set_gpio_input(data->irq_pin, 1);
                at91_set_deglitch(data->irq_pin, 1);
        }
@@ -268,7 +268,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        at91_set_deglitch(data->det_pin, 1);
 
        /* outputs, initially off */
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
        at91_set_gpio_output(data->rst_pin, 0);
 
@@ -328,13 +328,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
                return;
 
        /* input/irq */
-       if (data->det_pin) {
+       if (gpio_is_valid(data->det_pin)) {
                at91_set_gpio_input(data->det_pin, 1);
                at91_set_deglitch(data->det_pin, 1);
        }
-       if (data->wp_pin)
+       if (gpio_is_valid(data->wp_pin))
                at91_set_gpio_input(data->wp_pin, 1);
-       if (data->vcc_pin)
+       if (gpio_is_valid(data->vcc_pin))
                at91_set_gpio_output(data->vcc_pin, 0);
 
        /* CLK */
@@ -419,15 +419,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
        );
 
        /* enable pin */
-       if (data->enable_pin)
+       if (gpio_is_valid(data->enable_pin))
                at91_set_gpio_output(data->enable_pin, 1);
 
        /* ready/busy pin */
-       if (data->rdy_pin)
+       if (gpio_is_valid(data->rdy_pin))
                at91_set_gpio_input(data->rdy_pin, 1);
 
        /* card detect pin */
-       if (data->det_pin)
+       if (gpio_is_valid(data->det_pin))
                at91_set_gpio_input(data->det_pin, 1);
 
        at91_set_A_periph(AT91_PIN_PC1, 0);             /* SMOE */
@@ -665,10 +665,24 @@ static void __init at91_add_device_tc(void) { }
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct resource rtc_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_RTC,
+               .end    = AT91RM9200_BASE_RTC + SZ_256 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_ID_SYS,
+               .end    = AT91_ID_SYS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
 static struct platform_device at91rm9200_rtc_device = {
        .name           = "at91_rtc",
        .id             = -1,
-       .num_resources  = 0,
+       .resource       = rtc_resources,
+       .num_resources  = ARRAY_SIZE(rtc_resources),
 };
 
 static void __init at91_add_device_rtc(void)
@@ -877,8 +891,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
 #if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
-               .start  = AT91_BASE_SYS + AT91_DBGU,
-               .end    = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
+               .start  = AT91RM9200_BASE_DBGU,
+               .end    = AT91RM9200_BASE_DBGU + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
This page took 0.027359 seconds and 5 git commands to generate.