diff options
Diffstat (limited to 'arch/arm/mach-mx3/mach-mx31moboard.c')
| -rw-r--r-- | arch/arm/mach-mx3/mach-mx31moboard.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index 62b5e40165d..67776bc61c3 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c | |||
| @@ -10,10 +10,6 @@ | |||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | */ | 13 | */ |
| 18 | 14 | ||
| 19 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
| @@ -42,16 +38,15 @@ | |||
| 42 | #include <mach/board-mx31moboard.h> | 38 | #include <mach/board-mx31moboard.h> |
| 43 | #include <mach/common.h> | 39 | #include <mach/common.h> |
| 44 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
| 45 | #include <mach/imx-uart.h> | ||
| 46 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
| 47 | #include <mach/ipu.h> | 42 | #include <mach/ipu.h> |
| 48 | #include <mach/i2c.h> | ||
| 49 | #include <mach/mmc.h> | 43 | #include <mach/mmc.h> |
| 50 | #include <mach/mxc_ehci.h> | 44 | #include <mach/mxc_ehci.h> |
| 51 | #include <mach/mx3_camera.h> | 45 | #include <mach/mx3_camera.h> |
| 52 | #include <mach/spi.h> | 46 | #include <mach/spi.h> |
| 53 | #include <mach/ulpi.h> | 47 | #include <mach/ulpi.h> |
| 54 | 48 | ||
| 49 | #include "devices-imx31.h" | ||
| 55 | #include "devices.h" | 50 | #include "devices.h" |
| 56 | 51 | ||
| 57 | static unsigned int moboard_pins[] = { | 52 | static unsigned int moboard_pins[] = { |
| @@ -130,24 +125,36 @@ static struct platform_device mx31moboard_flash = { | |||
| 130 | 125 | ||
| 131 | static int moboard_uart0_init(struct platform_device *pdev) | 126 | static int moboard_uart0_init(struct platform_device *pdev) |
| 132 | { | 127 | { |
| 133 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack"); | 128 | int ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack"); |
| 134 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0); | 129 | if (ret) |
| 135 | return 0; | 130 | return ret; |
| 131 | |||
| 132 | ret = gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0); | ||
| 133 | if (ret) | ||
| 134 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1)); | ||
| 135 | |||
| 136 | return ret; | ||
| 137 | } | ||
| 138 | |||
| 139 | static void moboard_uart0_exit(struct platform_device *pdev) | ||
| 140 | { | ||
| 141 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1)); | ||
| 136 | } | 142 | } |
| 137 | 143 | ||
| 138 | static struct imxuart_platform_data uart0_pdata = { | 144 | static const struct imxuart_platform_data uart0_pdata __initconst = { |
| 139 | .init = moboard_uart0_init, | 145 | .init = moboard_uart0_init, |
| 146 | .exit = moboard_uart0_exit, | ||
| 140 | }; | 147 | }; |
| 141 | 148 | ||
| 142 | static struct imxuart_platform_data uart4_pdata = { | 149 | static const struct imxuart_platform_data uart4_pdata __initconst = { |
| 143 | .flags = IMXUART_HAVE_RTSCTS, | 150 | .flags = IMXUART_HAVE_RTSCTS, |
| 144 | }; | 151 | }; |
| 145 | 152 | ||
| 146 | static struct imxi2c_platform_data moboard_i2c0_pdata = { | 153 | static const struct imxi2c_platform_data moboard_i2c0_data __initconst = { |
| 147 | .bitrate = 400000, | 154 | .bitrate = 400000, |
| 148 | }; | 155 | }; |
| 149 | 156 | ||
| 150 | static struct imxi2c_platform_data moboard_i2c1_pdata = { | 157 | static const struct imxi2c_platform_data moboard_i2c1_data __initconst = { |
| 151 | .bitrate = 100000, | 158 | .bitrate = 100000, |
| 152 | }; | 159 | }; |
| 153 | 160 | ||
| @@ -156,7 +163,7 @@ static int moboard_spi1_cs[] = { | |||
| 156 | MXC_SPI_CS(2), | 163 | MXC_SPI_CS(2), |
| 157 | }; | 164 | }; |
| 158 | 165 | ||
| 159 | static struct spi_imx_master moboard_spi1_master = { | 166 | static const struct spi_imx_master moboard_spi1_pdata __initconst = { |
| 160 | .chipselect = moboard_spi1_cs, | 167 | .chipselect = moboard_spi1_cs, |
| 161 | .num_chipselect = ARRAY_SIZE(moboard_spi1_cs), | 168 | .num_chipselect = ARRAY_SIZE(moboard_spi1_cs), |
| 162 | }; | 169 | }; |
| @@ -286,7 +293,7 @@ static int moboard_spi2_cs[] = { | |||
| 286 | MXC_SPI_CS(1), | 293 | MXC_SPI_CS(1), |
| 287 | }; | 294 | }; |
| 288 | 295 | ||
| 289 | static struct spi_imx_master moboard_spi2_master = { | 296 | static const struct spi_imx_master moboard_spi2_pdata __initconst = { |
| 290 | .chipselect = moboard_spi2_cs, | 297 | .chipselect = moboard_spi2_cs, |
| 291 | .num_chipselect = ARRAY_SIZE(moboard_spi2_cs), | 298 | .num_chipselect = ARRAY_SIZE(moboard_spi2_cs), |
| 292 | }; | 299 | }; |
| @@ -499,15 +506,14 @@ static void __init mxc_board_init(void) | |||
| 499 | 506 | ||
| 500 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 507 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 501 | 508 | ||
| 502 | mxc_register_device(&mxc_uart_device0, &uart0_pdata); | 509 | imx31_add_imx_uart0(&uart0_pdata); |
| 503 | 510 | imx31_add_imx_uart4(&uart4_pdata); | |
| 504 | mxc_register_device(&mxc_uart_device4, &uart4_pdata); | ||
| 505 | 511 | ||
| 506 | mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); | 512 | imx31_add_imx_i2c0(&moboard_i2c0_data); |
| 507 | mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); | 513 | imx31_add_imx_i2c1(&moboard_i2c1_data); |
| 508 | 514 | ||
| 509 | mxc_register_device(&mxc_spi_device1, &moboard_spi1_master); | 515 | imx31_add_spi_imx1(&moboard_spi1_pdata); |
| 510 | mxc_register_device(&mxc_spi_device2, &moboard_spi2_master); | 516 | imx31_add_spi_imx2(&moboard_spi2_pdata); |
| 511 | 517 | ||
| 512 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); | 518 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); |
| 513 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | 519 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); |
