aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:14:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:14:06 -0500
commitcf4af01221579a4e895f43dbfc47598fbfc5a731 (patch)
treeadc48fdc6ffb9d3d2a32a0f83df9e66066549963 /arch/arm/mach-imx
parentd027db132b395dabfac208e52a7e510e441bb9d2 (diff)
parent006309132f57ccc20dd69e971e2041ebd2cbb7e5 (diff)
Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC board updates from Olof Johansson: "This branch contains a set of various board updates for ARM platforms. A few shmobile platforms that are stale have been removed, some defconfig updates for various boards selecting new features such as pinctrl subsystem support, and various updates enabling peripherals, etc." Fix up conflicts mostly as per Olof. * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (58 commits) ARM: S3C64XX: Add dummy supplies for Glenfarclas LDOs ARM: S3C64XX: Add registration of WM2200 Bells device on Cragganmore ARM: kirkwood: Add Plat'Home OpenBlocks A6 support ARM: Dove: update defconfig ARM: Kirkwood: update defconfig for new boards arm: orion5x: add DT related options in defconfig arm: orion5x: convert 'LaCie Ethernet Disk mini v2' to Device Tree arm: orion5x: basic Device Tree support arm: orion5x: mechanical defconfig update ARM: kirkwood: Add support for the MPL CEC4 arm: kirkwood: add support for ZyXEL NSA310 ARM: Kirkwood: new board USI Topkick ARM: kirkwood: use gpio-fan DT binding on lsxl ARM: Kirkwood: add Netspace boards to defconfig ARM: kirkwood: DT board setup for Network Space Mini v2 ARM: kirkwood: DT board setup for Network Space Lite v2 ARM: kirkwood: DT board setup for Network Space v2 and parents leds: leds-ns2: add device tree binding ARM: Kirkwood: Enable the second I2C bus ARM: mmp: select pinctrl driver ...
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c52
1 files changed, 47 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index b74422679126..318bd8df7fcc 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -51,6 +51,10 @@
51#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) 51#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17)
52#define SDHC1_IRQ_GPIO IMX_GPIO_NR(2, 25) 52#define SDHC1_IRQ_GPIO IMX_GPIO_NR(2, 25)
53 53
54#define VERSION_MASK 0x7
55#define MOTHERBOARD_SHIFT 4
56#define EXPBOARD_SHIFT 0
57
54#define MOTHERBOARD_BIT2 (GPIO_PORTD + 31) 58#define MOTHERBOARD_BIT2 (GPIO_PORTD + 31)
55#define MOTHERBOARD_BIT1 (GPIO_PORTD + 30) 59#define MOTHERBOARD_BIT1 (GPIO_PORTD + 30)
56#define MOTHERBOARD_BIT0 (GPIO_PORTD + 29) 60#define MOTHERBOARD_BIT0 (GPIO_PORTD + 29)
@@ -237,7 +241,7 @@ static struct mx2_camera_platform_data visstrim_camera = {
237static phys_addr_t mx2_camera_base __initdata; 241static phys_addr_t mx2_camera_base __initdata;
238#define MX2_CAMERA_BUF_SIZE SZ_8M 242#define MX2_CAMERA_BUF_SIZE SZ_8M
239 243
240static void __init visstrim_camera_init(void) 244static void __init visstrim_analog_camera_init(void)
241{ 245{
242 struct platform_device *pdev; 246 struct platform_device *pdev;
243 int dma; 247 int dma;
@@ -474,6 +478,27 @@ static void __init visstrim_deinterlace_init(void)
474 return; 478 return;
475} 479}
476 480
481/* Emma-PrP for format conversion */
482static void __init visstrim_emmaprp_init(void)
483{
484 struct platform_device *pdev;
485 int dma;
486
487 pdev = imx27_add_mx2_emmaprp();
488 if (IS_ERR(pdev))
489 return;
490
491 /*
492 * Use the same memory area as the analog camera since both
493 * devices are, by nature, exclusive.
494 */
495 dma = dma_declare_coherent_memory(&pdev->dev,
496 mx2_camera_base, mx2_camera_base,
497 MX2_CAMERA_BUF_SIZE,
498 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
499 if (!(dma & DMA_MEMORY_MAP))
500 pr_err("Failed to declare memory for emmaprp\n");
501}
477 502
478/* Audio */ 503/* Audio */
479static const struct snd_mx27vis_platform_data snd_mx27vis_pdata __initconst = { 504static const struct snd_mx27vis_platform_data snd_mx27vis_pdata __initconst = {
@@ -507,13 +532,14 @@ static void __init visstrim_m10_revision(void)
507 mo_version |= !gpio_get_value(MOTHERBOARD_BIT0); 532 mo_version |= !gpio_get_value(MOTHERBOARD_BIT0);
508 533
509 system_rev = 0x27000; 534 system_rev = 0x27000;
510 system_rev |= (mo_version << 4); 535 system_rev |= (mo_version << MOTHERBOARD_SHIFT);
511 system_rev |= exp_version; 536 system_rev |= (exp_version << EXPBOARD_SHIFT);
512} 537}
513 538
514static void __init visstrim_m10_board_init(void) 539static void __init visstrim_m10_board_init(void)
515{ 540{
516 int ret; 541 int ret;
542 int mo_version;
517 543
518 imx27_soc_init(); 544 imx27_soc_init();
519 visstrim_m10_revision(); 545 visstrim_m10_revision();
@@ -546,8 +572,24 @@ static void __init visstrim_m10_board_init(void)
546 platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, 572 platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
547 &iclink_tvp5150, sizeof(iclink_tvp5150)); 573 &iclink_tvp5150, sizeof(iclink_tvp5150));
548 gpio_led_register_device(0, &visstrim_m10_led_data); 574 gpio_led_register_device(0, &visstrim_m10_led_data);
549 visstrim_deinterlace_init(); 575
550 visstrim_camera_init(); 576 /* Use mother board version to decide what video devices we shall use */
577 mo_version = (system_rev >> MOTHERBOARD_SHIFT) & VERSION_MASK;
578 if (mo_version & 0x1) {
579 visstrim_emmaprp_init();
580
581 /*
582 * Despite not being used, tvp5150 must be
583 * powered on to avoid I2C problems. To minimize
584 * power consupmtion keep reset enabled.
585 */
586 gpio_set_value(TVP5150_PWDN, 1);
587 ndelay(1);
588 gpio_set_value(TVP5150_RSTN, 0);
589 } else {
590 visstrim_deinterlace_init();
591 visstrim_analog_camera_init();
592 }
551 visstrim_coda_init(); 593 visstrim_coda_init();
552} 594}
553 595