summaryrefslogtreecommitdiff
path: root/chip/npcx/wov.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-11-29 14:28:57 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-04 00:11:29 -0800
commit6cfdc162107a0bfc2b380027a63157354582564a (patch)
tree1dc1e9b33f0e61aec23ade70511f400402b35c12 /chip/npcx/wov.c
parent213bed526730738b6b62e4680317241c00d1f89d (diff)
downloadchrome-ec-6cfdc162107a0bfc2b380027a63157354582564a.tar.gz
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 <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1356183 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'chip/npcx/wov.c')
-rw-r--r--chip/npcx/wov.c3
1 files changed, 3 insertions, 0 deletions
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);
}