diff mbox

HDMI on OMAP4460: clk rate mismatch warning

Message ID 534F81AA.8060805@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen April 17, 2014, 7:24 a.m. UTC
On 16/04/14 19:11, Joachim Eastwood wrote:
> On 16 April 2014 07:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 15/04/14 20:36, Joachim Eastwood wrote:
>>> Hello,
>>>
>>> I am trying to get HDMI work with DT on my VAR-STK-OM44 (4460) board.
>>> But during kernel boot I get the following message:
>>>
>>> [ 0.953796] ------------[ cut here ]------------
>>> [ 0.953826] WARNING: CPU: 0 PID: 1 at
>>> drivers/video/omap2/dss/dss.c:483 dss_set_fck_rate+0x7c/0x8c()
>>> [ 0.953826] clk rate mismatch: 153600000 != 170666666
>>
>> I have a fix (attached) for this in fbdev-fixes, which I'll probably be
>> sending to Linus today. I couldn't send it in the main fbdev pull
>> request, as it depended on clk driver changes. And it's not fatal, most
>> likely things work fine even with the warning.
> 
> The warning disappeared after the patch. Thanks.
> Feel free to add: Tested-By: Joachim Eastwood <manabian@gmail.com>

Thanks. It should be in -rc2.

> This board (VAR-STK-OM44) has a TPD12S521 which has no controllable
> settings so adding a driver for it would be pretty meaningless. I
> think it's the same situation with Gumstix Parlor. That board also
> just have a very simple HDMI transmitter which shouldn't require a
> driver.
> 
> But never the less I got HDMI working on my board adding the tpd21s015
> nodes and providing a dummy gpio for "CT CP HPD". This works but it's
> a bit hacky.

Remove the tpd21s015 nodes and try the attached patch. It adds HPD
support to the hdmi connector. You also need something like this for the
hdmi-connector node:


pinctrl-names = "default";
pinctrl-0 = <&hdmi_conn_pins>;

hpd-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; /* GPIO 193, HPD */


And the respective pinctrl node:

hdmi_conn_pins: pinmux_hdmi_conn_pins {
        pinctrl-single,pins = <
                0x0fe (PIN_INPUT_PULLDOWN | MUX_MODE6)
        >;
};

Note that I tested this yesterday on one board, but I couldn't get it
working yet, so no promises =). But that may be an issue with the HPD
pin on the board.

> One other thing.
> Does HDMI audio work with DT or is that a still TODO?
> I am only getting probe deferral's from omap-hdmi-audio. Haven't look
> to far into it.

It's still on the works. If you volunteer for testing it (and Jyri needs
someone to test), you can ask Jyri Sarha.

 Tomi

Comments

Joachim Eastwood April 17, 2014, 8:56 a.m. UTC | #1
On 17 April 2014 09:24, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 16/04/14 19:11, Joachim Eastwood wrote:
>> On 16 April 2014 07:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>> On 15/04/14 20:36, Joachim Eastwood wrote:
>>>> Hello,
>>>>
>>>> I am trying to get HDMI work with DT on my VAR-STK-OM44 (4460) board.
>>>> But during kernel boot I get the following message:
>>>>
>>>> [ 0.953796] ------------[ cut here ]------------
>>>> [ 0.953826] WARNING: CPU: 0 PID: 1 at
>>>> drivers/video/omap2/dss/dss.c:483 dss_set_fck_rate+0x7c/0x8c()
>>>> [ 0.953826] clk rate mismatch: 153600000 != 170666666
>>>
>>> I have a fix (attached) for this in fbdev-fixes, which I'll probably be
>>> sending to Linus today. I couldn't send it in the main fbdev pull
>>> request, as it depended on clk driver changes. And it's not fatal, most
>>> likely things work fine even with the warning.
>>
>> The warning disappeared after the patch. Thanks.
>> Feel free to add: Tested-By: Joachim Eastwood <manabian@gmail.com>
>
> Thanks. It should be in -rc2.
>
>> This board (VAR-STK-OM44) has a TPD12S521 which has no controllable
>> settings so adding a driver for it would be pretty meaningless. I
>> think it's the same situation with Gumstix Parlor. That board also
>> just have a very simple HDMI transmitter which shouldn't require a
>> driver.
>>
>> But never the less I got HDMI working on my board adding the tpd21s015
>> nodes and providing a dummy gpio for "CT CP HPD". This works but it's
>> a bit hacky.
>
> Remove the tpd21s015 nodes and try the attached patch. It adds HPD
> support to the hdmi connector. You also need something like this for the
> hdmi-connector node:
>
>
> pinctrl-names = "default";
> pinctrl-0 = <&hdmi_conn_pins>;
>
> hpd-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; /* GPIO 193, HPD */
>
>
> And the respective pinctrl node:
>
> hdmi_conn_pins: pinmux_hdmi_conn_pins {
>         pinctrl-single,pins = <
>                 0x0fe (PIN_INPUT_PULLDOWN | MUX_MODE6)
>         >;
> };
>
> Note that I tested this yesterday on one board, but I couldn't get it
> working yet, so no promises =). But that may be an issue with the HPD
> pin on the board.

