aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2017-01-30 00:06:43 -0500
committerOlof Johansson <olof@lixom.net>2017-01-30 00:06:43 -0500
commita329b0cac2e3f345f2161ed7cbfb0f2ce11226d9 (patch)
tree728f622dfad42202c650218bae38be79007dd157
parent0cc7d0a6eadf65e5d51ead251c73586260558a57 (diff)
parent5fdb98dcfb0221f488dd238570933fd3dcfae031 (diff)
Merge tag 'imx-cleanup-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc
i.MX cleanup for 4.11: - Remove unused flexcan and esdhc device definitions for i.MX25. - A series from Fabio to remove camera device initialization code from i.MX platform support, since the corresponding media driver has been deprecated and removed from kernel tree. * tag 'imx-cleanup-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: mach-mx27_3ds: Remove camera support ARM: mach-pcm037: Remove camera support ARM: mach-mx35_3ds: Remove camera support ARM: mx31moboard-smartbot: Remove camera support ARM: mx31moboard-marxbot: Remove camera support ARM: mach-mx31_3ds: Remove camera support ARM: imx: remove unused device definitions Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-imx/devices/platform-flexcan.c9
-rw-r--r--arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c10
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c107
-rw-r--r--arch/arm/mach-imx/mach-mx31_3ds.c160
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c103
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c115
-rw-r--r--arch/arm/mach-imx/mx31moboard-marxbot.c92
-rw-r--r--arch/arm/mach-imx/mx31moboard-smartbot.c74
8 files changed, 0 insertions, 670 deletions
diff --git a/arch/arm/mach-imx/devices/platform-flexcan.c b/arch/arm/mach-imx/devices/platform-flexcan.c
index 55d61eaf63c6..8a1a2fc4ce10 100644
--- a/arch/arm/mach-imx/devices/platform-flexcan.c
+++ b/arch/arm/mach-imx/devices/platform-flexcan.c
@@ -19,15 +19,6 @@
19#define imx_flexcan_data_entry(soc, _id, _hwid, _size) \ 19#define imx_flexcan_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_flexcan_data_entry_single(soc, _id, _hwid, _size) 20 [_id] = imx_flexcan_data_entry_single(soc, _id, _hwid, _size)
21 21
22#ifdef CONFIG_SOC_IMX25
23const struct imx_flexcan_data imx25_flexcan_data[] __initconst = {
24#define imx25_flexcan_data_entry(_id, _hwid) \
25 imx_flexcan_data_entry(MX25, _id, _hwid, SZ_16K)
26 imx25_flexcan_data_entry(0, 1),
27 imx25_flexcan_data_entry(1, 2),
28};
29#endif /* ifdef CONFIG_SOC_IMX25 */
30
31#ifdef CONFIG_SOC_IMX35 22#ifdef CONFIG_SOC_IMX35
32const struct imx_flexcan_data imx35_flexcan_data[] __initconst = { 23const struct imx_flexcan_data imx35_flexcan_data[] __initconst = {
33#define imx35_flexcan_data_entry(_id, _hwid) \ 24#define imx35_flexcan_data_entry(_id, _hwid) \
diff --git a/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
index 3d039ef021e0..466c9ccc6675 100644
--- a/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
@@ -22,16 +22,6 @@
22#define imx_sdhci_esdhc_imx_data_entry(soc, devid, id, hwid) \ 22#define imx_sdhci_esdhc_imx_data_entry(soc, devid, id, hwid) \
23 [id] = imx_sdhci_esdhc_imx_data_entry_single(soc, devid, id, hwid) 23 [id] = imx_sdhci_esdhc_imx_data_entry_single(soc, devid, id, hwid)
24 24
25#ifdef CONFIG_SOC_IMX25
26const struct imx_sdhci_esdhc_imx_data
27imx25_sdhci_esdhc_imx_data[] __initconst = {
28#define imx25_sdhci_esdhc_imx_data_entry(_id, _hwid) \
29 imx_sdhci_esdhc_imx_data_entry(MX25, "sdhci-esdhc-imx25", _id, _hwid)
30 imx25_sdhci_esdhc_imx_data_entry(0, 1),
31 imx25_sdhci_esdhc_imx_data_entry(1, 2),
32};
33#endif /* ifdef CONFIG_SOC_IMX25 */
34
35#ifdef CONFIG_SOC_IMX35 25#ifdef CONFIG_SOC_IMX35
36const struct imx_sdhci_esdhc_imx_data 26const struct imx_sdhci_esdhc_imx_data
37imx35_sdhci_esdhc_imx_data[] __initconst = { 27imx35_sdhci_esdhc_imx_data[] __initconst = {
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 7ba651a9b5b8..45e16bd7e2f2 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -31,7 +31,6 @@
31#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
32#include <linux/spi/l4f00242t03.h> 32#include <linux/spi/l4f00242t03.h>
33 33
34#include <media/soc_camera.h>
35 34
36#include <asm/mach-types.h> 35#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
@@ -53,8 +52,6 @@
53#define SD1_CD IMX_GPIO_NR(2, 26) 52#define SD1_CD IMX_GPIO_NR(2, 26)
54#define LCD_RESET IMX_GPIO_NR(1, 3) 53#define LCD_RESET IMX_GPIO_NR(1, 3)
55#define LCD_ENABLE IMX_GPIO_NR(1, 31) 54#define LCD_ENABLE IMX_GPIO_NR(1, 31)
56#define CSI_PWRDWN IMX_GPIO_NR(4, 19)
57#define CSI_RESET IMX_GPIO_NR(3, 6)
58 55
59static const int mx27pdk_pins[] __initconst = { 56static const int mx27pdk_pins[] __initconst = {
60 /* UART1 */ 57 /* UART1 */
@@ -144,21 +141,6 @@ static const int mx27pdk_pins[] __initconst = {
144 PA30_PF_CONTRAST, 141 PA30_PF_CONTRAST,
145 LCD_ENABLE | GPIO_GPIO | GPIO_OUT, 142 LCD_ENABLE | GPIO_GPIO | GPIO_OUT,
146 LCD_RESET | GPIO_GPIO | GPIO_OUT, 143 LCD_RESET | GPIO_GPIO | GPIO_OUT,
147 /* CSI */
148 PB10_PF_CSI_D0,
149 PB11_PF_CSI_D1,
150 PB12_PF_CSI_D2,
151 PB13_PF_CSI_D3,
152 PB14_PF_CSI_D4,
153 PB15_PF_CSI_MCLK,
154 PB16_PF_CSI_PIXCLK,
155 PB17_PF_CSI_D5,
156 PB18_PF_CSI_D6,
157 PB19_PF_CSI_D7,
158 PB20_PF_CSI_VSYNC,
159 PB21_PF_CSI_HSYNC,
160 CSI_PWRDWN | GPIO_GPIO | GPIO_OUT,
161 CSI_RESET | GPIO_GPIO | GPIO_OUT,
162 /* SSI4 */ 144 /* SSI4 */
163 PC16_PF_SSI4_FS, 145 PC16_PF_SSI4_FS,
164 PC17_PF_SSI4_RXD, 146 PC17_PF_SSI4_RXD,
@@ -166,11 +148,6 @@ static const int mx27pdk_pins[] __initconst = {
166 PC19_PF_SSI4_CLK, 148 PC19_PF_SSI4_CLK,
167}; 149};
168 150
169static struct gpio mx27_3ds_camera_gpios[] = {
170 { CSI_PWRDWN, GPIOF_OUT_INIT_HIGH, "camera-power" },
171 { CSI_RESET, GPIOF_OUT_INIT_HIGH, "camera-reset" },
172};
173
174static const struct imxuart_platform_data uart_pdata __initconst = { 151static const struct imxuart_platform_data uart_pdata __initconst = {
175 .flags = IMXUART_HAVE_RTSCTS, 152 .flags = IMXUART_HAVE_RTSCTS,
176}; 153};
@@ -270,7 +247,6 @@ static struct regulator_init_data gpo_init = {
270 247
271static struct regulator_consumer_supply vmmc1_consumers[] = { 248static struct regulator_consumer_supply vmmc1_consumers[] = {
272 REGULATOR_SUPPLY("vcore", "spi0.0"), 249 REGULATOR_SUPPLY("vcore", "spi0.0"),
273 REGULATOR_SUPPLY("cmos_2v8", "soc-camera-pdrv.0"),
274}; 250};
275 251
276static struct regulator_init_data vmmc1_init = { 252static struct regulator_init_data vmmc1_init = {
@@ -299,22 +275,6 @@ static struct regulator_init_data vgen_init = {
299 .consumer_supplies = vgen_consumers, 275 .consumer_supplies = vgen_consumers,
300}; 276};
301 277
302static struct regulator_consumer_supply vvib_consumers[] = {
303 REGULATOR_SUPPLY("cmos_vcore", "soc-camera-pdrv.0"),
304};
305
306static struct regulator_init_data vvib_init = {
307 .constraints = {
308 .min_uV = 1300000,
309 .max_uV = 1300000,
310 .apply_uV = 1,
311 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
312 REGULATOR_CHANGE_STATUS,
313 },
314 .num_consumer_supplies = ARRAY_SIZE(vvib_consumers),
315 .consumer_supplies = vvib_consumers,
316};
317
318static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = { 278static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
319 { 279 {
320 .id = MC13783_REG_VMMC1, 280 .id = MC13783_REG_VMMC1,
@@ -328,9 +288,6 @@ static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
328 }, { 288 }, {
329 .id = MC13783_REG_GPO3, /* Turn on 3.3V */ 289 .id = MC13783_REG_GPO3, /* Turn on 3.3V */
330 .init_data = &gpo_init, 290 .init_data = &gpo_init,
331 }, {
332 .id = MC13783_REG_VVIB, /* Power OV2640 */
333 .init_data = &vvib_init,
334 }, 291 },
335}; 292};
336 293
@@ -370,51 +327,6 @@ static const struct spi_imx_master spi2_pdata __initconst = {
370 .num_chipselect = ARRAY_SIZE(spi2_chipselect), 327 .num_chipselect = ARRAY_SIZE(spi2_chipselect),
371}; 328};
372 329
373static int mx27_3ds_camera_power(struct device *dev, int on)
374{
375 /* enable or disable the camera */
376 pr_debug("%s: %s the camera\n", __func__, on ? "ENABLE" : "DISABLE");
377 gpio_set_value(CSI_PWRDWN, on ? 0 : 1);
378
379 if (!on)
380 goto out;
381
382 /* If enabled, give a reset impulse */
383 gpio_set_value(CSI_RESET, 0);
384 msleep(20);
385 gpio_set_value(CSI_RESET, 1);
386 msleep(100);
387
388out:
389 return 0;
390}
391
392static struct i2c_board_info mx27_3ds_i2c_camera = {
393 I2C_BOARD_INFO("ov2640", 0x30),
394};
395
396static struct regulator_bulk_data mx27_3ds_camera_regs[] = {
397 { .supply = "cmos_vcore" },
398 { .supply = "cmos_2v8" },
399};
400
401static struct soc_camera_link iclink_ov2640 = {
402 .bus_id = 0,
403 .board_info = &mx27_3ds_i2c_camera,
404 .i2c_adapter_id = 0,
405 .power = mx27_3ds_camera_power,
406 .regulators = mx27_3ds_camera_regs,
407 .num_regulators = ARRAY_SIZE(mx27_3ds_camera_regs),
408};
409
410static struct platform_device mx27_3ds_ov2640 = {
411 .name = "soc-camera-pdrv",
412 .id = 0,
413 .dev = {
414 .platform_data = &iclink_ov2640,
415 },
416};
417
418static struct imx_fb_videomode mx27_3ds_modes[] = { 330static struct imx_fb_videomode mx27_3ds_modes[] = {
419 { /* 480x640 @ 60 Hz */ 331 { /* 480x640 @ 60 Hz */
420 .mode = { 332 .mode = {
@@ -471,14 +383,6 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
471 }, 383 },
472}; 384};
473 385
474static struct platform_device *devices[] __initdata = {
475 &mx27_3ds_ov2640,
476};
477
478static const struct mx2_camera_platform_data mx27_3ds_cam_pdata __initconst = {
479 .clk = 26000000,
480};
481
482static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = { 386static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
483 .bitrate = 100000, 387 .bitrate = 100000,
484}; 388};
@@ -498,7 +402,6 @@ static void __init mx27pdk_init(void)
498 imx27_add_spi_imx0(&spi1_pdata); 402 imx27_add_spi_imx0(&spi1_pdata);
499 403
500 imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); 404 imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
501 platform_add_devices(devices, ARRAY_SIZE(devices));
502 imx27_add_imx_fb(&mx27_3ds_fb_data); 405 imx27_add_imx_fb(&mx27_3ds_fb_data);
503 406
504 imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata); 407 imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
@@ -506,8 +409,6 @@ static void __init mx27pdk_init(void)
506 409
507static void __init mx27pdk_late_init(void) 410static void __init mx27pdk_late_init(void)
508{ 411{
509 int ret;
510
511 mx27_3ds_sdhc1_enable_level_translator(); 412 mx27_3ds_sdhc1_enable_level_translator();
512 imx27_add_mxc_mmc(0, &sdhc1_pdata); 413 imx27_add_mxc_mmc(0, &sdhc1_pdata);
513 414
@@ -531,14 +432,6 @@ static void __init mx27pdk_late_init(void)
531 if (mxc_expio_init(MX27_CS5_BASE_ADDR, IMX_GPIO_NR(3, 28))) 432 if (mxc_expio_init(MX27_CS5_BASE_ADDR, IMX_GPIO_NR(3, 28)))
532 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); 433 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
533 434
534 ret = gpio_request_array(mx27_3ds_camera_gpios,
535 ARRAY_SIZE(mx27_3ds_camera_gpios));
536 if (ret) {
537 pr_err("Failed to request camera gpios");
538 iclink_ov2640.power = NULL;
539 }
540
541 imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
542 435
543 imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0); 436 imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
544} 437}
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 12b8a52c9cb4..558e5f8589cb 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -26,16 +26,12 @@
26#include <linux/regulator/machine.h> 26#include <linux/regulator/machine.h>
27#include <linux/usb/otg.h> 27#include <linux/usb/otg.h>
28#include <linux/usb/ulpi.h> 28#include <linux/usb/ulpi.h>
29#include <linux/memblock.h>
30
31#include <media/soc_camera.h>
32 29
33#include <asm/mach-types.h> 30#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
35#include <asm/mach/time.h> 32#include <asm/mach/time.h>
36#include <asm/memory.h> 33#include <asm/memory.h>
37#include <asm/mach/map.h> 34#include <asm/mach/map.h>
38#include <asm/memblock.h>
39 35
40#include "3ds_debugboard.h" 36#include "3ds_debugboard.h"
41#include "common.h" 37#include "common.h"
@@ -137,23 +133,6 @@ static int mx31_3ds_pins[] = {
137 MX31_PIN_HSYNC__HSYNC, 133 MX31_PIN_HSYNC__HSYNC,
138 MX31_PIN_FPSHIFT__FPSHIFT, 134 MX31_PIN_FPSHIFT__FPSHIFT,
139 MX31_PIN_CONTRAST__CONTRAST, 135 MX31_PIN_CONTRAST__CONTRAST,
140 /* CSI */
141 MX31_PIN_CSI_D6__CSI_D6,
142 MX31_PIN_CSI_D7__CSI_D7,
143 MX31_PIN_CSI_D8__CSI_D8,
144 MX31_PIN_CSI_D9__CSI_D9,
145 MX31_PIN_CSI_D10__CSI_D10,
146 MX31_PIN_CSI_D11__CSI_D11,
147 MX31_PIN_CSI_D12__CSI_D12,
148 MX31_PIN_CSI_D13__CSI_D13,
149 MX31_PIN_CSI_D14__CSI_D14,
150 MX31_PIN_CSI_D15__CSI_D15,
151 MX31_PIN_CSI_HSYNC__CSI_HSYNC,
152 MX31_PIN_CSI_MCLK__CSI_MCLK,
153 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
154 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
155 MX31_PIN_CSI_D5__GPIO3_5, /* CMOS PWDN */
156 IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_GPIO), /* CMOS reset */
157 /* SSI */ 136 /* SSI */
158 MX31_PIN_STXD4__STXD4, 137 MX31_PIN_STXD4__STXD4,
159 MX31_PIN_SRXD4__SRXD4, 138 MX31_PIN_SRXD4__SRXD4,
@@ -162,98 +141,6 @@ static int mx31_3ds_pins[] = {
162}; 141};
163 142
164/* 143/*
165 * Camera support
166 */
167static phys_addr_t mx3_camera_base __initdata;
168#define MX31_3DS_CAMERA_BUF_SIZE SZ_8M
169
170#define MX31_3DS_GPIO_CAMERA_PW IOMUX_TO_GPIO(MX31_PIN_CSI_D5)
171#define MX31_3DS_GPIO_CAMERA_RST IOMUX_TO_GPIO(MX31_PIN_RI_DTE1)
172
173static struct gpio mx31_3ds_camera_gpios[] = {
174 { MX31_3DS_GPIO_CAMERA_PW, GPIOF_OUT_INIT_HIGH, "camera-power" },
175 { MX31_3DS_GPIO_CAMERA_RST, GPIOF_OUT_INIT_HIGH, "camera-reset" },
176};
177
178static const struct mx3_camera_pdata mx31_3ds_camera_pdata __initconst = {
179 .flags = MX3_CAMERA_DATAWIDTH_10,
180 .mclk_10khz = 2600,
181};
182
183static int __init mx31_3ds_init_camera(void)
184{
185 int dma, ret = -ENOMEM;
186 struct platform_device *pdev =
187 imx31_alloc_mx3_camera(&mx31_3ds_camera_pdata);
188
189 if (IS_ERR(pdev))
190 return PTR_ERR(pdev);
191
192 if (!mx3_camera_base)
193 goto err;
194
195 dma = dma_declare_coherent_memory(&pdev->dev,
196 mx3_camera_base, mx3_camera_base,
197 MX31_3DS_CAMERA_BUF_SIZE,
198 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
199
200 if (!(dma & DMA_MEMORY_MAP))
201 goto err;
202
203 ret = platform_device_add(pdev);
204 if (ret)
205err:
206 platform_device_put(pdev);
207
208 return ret;
209}
210
211static int mx31_3ds_camera_power(struct device *dev, int on)
212{
213 /* enable or disable the camera */
214 pr_debug("%s: %s the camera\n", __func__, on ? "ENABLE" : "DISABLE");
215 gpio_set_value(MX31_3DS_GPIO_CAMERA_PW, on ? 0 : 1);
216
217 if (!on)
218 goto out;
219
220 /* If enabled, give a reset impulse */
221 gpio_set_value(MX31_3DS_GPIO_CAMERA_RST, 0);
222 msleep(20);
223 gpio_set_value(MX31_3DS_GPIO_CAMERA_RST, 1);
224 msleep(100);
225
226out:
227 return 0;
228}
229
230static struct i2c_board_info mx31_3ds_i2c_camera = {
231 I2C_BOARD_INFO("ov2640", 0x30),
232};
233
234static struct regulator_bulk_data mx31_3ds_camera_regs[] = {
235 { .supply = "cmos_vcore" },
236 { .supply = "cmos_2v8" },
237};
238
239static struct soc_camera_link iclink_ov2640 = {
240 .bus_id = 0,
241 .board_info = &mx31_3ds_i2c_camera,
242 .i2c_adapter_id = 0,
243 .power = mx31_3ds_camera_power,
244 .regulators = mx31_3ds_camera_regs,
245 .num_regulators = ARRAY_SIZE(mx31_3ds_camera_regs),
246};
247
248static struct platform_device mx31_3ds_ov2640 = {
249 .name = "soc-camera-pdrv",
250 .id = 0,
251 .dev = {
252 .platform_data = &iclink_ov2640,
253 },
254};
255
256/*
257 * FB support 144 * FB support
258 */ 145 */
259static const struct fb_videomode fb_modedb[] = { 146static const struct fb_videomode fb_modedb[] = {
@@ -410,7 +297,6 @@ static struct regulator_init_data vmmc2_init = {
410 297
411static struct regulator_consumer_supply vmmc1_consumers[] = { 298static struct regulator_consumer_supply vmmc1_consumers[] = {
412 REGULATOR_SUPPLY("vcore", "spi0.0"), 299 REGULATOR_SUPPLY("vcore", "spi0.0"),
413 REGULATOR_SUPPLY("cmos_2v8", "soc-camera-pdrv.0"),
414}; 300};
415 301
416static struct regulator_init_data vmmc1_init = { 302static struct regulator_init_data vmmc1_init = {
@@ -441,22 +327,6 @@ static struct regulator_init_data vgen_init = {
441 .consumer_supplies = vgen_consumers, 327 .consumer_supplies = vgen_consumers,
442}; 328};
443 329
444static struct regulator_consumer_supply vvib_consumers[] = {
445 REGULATOR_SUPPLY("cmos_vcore", "soc-camera-pdrv.0"),
446};
447
448static struct regulator_init_data vvib_init = {
449 .constraints = {
450 .min_uV = 1300000,
451 .max_uV = 1300000,
452 .apply_uV = 1,
453 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
454 REGULATOR_CHANGE_STATUS,
455 },
456 .num_consumer_supplies = ARRAY_SIZE(vvib_consumers),
457 .consumer_supplies = vvib_consumers,
458};
459
460static struct mc13xxx_regulator_init_data mx31_3ds_regulators[] = { 330static struct mc13xxx_regulator_init_data mx31_3ds_regulators[] = {
461 { 331 {
462 .id = MC13783_REG_PWGT1SPI, /* Power Gate for ARM core. */ 332 .id = MC13783_REG_PWGT1SPI, /* Power Gate for ARM core. */
@@ -480,9 +350,6 @@ static struct mc13xxx_regulator_init_data mx31_3ds_regulators[] = {
480 }, { 350 }, {
481 .id = MC13783_REG_VGEN, /* Power LCD */ 351 .id = MC13783_REG_VGEN, /* Power LCD */
482 .init_data = &vgen_init, 352 .init_data = &vgen_init,
483 }, {
484 .id = MC13783_REG_VVIB, /* Power CMOS */
485 .init_data = &vvib_init,
486 }, 353 },
487}; 354};
488 355
@@ -688,10 +555,6 @@ static const struct imxi2c_platform_data mx31_3ds_i2c0_data __initconst = {
688 .bitrate = 100000, 555 .bitrate = 100000,
689}; 556};
690 557
691static struct platform_device *devices[] __initdata = {
692 &mx31_3ds_ov2640,
693};
694
695static void __init mx31_3ds_init(void) 558static void __init mx31_3ds_init(void)
696{ 559{
697 imx31_soc_init(); 560 imx31_soc_init();
@@ -723,14 +586,10 @@ static void __init mx31_3ds_init(void)
723 586
724static void __init mx31_3ds_late(void) 587static void __init mx31_3ds_late(void)
725{ 588{
726 int ret;
727
728 mx31_3ds_spi_devs[0].irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); 589 mx31_3ds_spi_devs[0].irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
729 spi_register_board_info(mx31_3ds_spi_devs, 590 spi_register_board_info(mx31_3ds_spi_devs,
730 ARRAY_SIZE(mx31_3ds_spi_devs)); 591 ARRAY_SIZE(mx31_3ds_spi_devs));
731 592
732 platform_add_devices(devices, ARRAY_SIZE(devices));
733
734 mx31_3ds_usbotg_init(); 593 mx31_3ds_usbotg_init();
735 if (otg_mode_host) { 594 if (otg_mode_host) {
736 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | 595 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
@@ -751,17 +610,6 @@ static void __init mx31_3ds_late(void)
751 "devices on the debug board are unusable.\n"); 610 "devices on the debug board are unusable.\n");
752 611
753 imx31_add_mxc_mmc(0, &sdhc1_pdata); 612 imx31_add_mxc_mmc(0, &sdhc1_pdata);
754
755 /* CSI */
756 /* Camera power: default - off */
757 ret = gpio_request_array(mx31_3ds_camera_gpios,
758 ARRAY_SIZE(mx31_3ds_camera_gpios));
759 if (ret) {
760 pr_err("Failed to request camera gpios");
761 iclink_ov2640.power = NULL;
762 }
763
764 mx31_3ds_init_camera();
765} 613}
766 614
767static void __init mx31_3ds_timer_init(void) 615static void __init mx31_3ds_timer_init(void)
@@ -769,13 +617,6 @@ static void __init mx31_3ds_timer_init(void)
769 mx31_clocks_init(26000000); 617 mx31_clocks_init(26000000);
770} 618}
771 619
772static void __init mx31_3ds_reserve(void)
773{
774 /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
775 mx3_camera_base = arm_memblock_steal(MX31_3DS_CAMERA_BUF_SIZE,
776 MX31_3DS_CAMERA_BUF_SIZE);
777}
778
779MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") 620MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
780 /* Maintainer: Freescale Semiconductor, Inc. */ 621 /* Maintainer: Freescale Semiconductor, Inc. */
781 .atag_offset = 0x100, 622 .atag_offset = 0x100,
@@ -785,6 +626,5 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
785 .init_time = mx31_3ds_timer_init, 626 .init_time = mx31_3ds_timer_init,
786 .init_machine = mx31_3ds_init, 627 .init_machine = mx31_3ds_init,
787 .init_late = mx31_3ds_late, 628 .init_late = mx31_3ds_late,
788 .reserve = mx31_3ds_reserve,
789 .restart = mxc_restart, 629 .restart = mxc_restart,
790MACHINE_END 630MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index c8c2e0956048..1c33a6ce326c 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -41,12 +41,9 @@
41#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
42#include <asm/mach/time.h> 42#include <asm/mach/time.h>
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44#include <asm/memblock.h>
45 44
46#include <video/platform_lcd.h> 45#include <video/platform_lcd.h>
47 46
48#include <media/soc_camera.h>
49
50#include "3ds_debugboard.h" 47#include "3ds_debugboard.h"
51#include "common.h" 48#include "common.h"
52#include "devices-imx35.h" 49#include "devices-imx35.h"
@@ -233,83 +230,10 @@ static const iomux_v3_cfg_t mx35pdk_pads[] __initconst = {
233 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC, 230 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
234 MX35_PAD_D3_REV__IPU_DISPB_D3_REV, 231 MX35_PAD_D3_REV__IPU_DISPB_D3_REV,
235 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS, 232 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
236 /* CSI */
237 MX35_PAD_TX1__IPU_CSI_D_6,
238 MX35_PAD_TX0__IPU_CSI_D_7,
239 MX35_PAD_CSI_D8__IPU_CSI_D_8,
240 MX35_PAD_CSI_D9__IPU_CSI_D_9,
241 MX35_PAD_CSI_D10__IPU_CSI_D_10,
242 MX35_PAD_CSI_D11__IPU_CSI_D_11,
243 MX35_PAD_CSI_D12__IPU_CSI_D_12,
244 MX35_PAD_CSI_D13__IPU_CSI_D_13,
245 MX35_PAD_CSI_D14__IPU_CSI_D_14,
246 MX35_PAD_CSI_D15__IPU_CSI_D_15,
247 MX35_PAD_CSI_HSYNC__IPU_CSI_HSYNC,
248 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK,
249 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK,
250 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC,
251 /*PMIC IRQ*/ 233 /*PMIC IRQ*/
252 MX35_PAD_GPIO2_0__GPIO2_0, 234 MX35_PAD_GPIO2_0__GPIO2_0,
253}; 235};
254 236
255/*
256 * Camera support
257*/
258static phys_addr_t mx3_camera_base __initdata;
259#define MX35_3DS_CAMERA_BUF_SIZE SZ_8M
260
261static const struct mx3_camera_pdata mx35_3ds_camera_pdata __initconst = {
262 .flags = MX3_CAMERA_DATAWIDTH_8,
263 .mclk_10khz = 2000,
264};
265
266static int __init imx35_3ds_init_camera(void)
267{
268 int dma, ret = -ENOMEM;
269 struct platform_device *pdev =
270 imx35_alloc_mx3_camera(&mx35_3ds_camera_pdata);
271
272 if (IS_ERR(pdev))
273 return PTR_ERR(pdev);
274
275 if (!mx3_camera_base)
276 goto err;
277
278 dma = dma_declare_coherent_memory(&pdev->dev,
279 mx3_camera_base, mx3_camera_base,
280 MX35_3DS_CAMERA_BUF_SIZE,
281 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
282
283 if (!(dma & DMA_MEMORY_MAP))
284 goto err;
285
286 ret = platform_device_add(pdev);
287 if (ret)
288err:
289 platform_device_put(pdev);
290
291 return ret;
292}
293
294static struct i2c_board_info mx35_3ds_i2c_camera = {
295 I2C_BOARD_INFO("ov2640", 0x30),
296};
297
298static struct soc_camera_link iclink_ov2640 = {
299 .bus_id = 0,
300 .board_info = &mx35_3ds_i2c_camera,
301 .i2c_adapter_id = 0,
302 .power = NULL,
303};
304
305static struct platform_device mx35_3ds_ov2640 = {
306 .name = "soc-camera-pdrv",
307 .id = 0,
308 .dev = {
309 .platform_data = &iclink_ov2640,
310 },
311};
312
313static struct regulator_consumer_supply sw1_consumers[] = { 237static struct regulator_consumer_supply sw1_consumers[] = {
314 { 238 {
315 .supply = "cpu_vcc", 239 .supply = "cpu_vcc",
@@ -321,10 +245,6 @@ static struct regulator_consumer_supply vcam_consumers[] = {
321 REGULATOR_SUPPLY("VDDA", "0-000a"), 245 REGULATOR_SUPPLY("VDDA", "0-000a"),
322}; 246};
323 247
324static struct regulator_consumer_supply vaudio_consumers[] = {
325 REGULATOR_SUPPLY("cmos_vio", "soc-camera-pdrv.0"),
326};
327
328static struct regulator_init_data sw1_init = { 248static struct regulator_init_data sw1_init = {
329 .constraints = { 249 .constraints = {
330 .name = "SW1", 250 .name = "SW1",
@@ -405,18 +325,6 @@ static struct regulator_init_data vvideo_init = {
405 } 325 }
406}; 326};
407 327
408static struct regulator_init_data vaudio_init = {
409 .constraints = {
410 .name = "VAUDIO",
411 .min_uV = 2300000,
412 .max_uV = 3000000,
413 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
414 .boot_on = 1
415 },
416 .num_consumer_supplies = ARRAY_SIZE(vaudio_consumers),
417 .consumer_supplies = vaudio_consumers,
418};
419
420static struct regulator_init_data vcam_init = { 328static struct regulator_init_data vcam_init = {
421 .constraints = { 329 .constraints = {
422 .name = "VCAM", 330 .name = "VCAM",
@@ -460,7 +368,6 @@ static struct mc13xxx_regulator_init_data mx35_3ds_regulators[] = {
460 { .id = MC13892_VDIG, .init_data = &vdig_init }, 368 { .id = MC13892_VDIG, .init_data = &vdig_init },
461 { .id = MC13892_VUSB2, .init_data = &vusb2_init }, 369 { .id = MC13892_VUSB2, .init_data = &vusb2_init },
462 { .id = MC13892_VVIDEO, .init_data = &vvideo_init }, 370 { .id = MC13892_VVIDEO, .init_data = &vvideo_init },
463 { .id = MC13892_VAUDIO, .init_data = &vaudio_init },
464 { .id = MC13892_VCAM, .init_data = &vcam_init }, 371 { .id = MC13892_VCAM, .init_data = &vcam_init },
465 { .id = MC13892_VGEN1, .init_data = &vgen1_init }, 372 { .id = MC13892_VGEN1, .init_data = &vgen1_init },
466 { .id = MC13892_VGEN2, .init_data = &vgen2_init }, 373 { .id = MC13892_VGEN2, .init_data = &vgen2_init },
@@ -583,8 +490,6 @@ static void __init mx35_3ds_init(void)
583 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds)); 490 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds));
584 491
585 imx35_add_ipu_core(); 492 imx35_add_ipu_core();
586 platform_device_register(&mx35_3ds_ov2640);
587 imx35_3ds_init_camera();
588} 493}
589 494
590static void __init mx35_3ds_late_init(void) 495static void __init mx35_3ds_late_init(void)
@@ -607,13 +512,6 @@ static void __init mx35pdk_timer_init(void)
607 mx35_clocks_init(); 512 mx35_clocks_init();
608} 513}
609 514
610static void __init mx35_3ds_reserve(void)
611{
612 /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
613 mx3_camera_base = arm_memblock_steal(MX35_3DS_CAMERA_BUF_SIZE,
614 MX35_3DS_CAMERA_BUF_SIZE);
615}
616
617MACHINE_START(MX35_3DS, "Freescale MX35PDK") 515MACHINE_START(MX35_3DS, "Freescale MX35PDK")
618 /* Maintainer: Freescale Semiconductor, Inc */ 516 /* Maintainer: Freescale Semiconductor, Inc */
619 .atag_offset = 0x100, 517 .atag_offset = 0x100,
@@ -623,6 +521,5 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
623 .init_time = mx35pdk_timer_init, 521 .init_time = mx35pdk_timer_init,
624 .init_machine = mx35_3ds_init, 522 .init_machine = mx35_3ds_init,
625 .init_late = mx35_3ds_late_init, 523 .init_late = mx35_3ds_late_init,
626 .reserve = mx35_3ds_reserve,
627 .restart = mxc_restart, 524 .restart = mxc_restart,
628MACHINE_END 525MACHINE_END
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index 9f0f55b0422c..b787ba6897e4 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -31,17 +31,13 @@
31#include <linux/usb/otg.h> 31#include <linux/usb/otg.h>
32#include <linux/usb/ulpi.h> 32#include <linux/usb/ulpi.h>
33#include <linux/gfp.h> 33#include <linux/gfp.h>
34#include <linux/memblock.h>
35#include <linux/regulator/machine.h> 34#include <linux/regulator/machine.h>
36#include <linux/regulator/fixed.h> 35#include <linux/regulator/fixed.h>
37 36
38#include <media/soc_camera.h>
39
40#include <asm/mach-types.h> 37#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
42#include <asm/mach/time.h> 39#include <asm/mach/time.h>
43#include <asm/mach/map.h> 40#include <asm/mach/map.h>
44#include <asm/memblock.h>
45 41
46#include "common.h" 42#include "common.h"
47#include "devices-imx31.h" 43#include "devices-imx31.h"
@@ -150,22 +146,6 @@ static unsigned int pcm037_pins[] = {
150 MX31_PIN_D3_SPL__D3_SPL, 146 MX31_PIN_D3_SPL__D3_SPL,
151 MX31_PIN_D3_CLS__D3_CLS, 147 MX31_PIN_D3_CLS__D3_CLS,
152 MX31_PIN_LCS0__GPIO3_23, 148 MX31_PIN_LCS0__GPIO3_23,
153 /* CSI */
154 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO),
155 MX31_PIN_CSI_D6__CSI_D6,
156 MX31_PIN_CSI_D7__CSI_D7,
157 MX31_PIN_CSI_D8__CSI_D8,
158 MX31_PIN_CSI_D9__CSI_D9,
159 MX31_PIN_CSI_D10__CSI_D10,
160 MX31_PIN_CSI_D11__CSI_D11,
161 MX31_PIN_CSI_D12__CSI_D12,
162 MX31_PIN_CSI_D13__CSI_D13,
163 MX31_PIN_CSI_D14__CSI_D14,
164 MX31_PIN_CSI_D15__CSI_D15,
165 MX31_PIN_CSI_HSYNC__CSI_HSYNC,
166 MX31_PIN_CSI_MCLK__CSI_MCLK,
167 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
168 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
169 /* GPIO */ 149 /* GPIO */
170 IOMUX_MODE(MX31_PIN_ATA_DMACK, IOMUX_CONFIG_GPIO), 150 IOMUX_MODE(MX31_PIN_ATA_DMACK, IOMUX_CONFIG_GPIO),
171 /* OTG */ 151 /* OTG */
@@ -289,34 +269,6 @@ static struct at24_platform_data board_eeprom = {
289 .flags = AT24_FLAG_ADDR16, 269 .flags = AT24_FLAG_ADDR16,
290}; 270};
291 271
292static int pcm037_camera_power(struct device *dev, int on)
293{
294 /* disable or enable the camera in X7 or X8 PCM970 connector */
295 gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), !on);
296 return 0;
297}
298
299static struct i2c_board_info pcm037_i2c_camera[] = {
300 {
301 I2C_BOARD_INFO("mt9t031", 0x5d),
302 }, {
303 I2C_BOARD_INFO("mt9v022", 0x48),
304 },
305};
306
307static struct soc_camera_link iclink_mt9v022 = {
308 .bus_id = 0, /* Must match with the camera ID */
309 .board_info = &pcm037_i2c_camera[1],
310 .i2c_adapter_id = 2,
311};
312
313static struct soc_camera_link iclink_mt9t031 = {
314 .bus_id = 0, /* Must match with the camera ID */
315 .power = pcm037_camera_power,
316 .board_info = &pcm037_i2c_camera[0],
317 .i2c_adapter_id = 2,
318};
319
320static struct i2c_board_info pcm037_i2c_devices[] = { 272static struct i2c_board_info pcm037_i2c_devices[] = {
321 { 273 {
322 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ 274 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
@@ -326,22 +278,6 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
326 } 278 }
327}; 279};
328 280
329static struct platform_device pcm037_mt9t031 = {
330 .name = "soc-camera-pdrv",
331 .id = 0,
332 .dev = {
333 .platform_data = &iclink_mt9t031,
334 },
335};
336
337static struct platform_device pcm037_mt9v022 = {
338 .name = "soc-camera-pdrv",
339 .id = 1,
340 .dev = {
341 .platform_data = &iclink_mt9v022,
342 },
343};
344
345/* Not connected by default */ 281/* Not connected by default */
346#ifdef PCM970_SDHC_RW_SWITCH 282#ifdef PCM970_SDHC_RW_SWITCH
347static int pcm970_sdhc1_get_ro(struct device *dev) 283static int pcm970_sdhc1_get_ro(struct device *dev)
@@ -403,42 +339,9 @@ static const struct imxmmc_platform_data sdhc_pdata __initconst = {
403 .exit = pcm970_sdhc1_exit, 339 .exit = pcm970_sdhc1_exit,
404}; 340};
405 341
406struct mx3_camera_pdata camera_pdata __initdata = {
407 .flags = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
408 .mclk_10khz = 2000,
409};
410
411static phys_addr_t mx3_camera_base __initdata;
412#define MX3_CAMERA_BUF_SIZE SZ_4M
413
414static int __init pcm037_init_camera(void)
415{
416 int dma, ret = -ENOMEM;
417 struct platform_device *pdev = imx31_alloc_mx3_camera(&camera_pdata);
418
419 if (IS_ERR(pdev))
420 return PTR_ERR(pdev);
421
422 dma = dma_declare_coherent_memory(&pdev->dev,
423 mx3_camera_base, mx3_camera_base,
424 MX3_CAMERA_BUF_SIZE,
425 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
426 if (!(dma & DMA_MEMORY_MAP))
427 goto err;
428
429 ret = platform_device_add(pdev);
430 if (ret)
431err:
432 platform_device_put(pdev);
433
434 return ret;
435}
436
437static struct platform_device *devices[] __initdata = { 342static struct platform_device *devices[] __initdata = {
438 &pcm037_flash, 343 &pcm037_flash,
439 &pcm037_sram_device, 344 &pcm037_sram_device,
440 &pcm037_mt9t031,
441 &pcm037_mt9v022,
442}; 345};
443 346
444static const struct fb_videomode fb_modedb[] = { 347static const struct fb_videomode fb_modedb[] = {
@@ -651,13 +554,6 @@ static void __init pcm037_timer_init(void)
651 mx31_clocks_init(26000000); 554 mx31_clocks_init(26000000);
652} 555}
653 556
654static void __init pcm037_reserve(void)
655{
656 /* reserve 4 MiB for mx3-camera */
657 mx3_camera_base = arm_memblock_steal(MX3_CAMERA_BUF_SIZE,
658 MX3_CAMERA_BUF_SIZE);
659}
660
661static void __init pcm037_init_late(void) 557static void __init pcm037_init_late(void)
662{ 558{
663 int ret; 559 int ret;
@@ -677,16 +573,6 @@ static void __init pcm037_init_late(void)
677 573
678 imx31_add_mxc_mmc(0, &sdhc_pdata); 574 imx31_add_mxc_mmc(0, &sdhc_pdata);
679 575
680 /* CSI */
681 /* Camera power: default - off */
682 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
683 if (!ret)
684 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
685 else
686 iclink_mt9t031.power = NULL;
687
688 pcm037_init_camera();
689
690 pcm970_sja1000_resources[1].start = 576 pcm970_sja1000_resources[1].start =
691 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105))); 577 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
692 pcm970_sja1000_resources[1].end = 578 pcm970_sja1000_resources[1].end =
@@ -699,7 +585,6 @@ static void __init pcm037_init_late(void)
699MACHINE_START(PCM037, "Phytec Phycore pcm037") 585MACHINE_START(PCM037, "Phytec Phycore pcm037")
700 /* Maintainer: Pengutronix */ 586 /* Maintainer: Pengutronix */
701 .atag_offset = 0x100, 587 .atag_offset = 0x100,
702 .reserve = pcm037_reserve,
703 .map_io = mx31_map_io, 588 .map_io = mx31_map_io,
704 .init_early = imx31_init_early, 589 .init_early = imx31_init_early,
705 .init_irq = mx31_init_irq, 590 .init_irq = mx31_init_irq,
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 2e895a82a6eb..922d49175cb4 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -24,8 +24,6 @@
24 24
25#include <linux/usb/otg.h> 25#include <linux/usb/otg.h>
26 26
27#include <media/soc_camera.h>
28
29#include "common.h" 27#include "common.h"
30#include "devices-imx31.h" 28#include "devices-imx31.h"
31#include "ehci.h" 29#include "ehci.h"
@@ -39,17 +37,6 @@ static unsigned int marxbot_pins[] = {
39 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0, 37 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
40 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, 38 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
41 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, 39 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
42 /* CSI */
43 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
44 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
45 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
46 MX31_PIN_CSI_D12__CSI_D12, MX31_PIN_CSI_D13__CSI_D13,
47 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
48 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
49 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
50 MX31_PIN_CSI_D4__GPIO3_4, MX31_PIN_CSI_D5__GPIO3_5,
51 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
52 MX31_PIN_TXD2__GPIO1_28,
53 /* dsPIC resets */ 40 /* dsPIC resets */
54 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22, 41 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22,
55 /*battery detection */ 42 /*battery detection */
@@ -143,82 +130,6 @@ static struct spi_board_info marxbot_spi_board_info[] __initdata = {
143 }, 130 },
144}; 131};
145 132
146#define TURRETCAM_POWER IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
147#define BASECAM_POWER IOMUX_TO_GPIO(MX31_PIN_CSI_D5)
148#define TURRETCAM_RST_B IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
149#define BASECAM_RST_B IOMUX_TO_GPIO(MX31_PIN_CSI_D4)
150#define CAM_CHOICE IOMUX_TO_GPIO(MX31_PIN_TXD2)
151
152static int marxbot_basecam_power(struct device *dev, int on)
153{
154 gpio_set_value(BASECAM_POWER, !on);
155 return 0;
156}
157
158static int marxbot_basecam_reset(struct device *dev)
159{
160 gpio_set_value(BASECAM_RST_B, 0);
161 udelay(100);
162 gpio_set_value(BASECAM_RST_B, 1);
163 return 0;
164}
165
166static struct i2c_board_info marxbot_i2c_devices[] = {
167 {
168 I2C_BOARD_INFO("mt9t031", 0x5d),
169 },
170};
171
172static struct soc_camera_link base_iclink = {
173 .bus_id = 0, /* Must match with the camera ID */
174 .power = marxbot_basecam_power,
175 .reset = marxbot_basecam_reset,
176 .board_info = &marxbot_i2c_devices[0],
177 .i2c_adapter_id = 0,
178};
179
180static struct platform_device marxbot_camera[] = {
181 {
182 .name = "soc-camera-pdrv",
183 .id = 0,
184 .dev = {
185 .platform_data = &base_iclink,
186 },
187 },
188};
189
190static struct platform_device *marxbot_cameras[] __initdata = {
191 &marxbot_camera[0],
192};
193
194static int __init marxbot_cam_init(void)
195{
196 int ret = gpio_request(CAM_CHOICE, "cam-choice");
197 if (ret)
198 return ret;
199 gpio_direction_output(CAM_CHOICE, 0);
200
201 ret = gpio_request(BASECAM_RST_B, "basecam-reset");
202 if (ret)
203 return ret;
204 gpio_direction_output(BASECAM_RST_B, 1);
205 ret = gpio_request(BASECAM_POWER, "basecam-standby");
206 if (ret)
207 return ret;
208 gpio_direction_output(BASECAM_POWER, 0);
209
210 ret = gpio_request(TURRETCAM_RST_B, "turretcam-reset");
211 if (ret)
212 return ret;
213 gpio_direction_output(TURRETCAM_RST_B, 1);
214 ret = gpio_request(TURRETCAM_POWER, "turretcam-standby");
215 if (ret)
216 return ret;
217 gpio_direction_output(TURRETCAM_POWER, 0);
218
219 return 0;
220}
221
222#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1) 133#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
223#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1) 134#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
224#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1) 135#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
@@ -356,9 +267,6 @@ void __init mx31moboard_marxbot_init(void)
356 spi_register_board_info(marxbot_spi_board_info, 267 spi_register_board_info(marxbot_spi_board_info,
357 ARRAY_SIZE(marxbot_spi_board_info)); 268 ARRAY_SIZE(marxbot_spi_board_info));
358 269
359 marxbot_cam_init();
360 platform_add_devices(marxbot_cameras, ARRAY_SIZE(marxbot_cameras));
361
362 /* battery present pin */ 270 /* battery present pin */
363 gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present"); 271 gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present");
364 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0)); 272 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0));
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index 89fc35a64448..5cdd7abce515 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -23,8 +23,6 @@
23#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
24#include <linux/usb/ulpi.h> 24#include <linux/usb/ulpi.h>
25 25
26#include <media/soc_camera.h>
27
28#include "board-mx31moboard.h" 26#include "board-mx31moboard.h"
29#include "common.h" 27#include "common.h"
30#include "devices-imx31.h" 28#include "devices-imx31.h"
@@ -37,16 +35,6 @@ static unsigned int smartbot_pins[] = {
37 /* UART1 */ 35 /* UART1 */
38 MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2, 36 MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2,
39 MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2, 37 MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2,
40 /* CSI */
41 MX31_PIN_CSI_D4__CSI_D4, MX31_PIN_CSI_D5__CSI_D5,
42 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
43 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
44 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
45 MX31_PIN_CSI_D12__CSI_D12, MX31_PIN_CSI_D13__CSI_D13,
46 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
47 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
48 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
49 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
50 /* ENABLES */ 38 /* ENABLES */
51 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9, 39 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
52 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, 40 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
@@ -56,65 +44,6 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
56 .flags = IMXUART_HAVE_RTSCTS, 44 .flags = IMXUART_HAVE_RTSCTS,
57}; 45};
58 46
59#define CAM_POWER IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
60#define CAM_RST_B IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
61
62static int smartbot_cam_power(struct device *dev, int on)
63{
64 gpio_set_value(CAM_POWER, !on);
65 return 0;
66}
67
68static int smartbot_cam_reset(struct device *dev)
69{
70 gpio_set_value(CAM_RST_B, 0);
71 udelay(100);
72 gpio_set_value(CAM_RST_B, 1);
73 return 0;
74}
75
76static struct i2c_board_info smartbot_i2c_devices[] = {
77 {
78 I2C_BOARD_INFO("mt9t031", 0x5d),
79 },
80};
81
82static struct soc_camera_link base_iclink = {
83 .bus_id = 0, /* Must match with the camera ID */
84 .power = smartbot_cam_power,
85 .reset = smartbot_cam_reset,
86 .board_info = &smartbot_i2c_devices[0],
87 .i2c_adapter_id = 0,
88};
89
90static struct platform_device smartbot_camera[] = {
91 {
92 .name = "soc-camera-pdrv",
93 .id = 0,
94 .dev = {
95 .platform_data = &base_iclink,
96 },
97 },
98};
99
100static struct platform_device *smartbot_cameras[] __initdata = {
101 &smartbot_camera[0],
102};
103
104static int __init smartbot_cam_init(void)
105{
106 int ret = gpio_request(CAM_RST_B, "cam-reset");
107 if (ret)
108 return ret;
109 gpio_direction_output(CAM_RST_B, 1);
110 ret = gpio_request(CAM_POWER, "cam-standby");
111 if (ret)
112 return ret;
113 gpio_direction_output(CAM_POWER, 0);
114
115 return 0;
116}
117
118static const struct fsl_usb2_platform_data usb_pdata __initconst = { 47static const struct fsl_usb2_platform_data usb_pdata __initconst = {
119 .operating_mode = FSL_USB2_DR_DEVICE, 48 .operating_mode = FSL_USB2_DR_DEVICE,
120 .phy_mode = FSL_USB2_PHY_ULPI, 49 .phy_mode = FSL_USB2_PHY_ULPI,
@@ -201,7 +130,4 @@ void __init mx31moboard_smartbot_init(int board)
201 } 130 }
202 131
203 smartbot_resets_init(); 132 smartbot_resets_init();
204
205 smartbot_cam_init();
206 platform_add_devices(smartbot_cameras, ARRAY_SIZE(smartbot_cameras));
207} 133}