asoc: wsa883x: Update low_noise gain for receiver

Add changes to use wsa883x for receiver with
low_noise mode settings.

Change-Id: Icfa43ebbdb1e366f365053535f541bee03751ca3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
Laxminath Kasam
2020-10-08 18:21:46 +05:30
committed by Gerrit - the friendly Code Review server
parent 4a24723e3d
commit ae258cb2f8
4 changed files with 181 additions and 9 deletions

View File

@@ -530,6 +530,12 @@ static const char * const wsa_dev_mode_text[] = {
"speaker", "receiver", "ultrasound"
};
enum {
SPEAKER,
RECEIVER,
ULTRASOUND,
};
static const struct soc_enum wsa_dev_mode_enum =
SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(wsa_dev_mode_text), wsa_dev_mode_text);
@@ -1112,8 +1118,18 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
true);
/* Added delay as per HW sequence */
usleep_range(250, 300);
snd_soc_component_update_bits(component, WSA883X_DRE_CTL_1,
0x01, 0x01);
if (wsa883x->dev_mode == RECEIVER) {
snd_soc_component_update_bits(component,
WSA883X_DRE_CTL_0,
0xF0, 0x00);
} else if (wsa883x->dev_mode == SPEAKER) {
snd_soc_component_update_bits(component,
WSA883X_DRE_CTL_0,
0xF0, 0x90);
}
snd_soc_component_update_bits(component,
WSA883X_DRE_CTL_1,
0x01, 0x01);
/* Added delay as per HW sequence */
usleep_range(250, 300);