aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mach-mx31moboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx3/mach-mx31moboard.c')
-rw-r--r--arch/arm/mach-mx3/mach-mx31moboard.c50
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 62b5e40165df..67776bc61c33 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
57static unsigned int moboard_pins[] = { 52static unsigned int moboard_pins[] = {
@@ -130,24 +125,36 @@ static struct platform_device mx31moboard_flash = {
130 125
131static int moboard_uart0_init(struct platform_device *pdev) 126static 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
139static void moboard_uart0_exit(struct platform_device *pdev)
140{
141 gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1));
136} 142}
137 143
138static struct imxuart_platform_data uart0_pdata = { 144static 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
142static struct imxuart_platform_data uart4_pdata = { 149static const struct imxuart_platform_data uart4_pdata __initconst = {
143 .flags = IMXUART_HAVE_RTSCTS, 150 .flags = IMXUART_HAVE_RTSCTS,
144}; 151};
145 152
146static struct imxi2c_platform_data moboard_i2c0_pdata = { 153static const struct imxi2c_platform_data moboard_i2c0_data __initconst = {
147 .bitrate = 400000, 154 .bitrate = 400000,
148}; 155};
149 156
150static struct imxi2c_platform_data moboard_i2c1_pdata = { 157static 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
159static struct spi_imx_master moboard_spi1_master = { 166static 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
289static struct spi_imx_master moboard_spi2_master = { 296static 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));