@@ -1505,6 +1505,9 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
const char *prefix,
struct device_node **bitclkmaster,
struct device_node **framemaster);
+int snd_soc_get_dai_info(struct of_phandle_args *args,
+ struct snd_soc_component **cmpnt,
+ struct snd_soc_dai_driver **dai_drv);
int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name);
int snd_soc_of_get_dai_link_codecs(struct device *dev,
@@ -3454,8 +3454,9 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
-static int snd_soc_get_dai_name(struct of_phandle_args *args,
- const char **dai_name)
+int snd_soc_get_dai_info(struct of_phandle_args *args,
+ struct snd_soc_component **cmpnt,
+ struct snd_soc_dai_driver **dai_drv)
{
struct snd_soc_component *pos;
int ret = -EPROBE_DEFER;
@@ -3486,15 +3487,33 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args,
ret = 0;
- *dai_name = pos->dai_drv[id].name;
- if (!*dai_name)
- *dai_name = pos->name;
+ *cmpnt = pos;
+ *dai_drv = pos->dai_drv + id;
break;
}
mutex_unlock(&client_mutex);
return ret;
}
+EXPORT_SYMBOL_GPL(snd_soc_get_dai_info);
+
+static int snd_soc_get_dai_name(struct of_phandle_args *args,
+ const char **dai_name)
+{
+ struct snd_soc_component *cmpnt;
+ struct snd_soc_dai_driver *dai_drv;
+ int ret;
+
+ ret = snd_soc_get_dai_info(args, &cmpnt, &dai_drv);
+ if (ret)
+ return ret;
+
+ *dai_name = dai_drv->name;
+ if (!*dai_name)
+ *dai_name = cmpnt->name;
+
+ return ret;
+}
int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name)