Works like a charm here :)
Replugging the HDMI monitor and everything.

But I notice something strange on the monitor. Around the white login
text there are small blinking green dots. So maybe there is a timing
issue here?

Log below shows a monitor replug.
[ 63.158966] DISPC: dispc_runtime_get
[ 63.159027] DISPC: dispc_runtime_get
[ 63.159057] DISPC: dispc_runtime_put
[ 63.159057] DISPC: dispc_runtime_get
[ 63.159088] DISPC: dispc_runtime_put
[ 63.164459] DISPC: dispc_runtime_get
[ 63.164550] DISPC: dispc_runtime_put
[ 63.164550] DISPC: dispc_runtime_get
[ 63.164581] DISPC: dispc_runtime_put
[ 63.164581] DISPC: dispc_enable_plane 0, 0
[ 63.165069] DISPC: dispc_runtime_put
[ 63.165069] DISPC: dispc_runtime_get
[ 63.165069] DISPC: dispc_runtime_put
[ 83.292205] HDMI: hdmi_runtime_get
[ 83.320678] HDMI: hdmi_runtime_put
[ 83.326477] DISPC: dispc_runtime_get
[ 83.326538] DISPC: dispc_ovl_setup 0, pa 7f6a0000, pa_uv 0, sw 2048,
0,0, 1920x1200 -> 1920x1200, cmode 800, rot 0, mir 0, chan 1 repl 0
[ 83.326568] DISPC: calc_rot(0): scrw 2048, 1920x1200
[ 83.326568] DISPC: offset0 0, offset1 0, row_inc 513, pix_inc 1
[ 83.326599] DISPC: 0,0 1920x1200 -> 1920x1200
[ 83.326599] DISPC: dispc_enable_plane 0, 1
[ 83.326599] HDMI: Enter hdmi_display_disable
[ 83.328613] HDMI: hdmi_runtime_put
[ 83.328643] DISPC: dispc_runtime_put
[ 83.329010] HDMI: hdmi_get_code
[ 83.329010] HDMI: timing1_hsync = 160 timing1_vsync = 35timing2_hsync
= 160 timing2_vsync = 35
[ 83.329132] HDMI: using mode: DVI, code 68
[ 83.329132] HDMI: hdmi_get_code
[ 83.329162] HDMI: timing1_hsync = 160 timing1_vsync = 35timing2_hsync
= 160 timing2_vsync = 35
[ 83.329162] HDMI: using mode: DVI, code 68
[ 83.329162] HDMI: ENTER hdmi_display_enable
[ 83.330017] HDMI: hdmi_runtime_get
[ 83.330078] DISPC: dispc_runtime_get
[ 83.330078] HDMI: hdmi_power_on x_res= 1920 y_res = 1200
[ 83.330078] HDMIPLL: M = 641 Mf = 174762
[ 83.330139] HDMIPLL: range = 1 sd = 6
[ 83.330139] HDMIPLL: PLL locked!
[ 83.330566] HDMICORE: Enter hdmi_core_init
[ 83.330657] HDMIWP: Enter hdmi_wp_video_init_format
[ 83.330657] HDMIWP: Enter hdmi_wp_video_config_timing
[ 83.330657] HDMIWP: Enter hdmi_wp_video_config_interface
[ 83.330688] HDMICORE: Enter hdmi_core_swreset_assert
[ 83.330688] HDMICORE: Enter hdmi_core_powerdown_disable
[ 83.330718] HDMICORE: Enter hdmi_core_swreset_release
[ 83.330718] DISPC: channel 1 xres 1920 yres 1200
[ 83.330749] DISPC: dispc_runtime_get
[ 83.330749] DISPC: dispc_runtime_put
[ 83.330780] DISPC: dispc_runtime_get
[ 83.330780] DISPC: dispc_runtime_put
[ 83.330780] DISPC: dispc_runtime_get
[ 83.330810] DISPC: dispc_runtime_put
[ 83.330810] DISPC: GO DIGIT
[ 83.330841] DISPC: dispc_runtime_put
[ 83.330902] DISPC: dispc_runtime_get
[ 83.330902] DISPC: dispc_runtime_put


