public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: linux-rockchip@lists.infradead.org
Cc: Algea Cao <algea.cao@rock-chips.com>,
	daniel.vetter@intel.com, jani.nikula@linux.intel.com,
	seanpaul@chromium.org, airlied@linux.ie,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	yang.zheng@rock-chips.com, kever.yang@rock-chips.com,
	mark.yao@rock-chips.com
Subject: Re: [PATCH v2 5/7] drm/rockchip: dw_hdmi: add hclk_vio
Date: Sun, 10 Dec 2017 18:08:45 +0100	[thread overview]
Message-ID: <4016321.4tnllylE8d@phil> (raw)
In-Reply-To: <1506735912-152263-1-git-send-email-algea.cao@rock-chips.com>

Hi Algea,

Am Samstag, 30. September 2017, 09:45:12 CET schrieb Algea Cao:
> Add clk hclk_vio and enable it when hdmi bind.

Could you explain what the hclk_vio reference is needed for please?

Because from from what I tracked down in the TRM and code, this hclk_vio
is defined wrong in the clock-driver.

According to the TRM, that hclk_vio (gate22[1]) is actually hclk_vio_niu and
hence the clock for the interconnect <-> hdmi  connection.
As this clock is a property of the interconnect, which we don't model so far,
all niu clocks are simply defined as critical in the clock driver itself, as can
be seen in most clock drivers.

So I'd suggest fixing the clock-driver accordingly and dropping this patch.


Heiko


> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 7658b2f..e1a9941 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -61,6 +61,7 @@ struct rockchip_hdmi {
>  	enum dw_hdmi_devtype dev_type;
>  	struct clk *vpll_clk;
>  	struct clk *grf_clk;
> +	struct clk *hclk_vio;
>  	struct phy *phy;
>  };
>  
> @@ -277,12 +278,27 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
>  		return PTR_ERR(hdmi->grf_clk);
>  	}
>  
> +	hdmi->hclk_vio = devm_clk_get(hdmi->dev, "hclk_vio");
> +	if (PTR_ERR(hdmi->hclk_vio) == -ENOENT) {
> +		hdmi->hclk_vio = NULL;
> +	} else if (PTR_ERR(hdmi->hclk_vio) == -EPROBE_DEFER) {
> +		return -EPROBE_DEFER;
> +	} else if (IS_ERR(hdmi->hclk_vio)) {
> +		dev_dbg(hdmi->dev, "failed to get hclk_vio clock\n");
> +		return PTR_ERR(hdmi->hclk_vio);
> +	}
>  	ret = clk_prepare_enable(hdmi->vpll_clk);
>  	if (ret) {
>  		dev_err(hdmi->dev, "Failed to enable HDMI vpll: %d\n", ret);
>  		return ret;
>  	}
>  
> +	ret = clk_prepare_enable(hdmi->hclk_vio);
> +	if (ret) {
> +		dev_dbg(hdmi->dev, "Failed to eanble HDMI hclk_vio: %d\n",
> +			ret);
> +		return ret;
> +	}
>  	return 0;
>  }
>  
> @@ -506,6 +522,11 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
>  static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
>  				    void *data)
>  {
> +	struct rockchip_hdmi *hdmi = container_of(&dev, struct rockchip_hdmi,
> +						  dev);
> +
> +	clk_disable_unprepare(hdmi->hclk_vio);
> +
>  	return dw_hdmi_unbind(dev);
>  }
>  
> 

  reply	other threads:[~2017-12-10 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1506735713-147081-0>
2017-09-30  1:43 ` [PATCH v2 1/7] drm/rockchip: dw_hdmi: update dw_hdmi_rockchip_dt_ids Algea Cao
2017-09-30  1:43 ` [PATCH v2 2/7] drm/rockchip: dw_hdmi: add device type Algea Cao
2017-10-03  9:52   ` Neil Armstrong
2017-09-30  1:44 ` [PATCH v2 3/7] drm: bridge: dw-hdmi: change hdmi phy hpd read function to export Algea Cao
2017-09-30  1:44 ` [PATCH v2 4/7] drm/rockchip: dw_hdmi: add inno hdmi phy ops Algea Cao
2017-12-09 17:09   ` Heiko Stuebner
2017-09-30  1:45 ` [PATCH v2 5/7] drm/rockchip: dw_hdmi: add hclk_vio Algea Cao
2017-12-10 17:08   ` Heiko Stuebner [this message]
2017-09-30  1:45 ` [PATCH v2 6/7] drm/rockchip: dw_hdmi: update dw-hdmi encoder enable Algea Cao
2017-09-30  1:46 ` [PATCH v2 7/7] drm: bridge: dw-hdmi: get phy ops by device type Algea Cao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4016321.4tnllylE8d@phil \
    --to=heiko@sntech.de \
    --cc=airlied@linux.ie \
    --cc=algea.cao@rock-chips.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --cc=seanpaul@chromium.org \
    --cc=yang.zheng@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox