Merge remote-tracking branch 'korg_arm-soc/timer/cleanup' into cleanup
[linux-3.10.git] / arch / arm / mach-imx / mach-apf9328.c
index 146a4f0..067580b 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
 #include <linux/dm9000.h>
+#include <linux/gpio.h>
+#include <linux/i2c.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 
-#include <mach/common.h>
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-#include <mach/iomux-mx1.h>
-
+#include "common.h"
 #include "devices-imx1.h"
+#include "hardware.h"
+#include "iomux-mx1.h"
 
 static const int apf9328_pins[] __initconst = {
        /* UART1 */
@@ -41,6 +41,9 @@ static const int apf9328_pins[] __initconst = {
        PB29_PF_UART2_RTS,
        PB30_PF_UART2_TXD,
        PB31_PF_UART2_RXD,
+       /* I2C */
+       PA15_PF_I2C_SDA,
+       PA16_PF_I2C_SCL,
 };
 
 /*
@@ -83,8 +86,7 @@ static struct resource dm9000_resources[] = {
                .end    = MX1_CS4_PHYS + 0x00C00003,
                .flags  = IORESOURCE_MEM,
        }, {
-               .start  = IRQ_GPIOB(14),
-               .end    = IRQ_GPIOB(14),
+               /* irq number is run-time assigned */
                .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
        },
 };
@@ -103,6 +105,10 @@ static const struct imxuart_platform_data uart1_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
 };
 
+static const struct imxi2c_platform_data apf9328_i2c_data __initconst = {
+       .bitrate = 100000,
+};
+
 static struct platform_device *devices[] __initdata = {
        &apf9328_flash_device,
        &dm9000x_device,
@@ -119,6 +125,10 @@ static void __init apf9328_init(void)
        imx1_add_imx_uart0(NULL);
        imx1_add_imx_uart1(&uart1_pdata);
 
+       imx1_add_imx_i2c(&apf9328_i2c_data);
+
+       dm9000_resources[2].start = gpio_to_irq(IMX_GPIO_NR(2, 14));
+       dm9000_resources[2].end = gpio_to_irq(IMX_GPIO_NR(2, 14));
        platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
@@ -127,17 +137,13 @@ static void __init apf9328_timer_init(void)
        mx1_clocks_init(32768);
 }
 
-static struct sys_timer apf9328_timer = {
-       .init   = apf9328_timer_init,
-};
-
 MACHINE_START(APF9328, "Armadeus APF9328")
        /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */
        .map_io       = mx1_map_io,
        .init_early   = imx1_init_early,
        .init_irq     = mx1_init_irq,
        .handle_irq   = imx1_handle_irq,
-       .timer        = &apf9328_timer,
+       .init_time      = apf9328_timer_init,
        .init_machine = apf9328_init,
        .restart        = mxc_restart,
 MACHINE_END