asoc: kona: Fix to apply wsa8810 gain settings
Update wsa aux codec matching logic in machine driver to apply proper gain settings for wsa8810 variant. Add null check for aux component name to avoid dereference. Change-Id: Ie332f8e37a2d6b7a250fe299df91fa9cf9d7636b Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
13
asoc/kona.c
13
asoc/kona.c
@@ -5003,17 +5003,18 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
|
|||||||
__func__, rtd->card->num_aux_devs);
|
__func__, rtd->card->num_aux_devs);
|
||||||
if (rtd->card->num_aux_devs &&
|
if (rtd->card->num_aux_devs &&
|
||||||
!list_empty(&rtd->card->component_dev_list)) {
|
!list_empty(&rtd->card->component_dev_list)) {
|
||||||
aux_comp = list_first_entry(
|
list_for_each_entry(aux_comp,
|
||||||
&rtd->card->component_dev_list,
|
&rtd->card->aux_comp_list,
|
||||||
struct snd_soc_component,
|
card_aux_list) {
|
||||||
card_aux_list);
|
if (aux_comp->name != NULL && (
|
||||||
if (!strcmp(aux_comp->name, WSA8810_NAME_1) ||
|
!strcmp(aux_comp->name, WSA8810_NAME_1) ||
|
||||||
!strcmp(aux_comp->name, WSA8810_NAME_2)) {
|
!strcmp(aux_comp->name, WSA8810_NAME_2))) {
|
||||||
wsa_macro_set_spkr_mode(component,
|
wsa_macro_set_spkr_mode(component,
|
||||||
WSA_MACRO_SPKR_MODE_1);
|
WSA_MACRO_SPKR_MODE_1);
|
||||||
wsa_macro_set_spkr_gain_offset(component,
|
wsa_macro_set_spkr_gain_offset(component,
|
||||||
WSA_MACRO_GAIN_OFFSET_M1P5_DB);
|
WSA_MACRO_GAIN_OFFSET_M1P5_DB);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bolero_set_port_map(component, ARRAY_SIZE(sm_port_map),
|
bolero_set_port_map(component, ARRAY_SIZE(sm_port_map),
|
||||||
sm_port_map);
|
sm_port_map);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user