]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/arm/mach-shmobile/board-ag5evm.c
Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm
[mirror_ubuntu-artful-kernel.git] / arch / arm / mach-shmobile / board-ag5evm.c
index e922e92111cd74026d14a9577d932c58eea29754..f9153294e928d8370052adecc32ab6741a5dfbdd 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/serial_sci.h>
 #include <linux/smsc911x.h>
 #include <linux/gpio.h>
+#include <linux/videodev2.h>
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/mmc/host.h>
@@ -37,7 +38,7 @@
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/sh_clk.h>
-#include <linux/dma-mapping.h>
+#include <linux/videodev2.h>
 #include <video/sh_mobile_lcdc.h>
 #include <video/sh_mipi_dsi.h>
 #include <sound/sh_fsi.h>
@@ -47,8 +48,6 @@
 #include <mach/common.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/time.h>
 #include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/traps.h>
@@ -160,19 +159,12 @@ static struct resource sh_mmcif_resources[] = {
        },
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-       .chan_priv_rx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_RX,
-       },
-       .chan_priv_tx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_TX,
-       },
-};
 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
        .sup_pclk       = 0,
        .ocr            = MMC_VDD_165_195,
        .caps           = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
-       .dma            = &sh_mmcif_dma,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device mmc_device = {
@@ -237,16 +229,6 @@ static void lcd_backlight_reset(void)
        gpio_set_value(GPIO_PORT235, 1);
 }
 
-static void lcd_on(void *board_data, struct fb_info *info)
-{
-       lcd_backlight_on();
-}
-
-static void lcd_off(void *board_data)
-{
-       lcd_backlight_reset();
-}
-
 /* LCDC0 */
 static const struct fb_videomode lcdc0_modes[] = {
        {
@@ -270,14 +252,14 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
                .interface_type = RGB24,
                .clock_divider = 1,
                .flags = LCDC_FLAGS_DWPOL,
-               .lcd_size_cfg.width = 44,
-               .lcd_size_cfg.height = 79,
                .fourcc = V4L2_PIX_FMT_RGB565,
-               .lcd_cfg = lcdc0_modes,
-               .num_cfg = ARRAY_SIZE(lcdc0_modes),
-               .board_cfg = {
-                       .display_on = lcd_on,
-                       .display_off = lcd_off,
+               .lcd_modes = lcdc0_modes,
+               .num_modes = ARRAY_SIZE(lcdc0_modes),
+               .panel_cfg = {
+                       .width = 44,
+                       .height = 79,
+                       .display_on = lcd_backlight_on,
+                       .display_off = lcd_backlight_reset,
                },
        }
 };
@@ -322,12 +304,11 @@ static struct resource mipidsi0_resources[] = {
        },
 };
 
-#define DSI0PHYCR      0xe615006c
 static int sh_mipi_set_dot_clock(struct platform_device *pdev,
                                 void __iomem *base,
                                 int enable)
 {
-       struct clk *pck;
+       struct clk *pck, *phy;
        int ret;
 
        pck = clk_get(&pdev->dev, "dsip_clk");
@@ -336,18 +317,27 @@ static int sh_mipi_set_dot_clock(struct platform_device *pdev,
                goto sh_mipi_set_dot_clock_pck_err;
        }
 
+       phy = clk_get(&pdev->dev, "dsiphy_clk");
+       if (IS_ERR(phy)) {
+               ret = PTR_ERR(phy);
+               goto sh_mipi_set_dot_clock_phy_err;
+       }
+
        if (enable) {
                clk_set_rate(pck, clk_round_rate(pck,  24000000));
-               __raw_writel(0x2a809010, DSI0PHYCR);
+               clk_set_rate(phy, clk_round_rate(pck, 510000000));
                clk_enable(pck);
+               clk_enable(phy);
        } else {
                clk_disable(pck);
+               clk_disable(phy);
        }
 
        ret = 0;
 
+       clk_put(phy);
+sh_mipi_set_dot_clock_phy_err:
        clk_put(pck);
-
 sh_mipi_set_dot_clock_pck_err:
        return ret;
 }
@@ -486,27 +476,6 @@ static struct platform_device *ag5evm_devices[] __initdata = {
        &sdhi1_device,
 };
 
-static struct map_desc ag5evm_io_desc[] __initdata = {
-       /* create a 1:1 entity map for 0xe6xxxxxx
-        * used by CPGA, INTC and PFC.
-        */
-       {
-               .virtual        = 0xe6000000,
-               .pfn            = __phys_to_pfn(0xe6000000),
-               .length         = 256 << 20,
-               .type           = MT_DEVICE_NONSHARED
-       },
-};
-
-static void __init ag5evm_map_io(void)
-{
-       iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
-
-       /* setup early devices and console here as well */
-       sh73a0_add_early_devices();
-       shmobile_setup_console();
-}
-
 static void __init ag5evm_init(void)
 {
        sh73a0_pinmux_init();
@@ -622,22 +591,12 @@ static void __init ag5evm_init(void)
        platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
 }
 
-static void __init ag5evm_timer_init(void)
-{
-       sh73a0_clock_init();
-       shmobile_timer.init();
-       return;
-}
-
-struct sys_timer ag5evm_timer = {
-       .init   = ag5evm_timer_init,
-};
-
 MACHINE_START(AG5EVM, "ag5evm")
-       .map_io         = ag5evm_map_io,
+       .map_io         = sh73a0_map_io,
+       .init_early     = sh73a0_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = sh73a0_init_irq,
        .handle_irq     = gic_handle_irq,
        .init_machine   = ag5evm_init,
-       .timer          = &ag5evm_timer,
+       .timer          = &shmobile_timer,
 MACHINE_END