From 6cfdc162107a0bfc2b380027a63157354582564a Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Thu, 29 Nov 2018 14:28:57 -0800 Subject: wov: Modify wov_set_gain to update gain params in wov_conf The function wov_set_gain would only pass along the desired channel gain values to the apm, but did not update channel gain parameters of wov_conf. This CL modifies this function to also update those parameters so they can be saved an retrieved by the audio codec. BRANCH=none BUG=b:116766596 TEST=On cheza verifed recording works using the following kernel commands and the loading the audio file into audacity. amixer -c 0 cset iface=MIXER,name='MultiMedia1 Mixer SEC_MI2S_TX' on amixer -c0 cset numid=27 30,30 arecord -D hw:0,0 -f dat /tmp/rec.wav -d 5 Change-Id: I2d0e1e386769bb25754a684b391362c4ea02b39b Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1356183 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: CH Lin Reviewed-by: Wai-Hong Tam --- chip/npcx/wov.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chip/npcx/wov.c') diff --git a/chip/npcx/wov.c b/chip/npcx/wov.c index c18ef01c0f..7f6b06b81e 100644 --- a/chip/npcx/wov.c +++ b/chip/npcx/wov.c @@ -1528,6 +1528,9 @@ void wov_mute(int enable) */ void wov_set_gain(int left_chan_gain, int right_chan_gain) { + wov_conf.left_chan_gain = left_chan_gain; + wov_conf.right_chan_gain = right_chan_gain; + (void) apm_adc_gain_config(APM_ADC_CHAN_GAINS_INDEPENDENT, left_chan_gain, right_chan_gain); } -- cgit v1.2.1