~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-imx/mach-imx27_visstrim_m10.c

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  * mach-imx27_visstrim_m10.c
  4  *
  5  * Copyright 2010  Javier Martin <javier.martin@vista-silicon.com>
  6  *
  7  * Based on mach-pcm038.c, mach-pca100.c, mach-mx27ads.c and others.
  8  */
  9 
 10 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 11 
 12 #include <linux/platform_device.h>
 13 #include <linux/mtd/physmap.h>
 14 #include <linux/i2c.h>
 15 #include <linux/platform_data/pca953x.h>
 16 #include <linux/input.h>
 17 #include <linux/gpio.h>
 18 #include <linux/delay.h>
 19 #include <linux/dma-mapping.h>
 20 #include <linux/leds.h>
 21 #include <linux/platform_data/asoc-mx27vis.h>
 22 #include <media/soc_camera.h>
 23 #include <sound/tlv320aic32x4.h>
 24 #include <asm/mach-types.h>
 25 #include <asm/mach/arch.h>
 26 #include <asm/mach/time.h>
 27 #include <asm/system_info.h>
 28 #include <asm/memblock.h>
 29 
 30 #include "common.h"
 31 #include "devices-imx27.h"
 32 #include "ehci.h"
 33 #include "hardware.h"
 34 #include "iomux-mx27.h"
 35 
 36 #define TVP5150_RSTN (GPIO_PORTC + 18)
 37 #define TVP5150_PWDN (GPIO_PORTC + 19)
 38 #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17)
 39 #define SDHC1_IRQ_GPIO IMX_GPIO_NR(2, 25)
 40 
 41 #define VERSION_MASK            0x7
 42 #define MOTHERBOARD_SHIFT       4
 43 #define EXPBOARD_SHIFT          0
 44 
 45 #define MOTHERBOARD_BIT2        (GPIO_PORTD + 31)
 46 #define MOTHERBOARD_BIT1        (GPIO_PORTD + 30)
 47 #define MOTHERBOARD_BIT0        (GPIO_PORTD + 29)
 48 
 49 #define EXPBOARD_BIT2           (GPIO_PORTD + 25)
 50 #define EXPBOARD_BIT1           (GPIO_PORTD + 27)
 51 #define EXPBOARD_BIT0           (GPIO_PORTD + 28)
 52 
 53 #define AMP_GAIN_0              (GPIO_PORTF + 9)
 54 #define AMP_GAIN_1              (GPIO_PORTF + 8)
 55 #define AMP_MUTE_SDL            (GPIO_PORTE + 5)
 56 #define AMP_MUTE_SDR            (GPIO_PORTF + 7)
 57 
 58 static const int visstrim_m10_pins[] __initconst = {
 59         /* UART1 (console) */
 60         PE12_PF_UART1_TXD,
 61         PE13_PF_UART1_RXD,
 62         PE14_PF_UART1_CTS,
 63         PE15_PF_UART1_RTS,
 64         /* FEC */
 65         PD0_AIN_FEC_TXD0,
 66         PD1_AIN_FEC_TXD1,
 67         PD2_AIN_FEC_TXD2,
 68         PD3_AIN_FEC_TXD3,
 69         PD4_AOUT_FEC_RX_ER,
 70         PD5_AOUT_FEC_RXD1,
 71         PD6_AOUT_FEC_RXD2,
 72         PD7_AOUT_FEC_RXD3,
 73         PD8_AF_FEC_MDIO,
 74         PD9_AIN_FEC_MDC,
 75         PD10_AOUT_FEC_CRS,
 76         PD11_AOUT_FEC_TX_CLK,
 77         PD12_AOUT_FEC_RXD0,
 78         PD13_AOUT_FEC_RX_DV,
 79         PD14_AOUT_FEC_RX_CLK,
 80         PD15_AOUT_FEC_COL,
 81         PD16_AIN_FEC_TX_ER,
 82         PF23_AIN_FEC_TX_EN,
 83         /* SSI1 */
 84         PC20_PF_SSI1_FS,
 85         PC21_PF_SSI1_RXD,
 86         PC22_PF_SSI1_TXD,
 87         PC23_PF_SSI1_CLK,
 88         /* SDHC1 */
 89         PE18_PF_SD1_D0,
 90         PE19_PF_SD1_D1,
 91         PE20_PF_SD1_D2,
 92         PE21_PF_SD1_D3,
 93         PE22_PF_SD1_CMD,
 94         PE23_PF_SD1_CLK,
 95         /* Both I2Cs */
 96         PD17_PF_I2C_DATA,
 97         PD18_PF_I2C_CLK,
 98         PC5_PF_I2C2_SDA,
 99         PC6_PF_I2C2_SCL,
100         /* USB OTG */
101         OTG_PHY_CS_GPIO | GPIO_GPIO | GPIO_OUT,
102         PC9_PF_USBOTG_DATA0,
103         PC11_PF_USBOTG_DATA1,
104         PC10_PF_USBOTG_DATA2,
105         PC13_PF_USBOTG_DATA3,
106         PC12_PF_USBOTG_DATA4,
107         PC7_PF_USBOTG_DATA5,
108         PC8_PF_USBOTG_DATA6,
109         PE25_PF_USBOTG_DATA7,
110         PE24_PF_USBOTG_CLK,
111         PE2_PF_USBOTG_DIR,
112         PE0_PF_USBOTG_NXT,
113         PE1_PF_USBOTG_STP,
114         PB23_PF_USB_PWR,
115         PB24_PF_USB_OC,
116         /* CSI */
117         TVP5150_RSTN | GPIO_GPIO | GPIO_OUT,
118         TVP5150_PWDN | GPIO_GPIO | GPIO_OUT,
119         PB10_PF_CSI_D0,
120         PB11_PF_CSI_D1,
121         PB12_PF_CSI_D2,
122         PB13_PF_CSI_D3,
123         PB14_PF_CSI_D4,
124         PB15_PF_CSI_MCLK,
125         PB16_PF_CSI_PIXCLK,
126         PB17_PF_CSI_D5,
127         PB18_PF_CSI_D6,
128         PB19_PF_CSI_D7,
129         PB20_PF_CSI_VSYNC,
130         PB21_PF_CSI_HSYNC,
131         /* mother board version */
132         MOTHERBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
133         MOTHERBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
134         MOTHERBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
135         /* expansion board version */
136         EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
137         EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
138         EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
139         /* Audio AMP control */
140         AMP_GAIN_0 | GPIO_GPIO | GPIO_OUT,
141         AMP_GAIN_1 | GPIO_GPIO | GPIO_OUT,
142         AMP_MUTE_SDL | GPIO_GPIO | GPIO_OUT,
143         AMP_MUTE_SDR | GPIO_GPIO | GPIO_OUT,
144 };
145 
146 static struct gpio visstrim_m10_version_gpios[] = {
147         { EXPBOARD_BIT0, GPIOF_IN, "exp-version-0" },
148         { EXPBOARD_BIT1, GPIOF_IN, "exp-version-1" },
149         { EXPBOARD_BIT2, GPIOF_IN, "exp-version-2" },
150         { MOTHERBOARD_BIT0, GPIOF_IN, "mother-version-0" },
151         { MOTHERBOARD_BIT1, GPIOF_IN, "mother-version-1" },
152         { MOTHERBOARD_BIT2, GPIOF_IN, "mother-version-2" },
153 };
154 
155 static const struct gpio visstrim_m10_gpios[] __initconst = {
156         {
157                 .gpio = TVP5150_RSTN,
158                 .flags = GPIOF_DIR_OUT | GPIOF_INIT_HIGH,
159                 .label = "tvp5150_rstn",
160         },
161         {
162                 .gpio = TVP5150_PWDN,
163                 .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW,
164                 .label = "tvp5150_pwdn",
165         },
166         {
167                 .gpio = OTG_PHY_CS_GPIO,
168                 .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW,
169                 .label = "usbotg_cs",
170         },
171         {
172                 .gpio = AMP_GAIN_0,
173                 .flags = GPIOF_DIR_OUT,
174                 .label = "amp-gain-0",
175         },
176         {
177                 .gpio = AMP_GAIN_1,
178                 .flags = GPIOF_DIR_OUT,
179                 .label = "amp-gain-1",
180         },
181         {
182                 .gpio = AMP_MUTE_SDL,
183                 .flags = GPIOF_DIR_OUT,
184                 .label = "amp-mute-sdl",
185         },
186         {
187                 .gpio = AMP_MUTE_SDR,
188                 .flags = GPIOF_DIR_OUT,
189                 .label = "amp-mute-sdr",
190         },
191 };
192 
193 /* Camera */
194 static int visstrim_camera_power(struct device *dev, int on)
195 {
196         gpio_set_value(TVP5150_PWDN, on);
197 
198         return 0;
199 };
200 
201 static int visstrim_camera_reset(struct device *dev)
202 {
203         gpio_set_value(TVP5150_RSTN, 0);
204         ndelay(500);
205         gpio_set_value(TVP5150_RSTN, 1);
206 
207         return 0;
208 };
209 
210 static struct i2c_board_info visstrim_i2c_camera =  {
211         I2C_BOARD_INFO("tvp5150", 0x5d),
212 };
213 
214 static struct soc_camera_link iclink_tvp5150 = {
215         .bus_id         = 0,
216         .board_info     = &visstrim_i2c_camera,
217         .i2c_adapter_id = 0,
218         .power = visstrim_camera_power,
219         .reset = visstrim_camera_reset,
220 };
221 
222 static struct mx2_camera_platform_data visstrim_camera = {
223         .flags = MX2_CAMERA_CCIR | MX2_CAMERA_CCIR_INTERLACE |
224                  MX2_CAMERA_PCLK_SAMPLE_RISING,
225         .clk = 100000,
226 };
227 
228 static phys_addr_t mx2_camera_base __initdata;
229 #define MX2_CAMERA_BUF_SIZE SZ_8M
230 
231 static void __init visstrim_analog_camera_init(void)
232 {
233         struct platform_device *pdev;
234 
235         gpio_set_value(TVP5150_PWDN, 1);
236         ndelay(1);
237         gpio_set_value(TVP5150_RSTN, 0);
238         ndelay(500);
239         gpio_set_value(TVP5150_RSTN, 1);
240         ndelay(200000);
241 
242         pdev = imx27_add_mx2_camera(&visstrim_camera);
243         if (IS_ERR(pdev))
244                 return;
245 
246         dma_declare_coherent_memory(&pdev->dev, mx2_camera_base,
247                                     mx2_camera_base, MX2_CAMERA_BUF_SIZE);
248 }
249 
250 static void __init visstrim_reserve(void)
251 {
252         /* reserve 4 MiB for mx2-camera */
253         mx2_camera_base = arm_memblock_steal(3 * MX2_CAMERA_BUF_SIZE,
254                         MX2_CAMERA_BUF_SIZE);
255 }
256 
257 /* GPIOs used as events for applications */
258 static struct gpio_keys_button visstrim_gpio_keys[] = {
259         {
260                 .type   = EV_KEY,
261                 .code   = KEY_RESTART,
262                 .gpio   = (GPIO_PORTC + 15),
263                 .desc   = "Default config",
264                 .active_low = 0,
265                 .wakeup = 1,
266         },
267         {
268                 .type   = EV_KEY,
269                 .code   = KEY_RECORD,
270                 .gpio   = (GPIO_PORTF + 14),
271                 .desc   = "Record",
272                 .active_low = 0,
273                 .wakeup = 1,
274         },
275         {
276                 .type   = EV_KEY,
277                 .code   = KEY_STOP,
278                 .gpio   = (GPIO_PORTF + 13),
279                 .desc   = "Stop",
280                 .active_low = 0,
281                 .wakeup = 1,
282         }
283 };
284 
285 static const struct gpio_keys_platform_data
286                 visstrim_gpio_keys_platform_data __initconst = {
287         .buttons        = visstrim_gpio_keys,
288         .nbuttons       = ARRAY_SIZE(visstrim_gpio_keys),
289 };
290 
291 /* led */
292 static const struct gpio_led visstrim_m10_leds[] __initconst = {
293         {
294                 .name = "visstrim:ld0",
295                 .default_trigger = "nand-disk",
296                 .gpio = (GPIO_PORTC + 29),
297         },
298         {
299                 .name = "visstrim:ld1",
300                 .default_trigger = "nand-disk",
301                 .gpio = (GPIO_PORTC + 24),
302         },
303         {
304                 .name = "visstrim:ld2",
305                 .default_trigger = "nand-disk",
306                 .gpio = (GPIO_PORTC + 28),
307         },
308         {
309                 .name = "visstrim:ld3",
310                 .default_trigger = "nand-disk",
311                 .gpio = (GPIO_PORTC + 25),
312         },
313 };
314 
315 static const struct gpio_led_platform_data visstrim_m10_led_data __initconst = {
316         .leds = visstrim_m10_leds,
317         .num_leds = ARRAY_SIZE(visstrim_m10_leds),
318 };
319 
320 /* Visstrim_SM10 has a microSD slot connected to sdhc1 */
321 static int visstrim_m10_sdhc1_init(struct device *dev,
322                 irq_handler_t detect_irq, void *data)
323 {
324         int ret;
325 
326         ret = request_irq(gpio_to_irq(SDHC1_IRQ_GPIO), detect_irq,
327                           IRQF_TRIGGER_FALLING, "mmc-detect", data);
328         return ret;
329 }
330 
331 static void visstrim_m10_sdhc1_exit(struct device *dev, void *data)
332 {
333         free_irq(gpio_to_irq(SDHC1_IRQ_GPIO), data);
334 }
335 
336 static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = {
337         .init = visstrim_m10_sdhc1_init,
338         .exit = visstrim_m10_sdhc1_exit,
339 };
340 
341 /* Visstrim_SM10 NOR flash */
342 static struct physmap_flash_data visstrim_m10_flash_data = {
343         .width = 2,
344 };
345 
346 static struct resource visstrim_m10_flash_resource = {
347         .start = 0xc0000000,
348         .end = 0xc0000000 + SZ_64M - 1,
349         .flags = IORESOURCE_MEM,
350 };
351 
352 static struct platform_device visstrim_m10_nor_mtd_device = {
353         .name = "physmap-flash",
354         .id = 0,
355         .dev = {
356                 .platform_data = &visstrim_m10_flash_data,
357         },
358         .num_resources = 1,
359         .resource = &visstrim_m10_flash_resource,
360 };
361 
362 static struct platform_device *platform_devices[] __initdata = {
363         &visstrim_m10_nor_mtd_device,
364 };
365 
366 /* Visstrim_M10 uses UART0 as console */
367 static const struct imxuart_platform_data uart_pdata __initconst = {
368         .flags = IMXUART_HAVE_RTSCTS,
369 };
370 
371 /* I2C */
372 static const struct imxi2c_platform_data visstrim_m10_i2c_data __initconst = {
373         .bitrate = 100000,
374 };
375 
376 static struct pca953x_platform_data visstrim_m10_pca9555_pdata = {
377         .gpio_base = 240, /* After MX27 internal GPIOs */
378         .invert = 0,
379 };
380 
381 static struct aic32x4_pdata visstrim_m10_aic32x4_pdata = {
382         .power_cfg = AIC32X4_PWR_MICBIAS_2075_LDOIN |
383                      AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE |
384                      AIC32X4_PWR_AIC32X4_LDO_ENABLE |
385                      AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36 |
386                      AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED,
387         .micpga_routing = AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K |
388                          AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K,
389         .swapdacs = false,
390 };
391 
392 static struct i2c_board_info visstrim_m10_i2c_devices[] = {
393         {
394                 I2C_BOARD_INFO("pca9555", 0x20),
395                 .platform_data = &visstrim_m10_pca9555_pdata,
396         },
397         {
398                 I2C_BOARD_INFO("tlv320aic32x4", 0x18),
399                 .platform_data = &visstrim_m10_aic32x4_pdata,
400         },
401         {
402                  I2C_BOARD_INFO("m41t00", 0x68),
403         }
404 };
405 
406 /* USB OTG */
407 static int otg_phy_init(struct platform_device *pdev)
408 {
409         return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
410 }
411 
412 static const struct mxc_usbh_platform_data
413 visstrim_m10_usbotg_pdata __initconst = {
414         .init = otg_phy_init,
415         .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
416 };
417 
418 /* SSI */
419 static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
420         .flags                  = IMX_SSI_DMA | IMX_SSI_SYN,
421 };
422 
423 /* coda */
424 
425 static void __init visstrim_coda_init(void)
426 {
427         struct platform_device *pdev;
428 
429         pdev = imx27_add_coda();
430         dma_declare_coherent_memory(&pdev->dev,
431                                     mx2_camera_base + MX2_CAMERA_BUF_SIZE,
432                                     mx2_camera_base + MX2_CAMERA_BUF_SIZE,
433                                     MX2_CAMERA_BUF_SIZE);
434 }
435 
436 /* DMA deinterlace */
437 static struct platform_device visstrim_deinterlace = {
438         .name = "m2m-deinterlace",
439         .id = 0,
440 };
441 
442 static void __init visstrim_deinterlace_init(void)
443 {
444         int ret = -ENOMEM;
445         struct platform_device *pdev = &visstrim_deinterlace;
446 
447         ret = platform_device_register(pdev);
448 
449         dma_declare_coherent_memory(&pdev->dev,
450                                     mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE,
451                                     mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE,
452                                     MX2_CAMERA_BUF_SIZE);
453 }
454 
455 /* Emma-PrP for format conversion */
456 static void __init visstrim_emmaprp_init(void)
457 {
458         struct platform_device *pdev;
459         int ret;
460 
461         pdev = imx27_add_mx2_emmaprp();
462         if (IS_ERR(pdev))
463                 return;
464 
465         /*
466          * Use the same memory area as the analog camera since both
467          * devices are, by nature, exclusive.
468          */
469         ret = dma_declare_coherent_memory(&pdev->dev,
470                                 mx2_camera_base, mx2_camera_base,
471                                 MX2_CAMERA_BUF_SIZE);
472         if (ret)
473                 pr_err("Failed to declare memory for emmaprp\n");
474 }
475 
476 /* Audio */
477 static const struct snd_mx27vis_platform_data snd_mx27vis_pdata __initconst = {
478         .amp_gain0_gpio = AMP_GAIN_0,
479         .amp_gain1_gpio = AMP_GAIN_1,
480         .amp_mutel_gpio = AMP_MUTE_SDL,
481         .amp_muter_gpio = AMP_MUTE_SDR,
482 };
483 
484 static void __init visstrim_m10_revision(void)
485 {
486         int exp_version = 0;
487         int mo_version = 0;
488         int ret;
489 
490         ret = gpio_request_array(visstrim_m10_version_gpios,
491                                  ARRAY_SIZE(visstrim_m10_version_gpios));
492         if (ret) {
493                 pr_err("Failed to request version gpios");
494                 return;
495         }
496 
497         /* Get expansion board version (negative logic) */
498         exp_version |= !gpio_get_value(EXPBOARD_BIT2) << 2;
499         exp_version |= !gpio_get_value(EXPBOARD_BIT1) << 1;
500         exp_version |= !gpio_get_value(EXPBOARD_BIT0);
501 
502         /* Get mother board version (negative logic) */
503         mo_version |= !gpio_get_value(MOTHERBOARD_BIT2) << 2;
504         mo_version |= !gpio_get_value(MOTHERBOARD_BIT1) << 1;
505         mo_version |= !gpio_get_value(MOTHERBOARD_BIT0);
506 
507         system_rev = 0x27000;
508         system_rev |= (mo_version << MOTHERBOARD_SHIFT);
509         system_rev |= (exp_version << EXPBOARD_SHIFT);
510 }
511 
512 static void __init visstrim_m10_board_init(void)
513 {
514         int ret;
515 
516         imx27_soc_init();
517         visstrim_m10_revision();
518 
519         ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins,
520                         ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10");
521         if (ret)
522                 pr_err("Failed to setup pins (%d)\n", ret);
523 
524         imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata);
525         imx27_add_imx_uart0(&uart_pdata);
526 
527         imx27_add_imx_i2c(0, &visstrim_m10_i2c_data);
528         imx27_add_imx_i2c(1, &visstrim_m10_i2c_data);
529         i2c_register_board_info(0, visstrim_m10_i2c_devices,
530                                 ARRAY_SIZE(visstrim_m10_i2c_devices));
531 
532         imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata);
533         imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata);
534         imx27_add_fec(NULL);
535 
536         platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
537 }
538 
539 static void __init visstrim_m10_late_init(void)
540 {
541         int mo_version, ret;
542 
543         ret = gpio_request_array(visstrim_m10_gpios,
544                                  ARRAY_SIZE(visstrim_m10_gpios));
545         if (ret)
546                 pr_err("Failed to request gpios (%d)\n", ret);
547 
548         imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
549 
550         imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata,
551                                 sizeof(snd_mx27vis_pdata));
552         platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
553                                       &iclink_tvp5150, sizeof(iclink_tvp5150));
554 
555         gpio_led_register_device(0, &visstrim_m10_led_data);
556 
557         /* Use mother board version to decide what video devices we shall use */
558         mo_version = (system_rev >> MOTHERBOARD_SHIFT) & VERSION_MASK;
559         if (mo_version & 0x1) {
560                 visstrim_emmaprp_init();
561 
562                 /*
563                  * Despite not being used, tvp5150 must be
564                  * powered on to avoid I2C problems. To minimize
565                  * power consupmtion keep reset enabled.
566                  */
567                 gpio_set_value(TVP5150_PWDN, 1);
568                 ndelay(1);
569                 gpio_set_value(TVP5150_RSTN, 0);
570         } else {
571                 visstrim_deinterlace_init();
572                 visstrim_analog_camera_init();
573         }
574 
575         visstrim_coda_init();
576 }
577 
578 static void __init visstrim_m10_timer_init(void)
579 {
580         mx27_clocks_init((unsigned long)25000000);
581 }
582 
583 MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
584         .atag_offset = 0x100,
585         .reserve = visstrim_reserve,
586         .map_io = mx27_map_io,
587         .init_early = imx27_init_early,
588         .init_irq = mx27_init_irq,
589         .init_time      = visstrim_m10_timer_init,
590         .init_machine = visstrim_m10_board_init,
591         .init_late      = visstrim_m10_late_init,
592         .restart        = mxc_restart,
593 MACHINE_END
594 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp