Bladeren bron

asoc: ext-clk: Allow clock probe without pinctrl for lpass nodes

Currently audio ref clock probe for lpass clock nodes require
pinctrl entry as mandatory. For bolero lpass clocks, there is
no pinctrl required. Allow audio ref clock probe to proceed
with pinctrl based on property of use-pinctrl set to non-zero
value from dtsi.

Change-Id: Ide4a10e89672f0adefd2e0d99830c38191119dfc
Signed-off-by: Laxminath Kasam <[email protected]>
Laxminath Kasam 6 jaren geleden
bovenliggende
commit
43c1a132f2
1 gewijzigde bestanden met toevoegingen van 17 en 13 verwijderingen
  1. 17 13
      asoc/codecs/audio-ext-clk-up.c

+ 17 - 13
asoc/codecs/audio-ext-clk-up.c

@@ -169,12 +169,6 @@ static int audio_get_pinctrl(struct platform_device *pdev)
 	int ret;
 	int ret;
 	u32 reg;
 	u32 reg;
 
 
-	if (clk_priv->clk_src == AUDIO_EXT_CLK_LNBB2) {
-		dev_dbg(dev, "%s no pinctrl for clk_src = %d\n",
-			__func__, clk_priv->clk_src);
-		return 0;
-	}
-
 	pnctrl_info = &clk_priv->audio_clk.pnctrl_info;
 	pnctrl_info = &clk_priv->audio_clk.pnctrl_info;
 	if (pnctrl_info->pinctrl) {
 	if (pnctrl_info->pinctrl) {
 		dev_err(dev, "%s: already requested before\n",
 		dev_err(dev, "%s: already requested before\n",
@@ -286,8 +280,7 @@ static int audio_ref_clk_probe(struct platform_device *pdev)
 {
 {
 	int ret;
 	int ret;
 	struct audio_ext_clk_priv *clk_priv;
 	struct audio_ext_clk_priv *clk_priv;
-	u32 clk_freq = 0, clk_id = 0, clk_src = 0;
-
+	u32 clk_freq = 0, clk_id = 0, clk_src = 0, use_pinctrl = 0;
 
 
 	clk_priv = devm_kzalloc(&pdev->dev, sizeof(*clk_priv), GFP_KERNEL);
 	clk_priv = devm_kzalloc(&pdev->dev, sizeof(*clk_priv), GFP_KERNEL);
 	if (!clk_priv)
 	if (!clk_priv)
@@ -336,11 +329,22 @@ static int audio_ref_clk_probe(struct platform_device *pdev)
 			clk_priv->clk_cfg.clk_id, clk_priv->clk_src);
 			clk_priv->clk_cfg.clk_id, clk_priv->clk_src);
 	platform_set_drvdata(pdev, clk_priv);
 	platform_set_drvdata(pdev, clk_priv);
 
 
-	ret = audio_get_pinctrl(pdev);
-	if (ret) {
-		dev_err(&pdev->dev, "%s: Parsing PMI pinctrl failed\n",
-			__func__);
-		return ret;
+	/*
+	 * property qcom,use-pinctrl to be defined in DTSI to val 1
+	 * for clock nodes using pinctrl
+	 */
+	of_property_read_u32(pdev->dev.of_node, "qcom,use-pinctrl",
+			     &use_pinctrl);
+	dev_dbg(&pdev->dev, "%s: use-pinctrl : %d\n",
+		__func__, use_pinctrl);
+
+	if (use_pinctrl) {
+		ret = audio_get_pinctrl(pdev);
+		if (ret) {
+			dev_err(&pdev->dev, "%s: Parsing PMI pinctrl failed\n",
+				__func__);
+			return ret;
+		}
 	}
 	}
 
 
 	ret = audio_get_clk_data(pdev);
 	ret = audio_get_clk_data(pdev);