aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-ap4evb.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-11-02 07:27:34 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-11-10 03:59:43 -0500
commit640dcfa0ff49ea1fcddad39e7c468683d9f00342 (patch)
tree1905072e89e68e99872592ff525ea9ccece3c520 /arch/arm/mach-shmobile/board-ap4evb.c
parentc724d07a56e60e91b0aa75193f86fb000545ffe4 (diff)
ARM: mach-shmobile: optimize PLLC2 frequency for HDMI
On ap4evb PLLC2 is only used as a parent of the HDMI clock, therefore it can be reconfigured freely to improve HDMI clock precision. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> 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.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 32d9e2816e5..732baed0857 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -669,10 +669,15 @@ static struct platform_device lcdc1_device = {
669 }, 669 },
670}; 670};
671 671
672static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
673 unsigned long *parent_freq);
674
675
672static struct sh_mobile_hdmi_info hdmi_info = { 676static struct sh_mobile_hdmi_info hdmi_info = {
673 .lcd_chan = &sh_mobile_lcdc1_info.ch[0], 677 .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
674 .lcd_dev = &lcdc1_device.dev, 678 .lcd_dev = &lcdc1_device.dev,
675 .flags = HDMI_SND_SRC_SPDIF, 679 .flags = HDMI_SND_SRC_SPDIF,
680 .clk_optimize_parent = ap4evb_clk_optimize,
676}; 681};
677 682
678static struct resource hdmi_resources[] = { 683static struct resource hdmi_resources[] = {
@@ -699,6 +704,25 @@ static struct platform_device hdmi_device = {
699 }, 704 },
700}; 705};
701 706
707static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
708 unsigned long *parent_freq)
709{
710 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
711 long error;
712
713 if (IS_ERR(hdmi_ick)) {
714 int ret = PTR_ERR(hdmi_ick);
715 pr_err("Cannot get HDMI ICK: %d\n", ret);
716 return ret;
717 }
718
719 error = clk_round_parent(hdmi_ick, target, best_freq, parent_freq, 1, 64);
720
721 clk_put(hdmi_ick);
722
723 return error;
724}
725
702static struct gpio_led ap4evb_leds[] = { 726static struct gpio_led ap4evb_leds[] = {
703 { 727 {
704 .name = "led4", 728 .name = "led4",