diff options
Diffstat (limited to 'arch/arm/mach-mx1/mx1ads.c')
| -rw-r--r-- | arch/arm/mach-mx1/mx1ads.c | 92 |
1 files changed, 27 insertions, 65 deletions
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c index e54057fb855b..e5b0c0a83c3b 100644 --- a/arch/arm/mach-mx1/mx1ads.c +++ b/arch/arm/mach-mx1/mx1ads.c | |||
| @@ -12,77 +12,56 @@ | |||
| 12 | * warranty of any kind, whether express or implied. | 12 | * warranty of any kind, whether express or implied. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/kernel.h> | 15 | #include <linux/i2c.h> |
| 16 | #include <linux/i2c/pcf857x.h> | ||
| 16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/kernel.h> | ||
| 17 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 18 | #include <linux/mtd/physmap.h> | 20 | #include <linux/mtd/physmap.h> |
| 19 | #include <linux/i2c.h> | ||
| 20 | #include <linux/i2c/pcf857x.h> | ||
| 21 | 21 | ||
| 22 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
| 23 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach/time.h> | 24 | #include <asm/mach/time.h> |
| 25 | 25 | ||
| 26 | #include <mach/irqs.h> | ||
| 27 | #include <mach/hardware.h> | ||
| 28 | #include <mach/common.h> | 26 | #include <mach/common.h> |
| 29 | #include <mach/imx-uart.h> | 27 | #include <mach/hardware.h> |
| 30 | #include <mach/irqs.h> | ||
| 31 | #include <mach/i2c.h> | 28 | #include <mach/i2c.h> |
| 29 | #include <mach/imx-uart.h> | ||
| 32 | #include <mach/iomux.h> | 30 | #include <mach/iomux.h> |
| 31 | #include <mach/irqs.h> | ||
| 32 | |||
| 33 | #include "devices.h" | 33 | #include "devices.h" |
| 34 | 34 | ||
| 35 | /* | 35 | static int mx1ads_pins[] = { |
| 36 | * UARTs platform data | 36 | /* UART1 */ |
| 37 | */ | ||
| 38 | static int mxc_uart1_pins[] = { | ||
| 39 | PC9_PF_UART1_CTS, | 37 | PC9_PF_UART1_CTS, |
| 40 | PC10_PF_UART1_RTS, | 38 | PC10_PF_UART1_RTS, |
| 41 | PC11_PF_UART1_TXD, | 39 | PC11_PF_UART1_TXD, |
| 42 | PC12_PF_UART1_RXD, | 40 | PC12_PF_UART1_RXD, |
| 43 | }; | 41 | /* UART2 */ |
| 44 | |||
| 45 | static int uart1_mxc_init(struct platform_device *pdev) | ||
| 46 | { | ||
| 47 | return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, | ||
| 48 | ARRAY_SIZE(mxc_uart1_pins), "UART1"); | ||
| 49 | } | ||
| 50 | |||
| 51 | static int uart1_mxc_exit(struct platform_device *pdev) | ||
| 52 | { | ||
| 53 | mxc_gpio_release_multiple_pins(mxc_uart1_pins, | ||
| 54 | ARRAY_SIZE(mxc_uart1_pins)); | ||
| 55 | return 0; | ||
| 56 | } | ||
| 57 | |||
| 58 | static int mxc_uart2_pins[] = { | ||
| 59 | PB28_PF_UART2_CTS, | 42 | PB28_PF_UART2_CTS, |
| 60 | PB29_PF_UART2_RTS, | 43 | PB29_PF_UART2_RTS, |
| 61 | PB30_PF_UART2_TXD, | 44 | PB30_PF_UART2_TXD, |
| 62 | PB31_PF_UART2_RXD, | 45 | PB31_PF_UART2_RXD, |
| 46 | /* I2C */ | ||
| 47 | PA15_PF_I2C_SDA, | ||
| 48 | PA16_PF_I2C_SCL, | ||
| 49 | /* SPI */ | ||
| 50 | PC13_PF_SPI1_SPI_RDY, | ||
| 51 | PC14_PF_SPI1_SCLK, | ||
| 52 | PC15_PF_SPI1_SS, | ||
| 53 | PC16_PF_SPI1_MISO, | ||
| 54 | PC17_PF_SPI1_MOSI, | ||
| 63 | }; | 55 | }; |
| 64 | 56 | ||
| 65 | static int uart2_mxc_init(struct platform_device *pdev) | 57 | /* |
| 66 | { | 58 | * UARTs platform data |
| 67 | return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, | 59 | */ |
| 68 | ARRAY_SIZE(mxc_uart2_pins), "UART2"); | ||
| 69 | } | ||
| 70 | |||
| 71 | static int uart2_mxc_exit(struct platform_device *pdev) | ||
| 72 | { | ||
| 73 | mxc_gpio_release_multiple_pins(mxc_uart2_pins, | ||
| 74 | ARRAY_SIZE(mxc_uart2_pins)); | ||
| 75 | return 0; | ||
| 76 | } | ||
| 77 | 60 | ||
| 78 | static struct imxuart_platform_data uart_pdata[] = { | 61 | static struct imxuart_platform_data uart_pdata[] = { |
| 79 | { | 62 | { |
| 80 | .init = uart1_mxc_init, | ||
| 81 | .exit = uart1_mxc_exit, | ||
| 82 | .flags = IMXUART_HAVE_RTSCTS, | 63 | .flags = IMXUART_HAVE_RTSCTS, |
| 83 | }, { | 64 | }, { |
| 84 | .init = uart2_mxc_init, | ||
| 85 | .exit = uart2_mxc_exit, | ||
| 86 | .flags = IMXUART_HAVE_RTSCTS, | 65 | .flags = IMXUART_HAVE_RTSCTS, |
| 87 | }, | 66 | }, |
| 88 | }; | 67 | }; |
| @@ -111,24 +90,6 @@ static struct platform_device flash_device = { | |||
| 111 | /* | 90 | /* |
| 112 | * I2C | 91 | * I2C |
| 113 | */ | 92 | */ |
| 114 | |||
| 115 | static int i2c_pins[] = { | ||
| 116 | PA15_PF_I2C_SDA, | ||
| 117 | PA16_PF_I2C_SCL, | ||
| 118 | }; | ||
| 119 | |||
| 120 | static int i2c_init(struct device *dev) | ||
| 121 | { | ||
| 122 | return mxc_gpio_setup_multiple_pins(i2c_pins, | ||
| 123 | ARRAY_SIZE(i2c_pins), "I2C"); | ||
| 124 | } | ||
| 125 | |||
| 126 | static void i2c_exit(struct device *dev) | ||
| 127 | { | ||
| 128 | mxc_gpio_release_multiple_pins(i2c_pins, | ||
| 129 | ARRAY_SIZE(i2c_pins)); | ||
| 130 | } | ||
| 131 | |||
| 132 | static struct pcf857x_platform_data pcf857x_data[] = { | 93 | static struct pcf857x_platform_data pcf857x_data[] = { |
| 133 | { | 94 | { |
| 134 | .gpio_base = 4 * 32, | 95 | .gpio_base = 4 * 32, |
| @@ -139,8 +100,6 @@ static struct pcf857x_platform_data pcf857x_data[] = { | |||
| 139 | 100 | ||
| 140 | static struct imxi2c_platform_data mx1ads_i2c_data = { | 101 | static struct imxi2c_platform_data mx1ads_i2c_data = { |
| 141 | .bitrate = 100000, | 102 | .bitrate = 100000, |
| 142 | .init = i2c_init, | ||
| 143 | .exit = i2c_exit, | ||
| 144 | }; | 103 | }; |
| 145 | 104 | ||
| 146 | static struct i2c_board_info mx1ads_i2c_devices[] = { | 105 | static struct i2c_board_info mx1ads_i2c_devices[] = { |
| @@ -160,6 +119,9 @@ static struct i2c_board_info mx1ads_i2c_devices[] = { | |||
| 160 | */ | 119 | */ |
| 161 | static void __init mx1ads_init(void) | 120 | static void __init mx1ads_init(void) |
| 162 | { | 121 | { |
| 122 | mxc_gpio_setup_multiple_pins(mx1ads_pins, | ||
| 123 | ARRAY_SIZE(mx1ads_pins), "mx1ads"); | ||
| 124 | |||
| 163 | /* UART */ | 125 | /* UART */ |
| 164 | mxc_register_device(&imx_uart1_device, &uart_pdata[0]); | 126 | mxc_register_device(&imx_uart1_device, &uart_pdata[0]); |
| 165 | mxc_register_device(&imx_uart2_device, &uart_pdata[1]); | 127 | mxc_register_device(&imx_uart2_device, &uart_pdata[1]); |
| @@ -188,7 +150,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS") | |||
| 188 | .phys_io = IMX_IO_PHYS, | 150 | .phys_io = IMX_IO_PHYS, |
| 189 | .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, | 151 | .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, |
| 190 | .boot_params = PHYS_OFFSET + 0x100, | 152 | .boot_params = PHYS_OFFSET + 0x100, |
| 191 | .map_io = mxc_map_io, | 153 | .map_io = mx1_map_io, |
| 192 | .init_irq = mxc_init_irq, | 154 | .init_irq = mxc_init_irq, |
| 193 | .timer = &mx1ads_timer, | 155 | .timer = &mx1ads_timer, |
| 194 | .init_machine = mx1ads_init, | 156 | .init_machine = mx1ads_init, |
| @@ -198,7 +160,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS") | |||
| 198 | .phys_io = IMX_IO_PHYS, | 160 | .phys_io = IMX_IO_PHYS, |
| 199 | .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, | 161 | .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, |
| 200 | .boot_params = PHYS_OFFSET + 0x100, | 162 | .boot_params = PHYS_OFFSET + 0x100, |
| 201 | .map_io = mxc_map_io, | 163 | .map_io = mx1_map_io, |
| 202 | .init_irq = mxc_init_irq, | 164 | .init_irq = mxc_init_irq, |
| 203 | .timer = &mx1ads_timer, | 165 | .timer = &mx1ads_timer, |
| 204 | .init_machine = mx1ads_init, | 166 | .init_machine = mx1ads_init, |
