aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-03-29 03:45:28 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-22 03:44:57 -0400
commit2d151248286d438e97ebb22ff676423df299da86 (patch)
tree22cf5d5379ef29abb073f98622df75d092b5abde /arch
parentaee5ab0bbd224b618408cacfcc656699feec4230 (diff)
sh: add Video Output Unit (VOU) and AK8813 TV-encoder support to ms7724se
Add platform bindings, GPIO initialisation and allocation and AK8813 reset code to ms7724se. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c90
1 files changed, 82 insertions, 8 deletions
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index e74ae7b0d8bf..60f0387a69d1 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -515,6 +515,52 @@ static struct platform_device irda_device = {
515 .resource = irda_resources, 515 .resource = irda_resources,
516}; 516};
517 517
518#include <media/ak881x.h>
519#include <media/sh_vou.h>
520
521struct ak881x_pdata ak881x_pdata = {
522 .flags = AK881X_IF_MODE_SLAVE,
523};
524
525static struct i2c_board_info ak8813 = {
526 /* With open J18 jumper address is 0x21 */
527 I2C_BOARD_INFO("ak8813", 0x20),
528 .platform_data = &ak881x_pdata,
529};
530
531struct sh_vou_pdata sh_vou_pdata = {
532 .bus_fmt = SH_VOU_BUS_8BIT,
533 .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
534 .board_info = &ak8813,
535 .i2c_adap = 0,
536 .module_name = "ak881x",
537};
538
539static struct resource sh_vou_resources[] = {
540 [0] = {
541 .start = 0xfe960000,
542 .end = 0xfe962043,
543 .flags = IORESOURCE_MEM,
544 },
545 [1] = {
546 .start = 55,
547 .flags = IORESOURCE_IRQ,
548 },
549};
550
551static struct platform_device vou_device = {
552 .name = "sh-vou",
553 .id = -1,
554 .num_resources = ARRAY_SIZE(sh_vou_resources),
555 .resource = sh_vou_resources,
556 .dev = {
557 .platform_data = &sh_vou_pdata,
558 },
559 .archdata = {
560 .hwblk_id = HWBLK_VOU,
561 },
562};
563
518static struct platform_device *ms7724se_devices[] __initdata = { 564static struct platform_device *ms7724se_devices[] __initdata = {
519 &heartbeat_device, 565 &heartbeat_device,
520 &smc91x_eth_device, 566 &smc91x_eth_device,
@@ -530,6 +576,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
530 &sdhi0_cn7_device, 576 &sdhi0_cn7_device,
531 &sdhi1_cn8_device, 577 &sdhi1_cn8_device,
532 &irda_device, 578 &irda_device,
579 &vou_device,
533}; 580};
534 581
535/* I2C device */ 582/* I2C device */
@@ -614,6 +661,7 @@ static int __init devices_setup(void)
614{ 661{
615 u16 sw = __raw_readw(SW4140); /* select camera, monitor */ 662 u16 sw = __raw_readw(SW4140); /* select camera, monitor */
616 struct clk *clk; 663 struct clk *clk;
664 u16 fpga_out;
617 665
618 /* register board specific self-refresh code */ 666 /* register board specific self-refresh code */
619 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | 667 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
@@ -623,14 +671,26 @@ static int __init devices_setup(void)
623 &ms7724se_sdram_leave_start, 671 &ms7724se_sdram_leave_start,
624 &ms7724se_sdram_leave_end); 672 &ms7724se_sdram_leave_end);
625 /* Reset Release */ 673 /* Reset Release */
626 __raw_writew(__raw_readw(FPGA_OUT) & 674 fpga_out = __raw_readw(FPGA_OUT);
627 ~((1 << 1) | /* LAN */ 675 /* bit4: NTSC_PDN, bit5: NTSC_RESET */
628 (1 << 6) | /* VIDEO DAC */ 676 fpga_out &= ~((1 << 1) | /* LAN */
629 (1 << 7) | /* AK4643 */ 677 (1 << 4) | /* AK8813 PDN */
630 (1 << 8) | /* IrDA */ 678 (1 << 5) | /* AK8813 RESET */
631 (1 << 12) | /* USB0 */ 679 (1 << 6) | /* VIDEO DAC */
632 (1 << 14)), /* RMII */ 680 (1 << 7) | /* AK4643 */
633 FPGA_OUT); 681 (1 << 8) | /* IrDA */
682 (1 << 12) | /* USB0 */
683 (1 << 14)); /* RMII */
684 __raw_writew(fpga_out | (1 << 4), FPGA_OUT);
685
686 udelay(10);
687
688 /* AK8813 RESET */
689 __raw_writew(fpga_out | (1 << 5), FPGA_OUT);
690
691 udelay(10);
692
693 __raw_writew(fpga_out, FPGA_OUT);
634 694
635 /* turn on USB clocks, use external clock */ 695 /* turn on USB clocks, use external clock */
636 __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); 696 __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
@@ -862,6 +922,20 @@ static int __init devices_setup(void)
862 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL; 922 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
863 } 923 }
864 924
925 /* VOU */
926 gpio_request(GPIO_FN_DV_D15, NULL);
927 gpio_request(GPIO_FN_DV_D14, NULL);
928 gpio_request(GPIO_FN_DV_D13, NULL);
929 gpio_request(GPIO_FN_DV_D12, NULL);
930 gpio_request(GPIO_FN_DV_D11, NULL);
931 gpio_request(GPIO_FN_DV_D10, NULL);
932 gpio_request(GPIO_FN_DV_D9, NULL);
933 gpio_request(GPIO_FN_DV_D8, NULL);
934 gpio_request(GPIO_FN_DV_CLKI, NULL);
935 gpio_request(GPIO_FN_DV_CLK, NULL);
936 gpio_request(GPIO_FN_DV_VSYNC, NULL);
937 gpio_request(GPIO_FN_DV_HSYNC, NULL);
938
865 return platform_add_devices(ms7724se_devices, 939 return platform_add_devices(ms7724se_devices,
866 ARRAY_SIZE(ms7724se_devices)); 940 ARRAY_SIZE(ms7724se_devices));
867} 941}