>> One other thing.
>> Does HDMI audio work with DT or is that a still TODO?
>> I am only getting probe deferral's from omap-hdmi-audio. Haven't look
>> to far into it.
>
> It's still on the works. If you volunteer for testing it (and Jyri needs
> someone to test), you can ask Jyri Sarha.

Jyri Sarha:

I get these messages in my log:
[ 4.290710] omap-hdmi-audio omap-hdmi-audio: ASoC: CODEC
hdmi-audio-codec not registered
[ 4.290710] omap-hdmi-audio omap-hdmi-audio: snd_soc_register_card failed (-517)
[ 4.290710] platform omap-hdmi-audio: Driver omap-hdmi-audio requests
probe deferral

"hdmi-audio-codec" should come from sound/soc/codecs/hdmi.c so added
these nodes to my DT.

hdmi_audio: hdmi_audio@0 {
    compatible = "linux,hdmi-audio";
    status = "okay";
};

But I still get the same message.

So if you have some patches you would like to have tested just tell me.


regards
Joachim Eastwood
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joachim Eastwood April 17, 2014, 9:11 a.m. UTC | #2
On 17 April 2014 10:56, Joachim  Eastwood <manabian@gmail.com> wrote:
> On 17 April 2014 09:24, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 16/04/14 19:11, Joachim Eastwood wrote:
>>> On 16 April 2014 07:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>>> On 15/04/14 20:36, Joachim Eastwood wrote:
>>>>> Hello,
>>>>>
>>>>> I am trying to get HDMI work with DT on my VAR-STK-OM44 (4460) board.
>>>>> But during kernel boot I get the following message:
>>>>>
>>>>> [ 0.953796] ------------[ cut here ]------------
>>>>> [ 0.953826] WARNING: CPU: 0 PID: 1 at
>>>>> drivers/video/omap2/dss/dss.c:483 dss_set_fck_rate+0x7c/0x8c()
>>>>> [ 0.953826] clk rate mismatch: 153600000 != 170666666
>>>>
>>>> I have a fix (attached) for this in fbdev-fixes, which I'll probably be
>>>> sending to Linus today. I couldn't send it in the main fbdev pull
>>>> request, as it depended on clk driver changes. And it's not fatal, most
>>>> likely things work fine even with the warning.
>>>
>>> The warning disappeared after the patch. Thanks.
>>> Feel free to add: Tested-By: Joachim Eastwood <manabian@gmail.com>
>>
>> Thanks. It should be in -rc2.
>>
>>> This board (VAR-STK-OM44) has a TPD12S521 which has no controllable
>>> settings so adding a driver for it would be pretty meaningless. I
>>> think it's the same situation with Gumstix Parlor. That board also
>>> just have a very simple HDMI transmitter which shouldn't require a
>>> driver.
>>>
>>> But never the less I got HDMI working on my board adding the tpd21s015
>>> nodes and providing a dummy gpio for "CT CP HPD". This works but it's
>>> a bit hacky.
>>
>> Remove the tpd21s015 nodes and try the attached patch. It adds HPD
>> support to the hdmi connector. You also need something like this for the
>> hdmi-connector node:
>>
>>
>> pinctrl-names = "default";
>> pinctrl-0 = <&hdmi_conn_pins>;
>>
>> hpd-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; /* GPIO 193, HPD */
>>
>>
>> And the respective pinctrl node:
>>
>> hdmi_conn_pins: pinmux_hdmi_conn_pins {
>>         pinctrl-single,pins = <
>>                 0x0fe (PIN_INPUT_PULLDOWN | MUX_MODE6)
>>         >;
>> };
>>
>> Note that I tested this yesterday on one board, but I couldn't get it
>> working yet, so no promises =). But that may be an issue with the HPD
>> pin on the board.
>
> Works like a charm here :)
> Replugging the HDMI monitor and everything.
>
> But I notice something strange on the monitor. Around the white login
> text there are small blinking green dots. So maybe there is a timing
> issue here?

