* [PATCH v2] drm: bridge: synopsys/dw-hdmi: Enable cec clock
@ 2017-10-20 19:18 Pierre-Hugues Husson
2017-10-24 14:28 ` Heiko Stuebner
0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Hugues Husson @ 2017-10-20 19:18 UTC (permalink / raw)
To: linux-arm-kernel
The documentation already mentions "cec" optional clock, but
currently the driver doesn't enable it.
Changes:
v2:
- Separate ENOENT errors from others
- Propagate other errors (especially -EPROBE_DEFER)
Signed-off-by: Pierre-Hugues Husson <phh@phh.me>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index bf14214fa464..b31fc95d5fef 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -138,6 +138,7 @@ struct dw_hdmi {
struct device *dev;
struct clk *isfr_clk;
struct clk *iahb_clk;
+ struct clk *cec_clk;
struct dw_hdmi_i2c *i2c;
struct hdmi_data_info hdmi_data;
@@ -2382,6 +2383,27 @@ __dw_hdmi_probe(struct platform_device *pdev,
goto err_isfr;
}
+ hdmi->cec_clk = devm_clk_get(hdmi->dev, "cec");
+ if (PTR_ERR(hdmi->cec_clk) == -ENOENT) {
+ hdmi->cec_clk = NULL;
+ } else if (IS_ERR(hdmi->cec_clk)) {
+ ret = PTR_ERR(hdmi->cec_clk);
+ if (ret != -EPROBE_DEFER) {
+ dev_err(hdmi->dev, "Cannot get HDMI cec clock: %d\n",
+ ret);
+ }
+
+ hdmi->cec_clk = NULL;
+ goto err_iahb;
+ } else {
+ ret = clk_prepare_enable(hdmi->cec_clk);
+ if (ret) {
+ dev_err(hdmi->dev, "Cannot enable HDMI cec clock: %d\n",
+ ret);
+ goto err_iahb;
+ }
+ }
+
/* Product and revision IDs */
hdmi->version = (hdmi_readb(hdmi, HDMI_DESIGN_ID) << 8)
| (hdmi_readb(hdmi, HDMI_REVISION_ID) << 0);
@@ -2518,6 +2540,8 @@ __dw_hdmi_probe(struct platform_device *pdev,
cec_notifier_put(hdmi->cec_notifier);
clk_disable_unprepare(hdmi->iahb_clk);
+ if (hdmi->cec_clk)
+ clk_disable_unprepare(hdmi->cec_clk);
err_isfr:
clk_disable_unprepare(hdmi->isfr_clk);
err_res:
@@ -2541,6 +2565,8 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi)
clk_disable_unprepare(hdmi->iahb_clk);
clk_disable_unprepare(hdmi->isfr_clk);
+ if (hdmi->cec_clk)
+ clk_disable_unprepare(hdmi->cec_clk);
if (hdmi->i2c)
i2c_del_adapter(&hdmi->i2c->adap);
--
2.14.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2] drm: bridge: synopsys/dw-hdmi: Enable cec clock
2017-10-20 19:18 [PATCH v2] drm: bridge: synopsys/dw-hdmi: Enable cec clock Pierre-Hugues Husson
@ 2017-10-24 14:28 ` Heiko Stuebner
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2017-10-24 14:28 UTC (permalink / raw)
To: linux-arm-kernel
Hi Pierre,
Am Freitag, 20. Oktober 2017, 21:18:38 CEST schrieb Pierre-Hugues Husson:
> The documentation already mentions "cec" optional clock, but
> currently the driver doesn't enable it.
>
> Changes:
> v2:
> - Separate ENOENT errors from others
> - Propagate other errors (especially -EPROBE_DEFER)
>
> Signed-off-by: Pierre-Hugues Husson <phh@phh.me>
> ---
it looks like you might be missing some important people in your recipient list.
get_maintainer.pl shows me:
- Archit Taneja <architt@codeaurora.org> (maintainer:DRM DRIVERS FOR BRIDGE CHIPS)
- Andrzej Hajda <a.hajda@samsung.com> (maintainer:DRM DRIVERS FOR BRIDGE CHIPS)
- dri-devel at lists.freedesktop.org (open list:DRM DRIVERS)
So these should definitly be included in your recipients, as they're the
ones that will apply your patch :-)
One further nit below.
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index bf14214fa464..b31fc95d5fef 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -138,6 +138,7 @@ struct dw_hdmi {
> struct device *dev;
> struct clk *isfr_clk;
> struct clk *iahb_clk;
> + struct clk *cec_clk;
> struct dw_hdmi_i2c *i2c;
>
> struct hdmi_data_info hdmi_data;
> @@ -2382,6 +2383,27 @@ __dw_hdmi_probe(struct platform_device *pdev,
> goto err_isfr;
> }
>
> + hdmi->cec_clk = devm_clk_get(hdmi->dev, "cec");
> + if (PTR_ERR(hdmi->cec_clk) == -ENOENT) {
> + hdmi->cec_clk = NULL;
> + } else if (IS_ERR(hdmi->cec_clk)) {
> + ret = PTR_ERR(hdmi->cec_clk);
> + if (ret != -EPROBE_DEFER) {
> + dev_err(hdmi->dev, "Cannot get HDMI cec clock: %d\n",
> + ret);
> + }
braces around the single dev_err are not necessary.
Heiko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-24 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-20 19:18 [PATCH v2] drm: bridge: synopsys/dw-hdmi: Enable cec clock Pierre-Hugues Husson
2017-10-24 14:28 ` Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).