Merge "AsoC: lahaina: support right speaker as mono device"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
f407fb795d
@@ -7636,17 +7636,14 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||||||
struct msm_asoc_mach_data *pdata =
|
struct msm_asoc_mach_data *pdata =
|
||||||
snd_soc_card_get_drvdata(rtd->card);
|
snd_soc_card_get_drvdata(rtd->card);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int wsa_active_devs = 0;
|
||||||
|
|
||||||
if (codec_reg_done) {
|
if (codec_reg_done) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (pdata->wsa_max_devs > 0) {
|
if (pdata->wsa_max_devs > 0) {
|
||||||
component = snd_soc_rtdcom_lookup(rtd, "wsa-codec.1");
|
component = snd_soc_rtdcom_lookup(rtd, "wsa-codec.1");
|
||||||
if (!component) {
|
if (component) {
|
||||||
pr_err("%s: wsa-codec.1 component is NULL\n", __func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
dapm = snd_soc_component_get_dapm(component);
|
dapm = snd_soc_component_get_dapm(component);
|
||||||
|
|
||||||
wsa883x_set_channel_map(component, &spkleft_ports[0],
|
wsa883x_set_channel_map(component, &spkleft_ports[0],
|
||||||
@@ -7655,13 +7652,19 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||||||
|
|
||||||
wsa883x_codec_info_create_codec_entry(pdata->codec_root,
|
wsa883x_codec_info_create_codec_entry(pdata->codec_root,
|
||||||
component);
|
component);
|
||||||
|
wsa_active_devs++;
|
||||||
|
} else {
|
||||||
|
pr_info("%s: wsa-codec.1 component is NULL\n", __func__);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If current platform has more than one WSA */
|
/* If current platform has more than one WSA */
|
||||||
if (pdata->wsa_max_devs > 1) {
|
if (pdata->wsa_max_devs > wsa_active_devs) {
|
||||||
component = snd_soc_rtdcom_lookup(rtd, "wsa-codec.2");
|
component = snd_soc_rtdcom_lookup(rtd, "wsa-codec.2");
|
||||||
if (!component) {
|
if (!component) {
|
||||||
pr_err("%s: wsa-codec.2 component is NULL\n", __func__);
|
pr_err("%s: wsa-codec.2 component is NULL\n", __func__);
|
||||||
|
pr_err("%s: %d WSA is found. Expect %d WSA.",
|
||||||
|
__func__, wsa_active_devs, pdata->wsa_max_devs);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user