aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorJavier Martin <javier.martin@vista-silicon.com>2012-06-01 03:45:33 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-05 03:27:59 -0400
commit18847b42f8d157201550015296a222a9009a04da (patch)
tree299145b1f89c321f32556f5d5f26f8b49e369265 /arch/arm/mach-imx
parentf90da3c7a52ac0c8f07f4d6cd0a7f7677e831916 (diff)
ARM i.MX27 Visstrim M10: fix gpio handling.
Some GPIOs in Visstrim M10 are used without being registered. This leads to USB and video malfunctions. This patch registers those GPIOs to solve the issue. Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index f7b074f496f0..2c6a783d4c04 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -107,6 +107,8 @@ static const int visstrim_m10_pins[] __initconst = {
107 PB23_PF_USB_PWR, 107 PB23_PF_USB_PWR,
108 PB24_PF_USB_OC, 108 PB24_PF_USB_OC,
109 /* CSI */ 109 /* CSI */
110 TVP5150_RSTN | GPIO_GPIO | GPIO_OUT,
111 TVP5150_PWDN | GPIO_GPIO | GPIO_OUT,
110 PB10_PF_CSI_D0, 112 PB10_PF_CSI_D0,
111 PB11_PF_CSI_D1, 113 PB11_PF_CSI_D1,
112 PB12_PF_CSI_D2, 114 PB12_PF_CSI_D2,
@@ -121,6 +123,24 @@ static const int visstrim_m10_pins[] __initconst = {
121 PB21_PF_CSI_HSYNC, 123 PB21_PF_CSI_HSYNC,
122}; 124};
123 125
126static const struct gpio visstrim_m10_gpios[] __initconst = {
127 {
128 .gpio = TVP5150_RSTN,
129 .flags = GPIOF_DIR_OUT | GPIOF_INIT_HIGH,
130 .label = "tvp5150_rstn",
131 },
132 {
133 .gpio = TVP5150_PWDN,
134 .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW,
135 .label = "tvp5150_pwdn",
136 },
137 {
138 .gpio = OTG_PHY_CS_GPIO,
139 .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW,
140 .label = "usbotg_cs",
141 },
142};
143
124/* Camera */ 144/* Camera */
125static int visstrim_camera_power(struct device *dev, int on) 145static int visstrim_camera_power(struct device *dev, int on)
126{ 146{
@@ -164,13 +184,6 @@ static void __init visstrim_camera_init(void)
164 struct platform_device *pdev; 184 struct platform_device *pdev;
165 int dma; 185 int dma;
166 186
167 /* Initialize tvp5150 gpios */
168 mxc_gpio_mode(TVP5150_RSTN | GPIO_GPIO | GPIO_OUT);
169 mxc_gpio_mode(TVP5150_PWDN | GPIO_GPIO | GPIO_OUT);
170 gpio_set_value(TVP5150_RSTN, 1);
171 gpio_set_value(TVP5150_PWDN, 0);
172 ndelay(1);
173
174 gpio_set_value(TVP5150_PWDN, 1); 187 gpio_set_value(TVP5150_PWDN, 1);
175 ndelay(1); 188 ndelay(1);
176 gpio_set_value(TVP5150_RSTN, 0); 189 gpio_set_value(TVP5150_RSTN, 0);
@@ -351,10 +364,6 @@ static struct i2c_board_info visstrim_m10_i2c_devices[] = {
351/* USB OTG */ 364/* USB OTG */
352static int otg_phy_init(struct platform_device *pdev) 365static int otg_phy_init(struct platform_device *pdev)
353{ 366{
354 gpio_set_value(OTG_PHY_CS_GPIO, 0);
355
356 mdelay(10);
357
358 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); 367 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
359} 368}
360 369
@@ -380,6 +389,11 @@ static void __init visstrim_m10_board_init(void)
380 if (ret) 389 if (ret)
381 pr_err("Failed to setup pins (%d)\n", ret); 390 pr_err("Failed to setup pins (%d)\n", ret);
382 391
392 ret = gpio_request_array(visstrim_m10_gpios,
393 ARRAY_SIZE(visstrim_m10_gpios));
394 if (ret)
395 pr_err("Failed to request gpios (%d)\n", ret);
396
383 imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata); 397 imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata);
384 imx27_add_imx_uart0(&uart_pdata); 398 imx27_add_imx_uart0(&uart_pdata);
385 399