diff options
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-ag5evm.c | 43 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh7372.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh73a0.c | 4 |
5 files changed, 72 insertions, 15 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index a4e6ca04e319..eff8a96c75ee 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -271,7 +271,7 @@ static struct sh_mobile_lcdc_info lcdc0_info = { | |||
271 | .flags = LCDC_FLAGS_DWPOL, | 271 | .flags = LCDC_FLAGS_DWPOL, |
272 | .lcd_size_cfg.width = 44, | 272 | .lcd_size_cfg.width = 44, |
273 | .lcd_size_cfg.height = 79, | 273 | .lcd_size_cfg.height = 79, |
274 | .bpp = 16, | 274 | .fourcc = V4L2_PIX_FMT_RGB565, |
275 | .lcd_cfg = lcdc0_modes, | 275 | .lcd_cfg = lcdc0_modes, |
276 | .num_cfg = ARRAY_SIZE(lcdc0_modes), | 276 | .num_cfg = ARRAY_SIZE(lcdc0_modes), |
277 | .board_cfg = { | 277 | .board_cfg = { |
@@ -321,12 +321,46 @@ static struct resource mipidsi0_resources[] = { | |||
321 | }, | 321 | }, |
322 | }; | 322 | }; |
323 | 323 | ||
324 | #define DSI0PHYCR 0xe615006c | ||
325 | static int sh_mipi_set_dot_clock(struct platform_device *pdev, | ||
326 | void __iomem *base, | ||
327 | int enable) | ||
328 | { | ||
329 | struct clk *pck; | ||
330 | int ret; | ||
331 | |||
332 | pck = clk_get(&pdev->dev, "dsip_clk"); | ||
333 | if (IS_ERR(pck)) { | ||
334 | ret = PTR_ERR(pck); | ||
335 | goto sh_mipi_set_dot_clock_pck_err; | ||
336 | } | ||
337 | |||
338 | if (enable) { | ||
339 | clk_set_rate(pck, clk_round_rate(pck, 24000000)); | ||
340 | __raw_writel(0x2a809010, DSI0PHYCR); | ||
341 | clk_enable(pck); | ||
342 | } else { | ||
343 | clk_disable(pck); | ||
344 | } | ||
345 | |||
346 | ret = 0; | ||
347 | |||
348 | clk_put(pck); | ||
349 | |||
350 | sh_mipi_set_dot_clock_pck_err: | ||
351 | return ret; | ||
352 | } | ||
353 | |||
324 | static struct sh_mipi_dsi_info mipidsi0_info = { | 354 | static struct sh_mipi_dsi_info mipidsi0_info = { |
325 | .data_format = MIPI_RGB888, | 355 | .data_format = MIPI_RGB888, |
326 | .lcd_chan = &lcdc0_info.ch[0], | 356 | .lcd_chan = &lcdc0_info.ch[0], |
357 | .lane = 2, | ||
327 | .vsynw_offset = 20, | 358 | .vsynw_offset = 20, |
328 | .clksrc = 1, | 359 | .clksrc = 1, |
329 | .flags = SH_MIPI_DSI_HSABM, | 360 | .flags = SH_MIPI_DSI_HSABM | |
361 | SH_MIPI_DSI_SYNC_PULSES_MODE | | ||
362 | SH_MIPI_DSI_HSbyteCLK, | ||
363 | .set_dot_clock = sh_mipi_set_dot_clock, | ||
330 | }; | 364 | }; |
331 | 365 | ||
332 | static struct platform_device mipidsi0_device = { | 366 | static struct platform_device mipidsi0_device = { |
@@ -472,8 +506,6 @@ static void __init ag5evm_map_io(void) | |||
472 | shmobile_setup_console(); | 506 | shmobile_setup_console(); |
473 | } | 507 | } |
474 | 508 | ||
475 | #define DSI0PHYCR 0xe615006c | ||
476 | |||
477 | static void __init ag5evm_init(void) | 509 | static void __init ag5evm_init(void) |
478 | { | 510 | { |
479 | sh73a0_pinmux_init(); | 511 | sh73a0_pinmux_init(); |
@@ -554,9 +586,6 @@ static void __init ag5evm_init(void) | |||
554 | gpio_direction_output(GPIO_PORT235, 0); | 586 | gpio_direction_output(GPIO_PORT235, 0); |
555 | lcd_backlight_reset(); | 587 | lcd_backlight_reset(); |
556 | 588 | ||
557 | /* MIPI-DSI clock setup */ | ||
558 | __raw_writel(0x2a809010, DSI0PHYCR); | ||
559 | |||
560 | /* enable SDHI0 on CN15 [SD I/F] */ | 589 | /* enable SDHI0 on CN15 [SD I/F] */ |
561 | gpio_request(GPIO_FN_SDHICD0, NULL); | 590 | gpio_request(GPIO_FN_SDHICD0, NULL); |
562 | gpio_request(GPIO_FN_SDHIWP0, NULL); | 591 | gpio_request(GPIO_FN_SDHIWP0, NULL); |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index d2e7b73aa9b6..aab0a349f759 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -491,7 +491,7 @@ static struct sh_mobile_lcdc_info lcdc_info = { | |||
491 | .meram_dev = &meram_info, | 491 | .meram_dev = &meram_info, |
492 | .ch[0] = { | 492 | .ch[0] = { |
493 | .chan = LCDC_CHAN_MAINLCD, | 493 | .chan = LCDC_CHAN_MAINLCD, |
494 | .bpp = 16, | 494 | .fourcc = V4L2_PIX_FMT_RGB565, |
495 | .lcd_cfg = ap4evb_lcdc_modes, | 495 | .lcd_cfg = ap4evb_lcdc_modes, |
496 | .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), | 496 | .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), |
497 | .meram_cfg = &lcd_meram_cfg, | 497 | .meram_cfg = &lcd_meram_cfg, |
@@ -564,6 +564,30 @@ static struct platform_device keysc_device = { | |||
564 | }; | 564 | }; |
565 | 565 | ||
566 | /* MIPI-DSI */ | 566 | /* MIPI-DSI */ |
567 | #define PHYCTRL 0x0070 | ||
568 | static int sh_mipi_set_dot_clock(struct platform_device *pdev, | ||
569 | void __iomem *base, | ||
570 | int enable) | ||
571 | { | ||
572 | struct clk *pck = clk_get(&pdev->dev, "dsip_clk"); | ||
573 | void __iomem *phy = base + PHYCTRL; | ||
574 | |||
575 | if (IS_ERR(pck)) | ||
576 | return PTR_ERR(pck); | ||
577 | |||
578 | if (enable) { | ||
579 | clk_set_rate(pck, clk_round_rate(pck, 24000000)); | ||
580 | iowrite32(ioread32(phy) | (0xb << 8), phy); | ||
581 | clk_enable(pck); | ||
582 | } else { | ||
583 | clk_disable(pck); | ||
584 | } | ||
585 | |||
586 | clk_put(pck); | ||
587 | |||
588 | return 0; | ||
589 | } | ||
590 | |||
567 | static struct resource mipidsi0_resources[] = { | 591 | static struct resource mipidsi0_resources[] = { |
568 | [0] = { | 592 | [0] = { |
569 | .start = 0xffc60000, | 593 | .start = 0xffc60000, |
@@ -580,7 +604,11 @@ static struct resource mipidsi0_resources[] = { | |||
580 | static struct sh_mipi_dsi_info mipidsi0_info = { | 604 | static struct sh_mipi_dsi_info mipidsi0_info = { |
581 | .data_format = MIPI_RGB888, | 605 | .data_format = MIPI_RGB888, |
582 | .lcd_chan = &lcdc_info.ch[0], | 606 | .lcd_chan = &lcdc_info.ch[0], |
607 | .lane = 2, | ||
583 | .vsynw_offset = 17, | 608 | .vsynw_offset = 17, |
609 | .flags = SH_MIPI_DSI_SYNC_PULSES_MODE | | ||
610 | SH_MIPI_DSI_HSbyteCLK, | ||
611 | .set_dot_clock = sh_mipi_set_dot_clock, | ||
584 | }; | 612 | }; |
585 | 613 | ||
586 | static struct platform_device mipidsi0_device = { | 614 | static struct platform_device mipidsi0_device = { |
@@ -798,7 +826,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { | |||
798 | .meram_dev = &meram_info, | 826 | .meram_dev = &meram_info, |
799 | .ch[0] = { | 827 | .ch[0] = { |
800 | .chan = LCDC_CHAN_MAINLCD, | 828 | .chan = LCDC_CHAN_MAINLCD, |
801 | .bpp = 16, | 829 | .fourcc = V4L2_PIX_FMT_RGB565, |
802 | .interface_type = RGB24, | 830 | .interface_type = RGB24, |
803 | .clock_divider = 1, | 831 | .clock_divider = 1, |
804 | .flags = LCDC_FLAGS_DWPOL, | 832 | .flags = LCDC_FLAGS_DWPOL, |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index cbc5934ae03f..9b42fbd10f8e 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -388,7 +388,7 @@ static struct sh_mobile_lcdc_info lcdc_info = { | |||
388 | .clock_source = LCDC_CLK_BUS, | 388 | .clock_source = LCDC_CLK_BUS, |
389 | .ch[0] = { | 389 | .ch[0] = { |
390 | .chan = LCDC_CHAN_MAINLCD, | 390 | .chan = LCDC_CHAN_MAINLCD, |
391 | .bpp = 16, | 391 | .fourcc = V4L2_PIX_FMT_RGB565, |
392 | .lcd_cfg = mackerel_lcdc_modes, | 392 | .lcd_cfg = mackerel_lcdc_modes, |
393 | .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes), | 393 | .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes), |
394 | .interface_type = RGB24, | 394 | .interface_type = RGB24, |
@@ -451,7 +451,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = { | |||
451 | .clock_source = LCDC_CLK_EXTERNAL, | 451 | .clock_source = LCDC_CLK_EXTERNAL, |
452 | .ch[0] = { | 452 | .ch[0] = { |
453 | .chan = LCDC_CHAN_MAINLCD, | 453 | .chan = LCDC_CHAN_MAINLCD, |
454 | .bpp = 16, | 454 | .fourcc = V4L2_PIX_FMT_RGB565, |
455 | .interface_type = RGB24, | 455 | .interface_type = RGB24, |
456 | .clock_divider = 1, | 456 | .clock_divider = 1, |
457 | .flags = LCDC_FLAGS_DWPOL, | 457 | .flags = LCDC_FLAGS_DWPOL, |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index e349c22a0d71..293456d8dcfd 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -612,8 +612,8 @@ static struct clk_lookup lookups[] = { | |||
612 | CLKDEV_CON_ID("hdmi_clk", &div6_reparent_clks[DIV6_HDMI]), | 612 | CLKDEV_CON_ID("hdmi_clk", &div6_reparent_clks[DIV6_HDMI]), |
613 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), | 613 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), |
614 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), | 614 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), |
615 | CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), | 615 | CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), |
616 | CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), | 616 | CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), |
617 | 617 | ||
618 | /* MSTP32 clocks */ | 618 | /* MSTP32 clocks */ |
619 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ | 619 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 34944d01bf1e..afbead6a6e17 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -427,8 +427,8 @@ static struct clk_lookup lookups[] = { | |||
427 | CLKDEV_CON_ID("sdhi2_clk", &div6_clks[DIV6_SDHI2]), | 427 | CLKDEV_CON_ID("sdhi2_clk", &div6_clks[DIV6_SDHI2]), |
428 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), | 428 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), |
429 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), | 429 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), |
430 | CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), | 430 | CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), |
431 | CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), | 431 | CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), |
432 | 432 | ||
433 | /* MSTP32 clocks */ | 433 | /* MSTP32 clocks */ |
434 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ | 434 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ |