Browse Source

asoc: codecs: add child devices after completing initialization

In va, rx and wsa macros, move schedule_work call to
add the child devices to the point later to where the parent
initialization gets completed.

Change-Id: I2095f1007beae253534b2ed44f988ce55fad6b75
Signed-off-by: Vatsal Bucha <[email protected]>
Vatsal Bucha 4 years ago
parent
commit
ea36f4ea68

+ 1 - 2
asoc/codecs/lpass-cdc/lpass-cdc-rx-macro.c

@@ -4194,13 +4194,12 @@ static int lpass_cdc_rx_macro_probe(struct platform_device *pdev)
 			"%s: register macro failed\n", __func__);
 		goto err_reg_macro;
 	}
-	schedule_work(&rx_priv->lpass_cdc_rx_macro_add_child_devices_work);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, AUTO_SUSPEND_DELAY);
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
 	pm_suspend_ignore_children(&pdev->dev, true);
 	pm_runtime_enable(&pdev->dev);
-
+	schedule_work(&rx_priv->lpass_cdc_rx_macro_add_child_devices_work);
 	return 0;
 
 err_reg_macro:

+ 2 - 2
asoc/codecs/lpass-cdc/lpass-cdc-va-macro.c

@@ -2446,13 +2446,13 @@ static int lpass_cdc_va_macro_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "%s: register macro failed\n", __func__);
 		goto reg_macro_fail;
 	}
-	if (is_used_va_swr_gpio)
-		schedule_work(&va_priv->lpass_cdc_va_macro_add_child_devices_work);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, VA_AUTO_SUSPEND_DELAY);
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
 	pm_suspend_ignore_children(&pdev->dev, true);
 	pm_runtime_enable(&pdev->dev);
+	if (is_used_va_swr_gpio)
+		schedule_work(&va_priv->lpass_cdc_va_macro_add_child_devices_work);
 	return ret;
 
 reg_macro_fail:

+ 1 - 2
asoc/codecs/lpass-cdc/lpass-cdc-wsa-macro.c

@@ -3079,7 +3079,6 @@ static int lpass_cdc_wsa_macro_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "%s: register macro failed\n", __func__);
 		goto reg_macro_fail;
 	}
-	schedule_work(&wsa_priv->lpass_cdc_wsa_macro_add_child_devices_work);
 
 	if (of_find_property(wsa_priv->dev->of_node, "#cooling-cells", NULL)) {
 		ret = of_property_read_u32(pdev->dev.of_node,
@@ -3111,7 +3110,7 @@ static int lpass_cdc_wsa_macro_probe(struct platform_device *pdev)
 	pm_runtime_set_suspended(&pdev->dev);
 	pm_suspend_ignore_children(&pdev->dev, true);
 	pm_runtime_enable(&pdev->dev);
-
+	schedule_work(&wsa_priv->lpass_cdc_wsa_macro_add_child_devices_work);
 	return ret;
 reg_macro_fail:
 	mutex_destroy(&wsa_priv->mclk_lock);

+ 1 - 1
asoc/codecs/lpass-cdc/lpass-cdc.c

@@ -1303,7 +1303,6 @@ static int lpass_cdc_probe(struct platform_device *pdev)
 	mutex_init(&priv->vote_lock);
 	INIT_WORK(&priv->lpass_cdc_add_child_devices_work,
 		  lpass_cdc_add_child_devices);
-	schedule_work(&priv->lpass_cdc_add_child_devices_work);
 
 	/* Register LPASS core hw vote */
 	lpass_core_hw_vote = devm_clk_get(&pdev->dev, "lpass_core_hw_vote");
@@ -1326,6 +1325,7 @@ static int lpass_cdc_probe(struct platform_device *pdev)
 		ret = 0;
 	}
 	priv->lpass_audio_hw_vote = lpass_audio_hw_vote;
+	schedule_work(&priv->lpass_cdc_add_child_devices_work);
 
 	return 0;
 }