That turned out to be my HDMI cable...
Changed to shorter cable and the green dots disappeared. Sorry for the
false alarm.

regards
Joachim Eastwood
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From e004ca58936336f06339e216c1f4bd5f1e694932 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date: Thu, 17 Apr 2014 10:18:58 +0300
Subject: [PATCH] connector-hdmi: hpd support

---
 drivers/video/omap2/displays-new/connector-hdmi.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/video/omap2/displays-new/connector-hdmi.c b/drivers/video/omap2/displays-new/connector-hdmi.c
index 29ed21b9dce5..7b06ea430209 100644
--- a/drivers/video/omap2/displays-new/connector-hdmi.c
+++ b/drivers/video/omap2/displays-new/connector-hdmi.c
@@ -13,6 +13,7 @@ 
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
+#include <linux/of_gpio.h>
 
 #include <drm/drm_edid.h>
 
@@ -43,6 +44,8 @@  struct panel_drv_data {
 	struct device *dev;
 
 	struct omap_video_timings timings;
+
+	int hpd_gpio;
 };
 
 #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
@@ -161,7 +164,10 @@  static bool hdmic_detect(struct omap_dss_device *dssdev)
 	struct panel_drv_data *ddata = to_panel_data(dssdev);
 	struct omap_dss_device *in = ddata->in;
 
-	return in->ops.hdmi->detect(in);
+	if (gpio_is_valid(ddata->hpd_gpio))
+		return gpio_get_value_cansleep(ddata->hpd_gpio);
+	else
+		return in->ops.hdmi->detect(in);
 }
 
 static int hdmic_audio_enable(struct omap_dss_device *dssdev)
@@ -288,6 +294,8 @@  static int hdmic_probe_pdata(struct platform_device *pdev)
 
 	pdata = dev_get_platdata(&pdev->dev);
 
+	ddata->hpd_gpio = -ENODEV;
+
 	in = omap_dss_find_output(pdata->source);
 	if (in == NULL) {
 		dev_err(&pdev->dev, "Failed to find video source\n");
@@ -307,6 +315,14 @@  static int hdmic_probe_of(struct platform_device *pdev)
 	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
 	struct device_node *node = pdev->dev.of_node;
 	struct omap_dss_device *in;
+	int gpio;
+
+	/* HPD GPIO */
+	gpio = of_get_named_gpio(node, "hpd-gpios", 0);
+	if (gpio_is_valid(gpio))
+		ddata->hpd_gpio = gpio;
+	else
+		ddata->hpd_gpio = -ENODEV;
 
 	in = omapdss_of_find_source_for_first_ep(node);
 	if (IS_ERR(in)) {
@@ -344,6 +360,11 @@  static int hdmic_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	r = devm_gpio_request_one(&pdev->dev, ddata->hpd_gpio,
+			GPIOF_DIR_IN, "hdmi_hpd");
+	if (r)
+		return r;
+
 	ddata->timings = hdmic_default_timings;
 
 	dssdev = &ddata->dssdev;
-- 
1.8.3.2