diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-06 20:29:26 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-06 20:29:26 -0500 |
commit | 5e93c6b4ecd78b1bab49bad1dc2f6ed7ec0115ee (patch) | |
tree | 4f4e321a1ca0baf64d8af528080c71f93495a7d7 /arch/arm/mach-shmobile/board-ap4evb.c | |
parent | 98d27b8abf413a310df6676f7d2128ada1cccc08 (diff) | |
parent | 3c0cb7c31c206aaedb967e44b98442bbeb17a6c4 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into rmobile-latest
Conflicts:
arch/arm/mach-shmobile/Kconfig
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 71 |
1 files changed, 32 insertions, 39 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 07b85c034d13..86edc772f82a 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <asm/mach/arch.h> | 61 | #include <asm/mach/arch.h> |
62 | #include <asm/mach/map.h> | 62 | #include <asm/mach/map.h> |
63 | #include <asm/mach/time.h> | 63 | #include <asm/mach/time.h> |
64 | #include <asm/setup.h> | ||
64 | 65 | ||
65 | /* | 66 | /* |
66 | * Address Interface BusWidth note | 67 | * Address Interface BusWidth note |
@@ -511,7 +512,12 @@ static struct platform_device keysc_device = { | |||
511 | static struct resource mipidsi0_resources[] = { | 512 | static struct resource mipidsi0_resources[] = { |
512 | [0] = { | 513 | [0] = { |
513 | .start = 0xffc60000, | 514 | .start = 0xffc60000, |
514 | .end = 0xffc68fff, | 515 | .end = 0xffc63073, |
516 | .flags = IORESOURCE_MEM, | ||
517 | }, | ||
518 | [1] = { | ||
519 | .start = 0xffc68000, | ||
520 | .end = 0xffc680ef, | ||
515 | .flags = IORESOURCE_MEM, | 521 | .flags = IORESOURCE_MEM, |
516 | }, | 522 | }, |
517 | }; | 523 | }; |
@@ -519,6 +525,7 @@ static struct resource mipidsi0_resources[] = { | |||
519 | static struct sh_mipi_dsi_info mipidsi0_info = { | 525 | static struct sh_mipi_dsi_info mipidsi0_info = { |
520 | .data_format = MIPI_RGB888, | 526 | .data_format = MIPI_RGB888, |
521 | .lcd_chan = &lcdc_info.ch[0], | 527 | .lcd_chan = &lcdc_info.ch[0], |
528 | .vsynw_offset = 17, | ||
522 | }; | 529 | }; |
523 | 530 | ||
524 | static struct platform_device mipidsi0_device = { | 531 | static struct platform_device mipidsi0_device = { |
@@ -531,44 +538,6 @@ static struct platform_device mipidsi0_device = { | |||
531 | }, | 538 | }, |
532 | }; | 539 | }; |
533 | 540 | ||
534 | /* This function will disappear when we switch to (runtime) PM */ | ||
535 | static int __init ap4evb_init_display_clk(void) | ||
536 | { | ||
537 | struct clk *lcdc_clk; | ||
538 | struct clk *dsitx_clk; | ||
539 | int ret; | ||
540 | |||
541 | lcdc_clk = clk_get(&lcdc_device.dev, "sh_mobile_lcdc_fb.0"); | ||
542 | if (IS_ERR(lcdc_clk)) | ||
543 | return PTR_ERR(lcdc_clk); | ||
544 | |||
545 | dsitx_clk = clk_get(&mipidsi0_device.dev, "sh-mipi-dsi.0"); | ||
546 | if (IS_ERR(dsitx_clk)) { | ||
547 | ret = PTR_ERR(dsitx_clk); | ||
548 | goto eclkdsitxget; | ||
549 | } | ||
550 | |||
551 | ret = clk_enable(lcdc_clk); | ||
552 | if (ret < 0) | ||
553 | goto eclklcdcon; | ||
554 | |||
555 | ret = clk_enable(dsitx_clk); | ||
556 | if (ret < 0) | ||
557 | goto eclkdsitxon; | ||
558 | |||
559 | return 0; | ||
560 | |||
561 | eclkdsitxon: | ||
562 | clk_disable(lcdc_clk); | ||
563 | eclklcdcon: | ||
564 | clk_put(dsitx_clk); | ||
565 | eclkdsitxget: | ||
566 | clk_put(lcdc_clk); | ||
567 | |||
568 | return ret; | ||
569 | } | ||
570 | device_initcall(ap4evb_init_display_clk); | ||
571 | |||
572 | static struct platform_device *qhd_devices[] __initdata = { | 541 | static struct platform_device *qhd_devices[] __initdata = { |
573 | &mipidsi0_device, | 542 | &mipidsi0_device, |
574 | &keysc_device, | 543 | &keysc_device, |
@@ -777,10 +746,15 @@ static struct platform_device lcdc1_device = { | |||
777 | }, | 746 | }, |
778 | }; | 747 | }; |
779 | 748 | ||
749 | static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, | ||
750 | unsigned long *parent_freq); | ||
751 | |||
752 | |||
780 | static struct sh_mobile_hdmi_info hdmi_info = { | 753 | static struct sh_mobile_hdmi_info hdmi_info = { |
781 | .lcd_chan = &sh_mobile_lcdc1_info.ch[0], | 754 | .lcd_chan = &sh_mobile_lcdc1_info.ch[0], |
782 | .lcd_dev = &lcdc1_device.dev, | 755 | .lcd_dev = &lcdc1_device.dev, |
783 | .flags = HDMI_SND_SRC_SPDIF, | 756 | .flags = HDMI_SND_SRC_SPDIF, |
757 | .clk_optimize_parent = ap4evb_clk_optimize, | ||
784 | }; | 758 | }; |
785 | 759 | ||
786 | static struct resource hdmi_resources[] = { | 760 | static struct resource hdmi_resources[] = { |
@@ -807,6 +781,25 @@ static struct platform_device hdmi_device = { | |||
807 | }, | 781 | }, |
808 | }; | 782 | }; |
809 | 783 | ||
784 | static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, | ||
785 | unsigned long *parent_freq) | ||
786 | { | ||
787 | struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick"); | ||
788 | long error; | ||
789 | |||
790 | if (IS_ERR(hdmi_ick)) { | ||
791 | int ret = PTR_ERR(hdmi_ick); | ||
792 | pr_err("Cannot get HDMI ICK: %d\n", ret); | ||
793 | return ret; | ||
794 | } | ||
795 | |||
796 | error = clk_round_parent(hdmi_ick, target, best_freq, parent_freq, 1, 64); | ||
797 | |||
798 | clk_put(hdmi_ick); | ||
799 | |||
800 | return error; | ||
801 | } | ||
802 | |||
810 | static struct gpio_led ap4evb_leds[] = { | 803 | static struct gpio_led ap4evb_leds[] = { |
811 | { | 804 | { |
812 | .name = "led4", | 805 | .name = "led4", |