summaryrefslogtreecommitdiff
path: root/chip/npcx/wov.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-11-29 14:32:23 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-06 22:06:29 -0800
commit5838aa7bb6edfb7cc02d08f35f22dd3783d4013e (patch)
tree24656c7267260a53bc3912e0c7d76699831adcba /chip/npcx/wov.c
parent6b1c8f10329d1d335aa5c1a3365973d4250e2519 (diff)
downloadchrome-ec-5838aa7bb6edfb7cc02d08f35f22dd3783d4013e.tar.gz
wov: Add API method to retrieve the channel gain parameters
This CL adds a new function wov_get_gain() so the codec driver can query the current channel gain values. 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: I5aab58a651d95727cf5c49149898f78ca25c78cf Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1356184 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'chip/npcx/wov.c')
-rw-r--r--chip/npcx/wov.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/chip/npcx/wov.c b/chip/npcx/wov.c
index 7f6b06b81e..2d0574ff01 100644
--- a/chip/npcx/wov.c
+++ b/chip/npcx/wov.c
@@ -1536,6 +1536,19 @@ void wov_set_gain(int left_chan_gain, int right_chan_gain)
}
/**
+ * Gets gain values
+ *
+ * @param left_chan_gain - address of left channel gain response.
+ * @param right_chan_gain - address of right channel gain response.
+ * @return None
+ */
+void wov_get_gain(int *left_chan_gain, int *right_chan_gain)
+{
+ *left_chan_gain = wov_conf.left_chan_gain;
+ *right_chan_gain = wov_conf.right_chan_gain;
+}
+
+/**
* Enables/Disables ADC.
*
* @param enable - enabled flag, 1 means enable