From patchwork Thu Apr 17 07:24:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 4006021 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A2C85BFF02 for ; Thu, 17 Apr 2014 07:24:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DECD320328 for ; Thu, 17 Apr 2014 07:24:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0103520303 for ; Thu, 17 Apr 2014 07:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754162AbaDQHYb (ORCPT ); Thu, 17 Apr 2014 03:24:31 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:52434 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753593AbaDQHYa (ORCPT ); Thu, 17 Apr 2014 03:24:30 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3H7OTC9031333; Thu, 17 Apr 2014 02:24:29 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3H7OTo0004951; Thu, 17 Apr 2014 02:24:29 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Thu, 17 Apr 2014 02:24:28 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3H7OR4Q007329; Thu, 17 Apr 2014 02:24:27 -0500 Message-ID: <534F81AA.8060805@ti.com> Date: Thu, 17 Apr 2014 10:24:26 +0300 From: Tomi Valkeinen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Joachim Eastwood CC: Tero Kristo , , Nishanth Menon , "Sarha, Jyri" Subject: Re: HDMI on OMAP4460: clk rate mismatch warning References: <534E17B3.5050109@ti.com> In-Reply-To: X-Enigmail-Version: 1.6 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 16/04/14 19:11, Joachim Eastwood wrote: > On 16 April 2014 07:40, Tomi Valkeinen 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 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 From e004ca58936336f06339e216c1f4bd5f1e694932 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen 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 #include #include +#include #include @@ -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