diff options
Diffstat (limited to 'drivers/gpu/drm/bridge/synopsys/dw-hdmi.c')
| -rw-r--r-- | drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index bf14214fa464..b72259bf6e2f 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 { | |||
| 138 | struct device *dev; | 138 | struct device *dev; |
| 139 | struct clk *isfr_clk; | 139 | struct clk *isfr_clk; |
| 140 | struct clk *iahb_clk; | 140 | struct clk *iahb_clk; |
| 141 | struct clk *cec_clk; | ||
| 141 | struct dw_hdmi_i2c *i2c; | 142 | struct dw_hdmi_i2c *i2c; |
| 142 | 143 | ||
| 143 | struct hdmi_data_info hdmi_data; | 144 | struct hdmi_data_info hdmi_data; |
| @@ -2382,6 +2383,26 @@ __dw_hdmi_probe(struct platform_device *pdev, | |||
| 2382 | goto err_isfr; | 2383 | goto err_isfr; |
| 2383 | } | 2384 | } |
| 2384 | 2385 | ||
| 2386 | hdmi->cec_clk = devm_clk_get(hdmi->dev, "cec"); | ||
| 2387 | if (PTR_ERR(hdmi->cec_clk) == -ENOENT) { | ||
| 2388 | hdmi->cec_clk = NULL; | ||
| 2389 | } else if (IS_ERR(hdmi->cec_clk)) { | ||
| 2390 | ret = PTR_ERR(hdmi->cec_clk); | ||
| 2391 | if (ret != -EPROBE_DEFER) | ||
| 2392 | dev_err(hdmi->dev, "Cannot get HDMI cec clock: %d\n", | ||
| 2393 | ret); | ||
| 2394 | |||
| 2395 | hdmi->cec_clk = NULL; | ||
| 2396 | goto err_iahb; | ||
| 2397 | } else { | ||
| 2398 | ret = clk_prepare_enable(hdmi->cec_clk); | ||
| 2399 | if (ret) { | ||
| 2400 | dev_err(hdmi->dev, "Cannot enable HDMI cec clock: %d\n", | ||
| 2401 | ret); | ||
| 2402 | goto err_iahb; | ||
| 2403 | } | ||
| 2404 | } | ||
| 2405 | |||
| 2385 | /* Product and revision IDs */ | 2406 | /* Product and revision IDs */ |
| 2386 | hdmi->version = (hdmi_readb(hdmi, HDMI_DESIGN_ID) << 8) | 2407 | hdmi->version = (hdmi_readb(hdmi, HDMI_DESIGN_ID) << 8) |
| 2387 | | (hdmi_readb(hdmi, HDMI_REVISION_ID) << 0); | 2408 | | (hdmi_readb(hdmi, HDMI_REVISION_ID) << 0); |
| @@ -2518,6 +2539,8 @@ err_iahb: | |||
| 2518 | cec_notifier_put(hdmi->cec_notifier); | 2539 | cec_notifier_put(hdmi->cec_notifier); |
| 2519 | 2540 | ||
| 2520 | clk_disable_unprepare(hdmi->iahb_clk); | 2541 | clk_disable_unprepare(hdmi->iahb_clk); |
| 2542 | if (hdmi->cec_clk) | ||
| 2543 | clk_disable_unprepare(hdmi->cec_clk); | ||
| 2521 | err_isfr: | 2544 | err_isfr: |
| 2522 | clk_disable_unprepare(hdmi->isfr_clk); | 2545 | clk_disable_unprepare(hdmi->isfr_clk); |
| 2523 | err_res: | 2546 | err_res: |
| @@ -2541,6 +2564,8 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi) | |||
| 2541 | 2564 | ||
| 2542 | clk_disable_unprepare(hdmi->iahb_clk); | 2565 | clk_disable_unprepare(hdmi->iahb_clk); |
| 2543 | clk_disable_unprepare(hdmi->isfr_clk); | 2566 | clk_disable_unprepare(hdmi->isfr_clk); |
| 2567 | if (hdmi->cec_clk) | ||
| 2568 | clk_disable_unprepare(hdmi->cec_clk); | ||
| 2544 | 2569 | ||
| 2545 | if (hdmi->i2c) | 2570 | if (hdmi->i2c) |
| 2546 | i2c_del_adapter(&hdmi->i2c->adap); | 2571 | i2c_del_adapter(&hdmi->i2c->adap); |
