diff mbox

drm/msm/dsi: Get byte_intf_clk only for versions that need it

Message ID 1518417067-7808-1-git-send-email-architt@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Archit Taneja Feb. 12, 2018, 6:31 a.m. UTC
From: Archit Taneja <architt@codeaurora.org>

Newer DSI host controllers (SDM845 in particular) require a new clock
called byte_intf_clk. A recent patch tried to add this as an optional
clock, but it still set 'ret' to an error number if it didn't find it.
This breaks the host's probe for all previous DSI host versions.

Instead of setting this up as an optional clock, try to get the clock
only for the DSI version that supports it.

Fixes: 56558fb ("drm/msm/dsi: Add byte_intf_clk")
Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comments

Sibi Sankar Feb. 21, 2018, 12:32 p.m. UTC | #1
Tested on db410c modetest runs fine now.


On 02/12/2018 12:01 PM, architt@codeaurora.org wrote:
> From: Archit Taneja <architt@codeaurora.org>
> 
> Newer DSI host controllers (SDM845 in particular) require a new clock
> called byte_intf_clk. A recent patch tried to add this as an optional
> clock, but it still set 'ret' to an error number if it didn't find it.
> This breaks the host's probe for all previous DSI host versions.
> 
> Instead of setting this up as an optional clock, try to get the clock
> only for the DSI version that supports it.
> 
> Fixes: 56558fb ("drm/msm/dsi: Add byte_intf_clk")
> Signed-off-by: Archit Taneja <architt@codeaurora.org>
> ---
>   drivers/gpu/drm/msm/dsi/dsi_host.c | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index f675975..62ac614 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -378,11 +378,16 @@ static int dsi_clk_init(struct msm_dsi_host *msm_host)
>   		goto exit;
>   	}
>   
> -	msm_host->byte_intf_clk = msm_clk_get(pdev, "byte_intf");
> -	if (IS_ERR(msm_host->byte_intf_clk)) {
> -		ret = PTR_ERR(msm_host->byte_intf_clk);
> -		pr_debug("%s: can't find byte_intf clock. ret=%d\n",
> -			 __func__, ret);
> +	if (cfg_hnd->major == MSM_DSI_VER_MAJOR_6G &&
> +	    cfg_hnd->minor >= MSM_DSI_6G_VER_MINOR_V2_2_1) {
> +		msm_host->byte_intf_clk = msm_clk_get(pdev, "byte_intf");
> +		if (IS_ERR(msm_host->byte_intf_clk)) {
> +			ret = PTR_ERR(msm_host->byte_intf_clk);
> +			pr_err("%s: can't find byte_intf clock. ret=%d\n",
> +			        __func__, ret);
> +			goto exit;
> +		}
> +	} else {
>   		msm_host->byte_intf_clk = NULL;
>   	}
>   
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index f675975..62ac614 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -378,11 +378,16 @@  static int dsi_clk_init(struct msm_dsi_host *msm_host)
 		goto exit;
 	}
 
-	msm_host->byte_intf_clk = msm_clk_get(pdev, "byte_intf");
-	if (IS_ERR(msm_host->byte_intf_clk)) {
-		ret = PTR_ERR(msm_host->byte_intf_clk);
-		pr_debug("%s: can't find byte_intf clock. ret=%d\n",
-			 __func__, ret);
+	if (cfg_hnd->major == MSM_DSI_VER_MAJOR_6G &&
+	    cfg_hnd->minor >= MSM_DSI_6G_VER_MINOR_V2_2_1) {
+		msm_host->byte_intf_clk = msm_clk_get(pdev, "byte_intf");
+		if (IS_ERR(msm_host->byte_intf_clk)) {
+			ret = PTR_ERR(msm_host->byte_intf_clk);
+			pr_err("%s: can't find byte_intf clock. ret=%d\n",
+			        __func__, ret);
+			goto exit;
+		}
+	} else {
 		msm_host->byte_intf_clk = NULL;
 	}