Prechádzať zdrojové kódy

asoc: codecs: bolero: add split codec check

Add a check to see if split codec is present for
the slaves being probed and add platform data to
such slaves.

Change-Id: I8b143c551a481b88dffc8763421d2aaa02c0012d
Signed-off-by: Karthikeyan Mani <[email protected]>
Karthikeyan Mani 6 rokov pred
rodič
commit
634fa7593f
1 zmenil súbory, kde vykonal 8 pridanie a 5 odobranie
  1. 8 5
      asoc/codecs/bolero/bolero-cdc.c

+ 8 - 5
asoc/codecs/bolero/bolero-cdc.c

@@ -825,7 +825,7 @@ static const struct snd_soc_component_driver bolero = {
 static void bolero_add_child_devices(struct work_struct *work)
 {
 	struct bolero_priv *priv;
-	bool wcd937x_node = false;
+	bool split_codec = false;
 	struct platform_device *pdev;
 	struct device_node *node;
 	int ret = 0, count = 0;
@@ -849,9 +849,12 @@ static void bolero_add_child_devices(struct work_struct *work)
 	priv->child_count = 0;
 
 	for_each_available_child_of_node(priv->dev->of_node, node) {
-		wcd937x_node = false;
-		if (strnstr(node->name, "wcd937x", strlen("wcd937x")) != NULL)
-			wcd937x_node = true;
+		split_codec = false;
+		if (of_find_property(node, "qcom,split-codec", NULL)) {
+			split_codec = true;
+			dev_dbg(priv->dev, "%s: split codec slave exists\n",
+				__func__);
+		}
 
 		strlcpy(plat_dev_name, node->name,
 				(BOLERO_CDC_STRING_LEN - 1));
@@ -866,7 +869,7 @@ static void bolero_add_child_devices(struct work_struct *work)
 		pdev->dev.parent = priv->dev;
 		pdev->dev.of_node = node;
 
-		if (wcd937x_node) {
+		if (split_codec) {
 			priv->dev->platform_data = platdata;
 			priv->wcd_dev = &pdev->dev;
 		}