Thread (3 messages) 3 messages, 2 authors, 2010-07-05

Re: [PATCH 6/6] ARM: mach-shmobile: add HDMI support to the ap4evb

flat view

From: Magnus Damm <magnus.damm@gmail.com>
Date: 2010-07-05 04:27:44
Also in: linux-sh

On Wed, Jun 30, 2010 at 6:55 PM, Guennadi Liakhovetski
[off-list ref] wrote:
Support HDMI in 720p mode.

Signed-off-by: Guennadi Liakhovetski <redacted>
---
 arch/arm/mach-shmobile/board-ap4evb.c |  128 ++++++++++++++++++++++++++++++++-
 1 files changed, 127 insertions(+), 1 deletions(-)
Hi Guennadi,

Thanks for your work on this!
quoted hunk ↗ jump to hunk
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -645,8 +732,36 @@ static void __init gpio_no_direction(u32 addr)
 #define GPIO_PORT9CR   0xE6051009
 #define GPIO_PORT10CR  0xE605100A

+static int __init hdmi_init_pm_clock(void)
+{
+       struct clk *hdmi_pm = clk_get(NULL, "sh-hdmi.0"),
+               *lcdc1_pm = clk_get(&lcdc1_device.dev, "sh_mobile_lcdc_fb.1");
+       int ret;
+
+       if (!IS_ERR(hdmi_pm)) {
+               ret = clk_enable(hdmi_pm);
+               if (ret < 0)
+                       pr_err("Cannot enable clock: %d\n", ret);
+       } else {
+               pr_err("Cannot get HDMI PM: %ld\n", PTR_ERR(hdmi_pm));
+       }
+
+       if (!IS_ERR(lcdc1_pm)) {
+               ret = clk_enable(lcdc1_pm);
+               if (ret < 0)
+                       pr_err("Cannot enable clock: %d\n", ret);
+       } else {
+               pr_err("Cannot get LCDC1 PM: %ld\n", PTR_ERR(lcdc1_pm));
+       }
+
+       return 0;
+}
This part I'm not so happy with.

Question 1:

Why do you need to statically enable the LCDC clock here? I guess it
works around the fact that Runtime PM is missing at this point? The
LCDC driver should manage its own clocks. With this in place the
clocks will never be disabled and your Runtime PM changes to the LCDC
driver will never actually stop the clocks.

Question 2:

And why do we need to enable the HDMI clock here? Same reason as
above? I imagine that the HDMI driver already does Runtime PM?

Also, you should not need to pass any strings to clk_get(). clkdev
should be able to figure out the binding from the device name.

Cheers,

/ magnus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help