diff options
author | Cheng-Yi Chiang <cychiang@chromium.org> | 2018-08-13 17:01:31 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-20 18:06:17 -0800 |
commit | 01b326eb4c4c7863ebecd8fe42102d784374f7e7 (patch) | |
tree | b4b3875fecacc40d741cf3566fcb2a6b487530c3 | |
parent | 76bdf421c5ee0b5db14380dcd3fd5efee6fc1457 (diff) | |
download | chrome-ec-01b326eb4c4c7863ebecd8fe42102d784374f7e7.tar.gz |
audio_codec: add audio codec feature
This CL adds support for the audio codec feature required to support
dmic and I2S operation.
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: I2b3ba097aaf6a7854551db2033914d00ac3ec275
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1192702
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
-rw-r--r-- | common/ec_features.c | 3 | ||||
-rw-r--r-- | include/config.h | 3 | ||||
-rw-r--r-- | include/ec_commands.h | 2 | ||||
-rw-r--r-- | util/ectool.c | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/common/ec_features.c b/common/ec_features.c index b0f5876e92..4bf9f14c2a 100644 --- a/common/ec_features.c +++ b/common/ec_features.c @@ -131,6 +131,9 @@ uint32_t get_feature_flags1(void) #if defined(CONFIG_LID_ANGLE) && defined(CONFIG_TABLET_MODE) | EC_FEATURE_MASK_1(EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS) #endif +#ifdef CONFIG_AUDIO_CODEC + | EC_FEATURE_MASK_1(EC_FEATURE_AUDIO_CODEC) +#endif ; #ifdef CONFIG_EC_FEATURE_BOARD_OVERRIDE result = board_override_feature_flags1(result); diff --git a/include/config.h b/include/config.h index 903365de9d..48f642fe59 100644 --- a/include/config.h +++ b/include/config.h @@ -215,6 +215,9 @@ /* Support AP Warm reset Interrupt. */ #undef CONFIG_AP_WARM_RESET_INTERRUPT +/* Support audio codec for WoV and I2S normal recording. */ +#undef CONFIG_AUDIO_CODEC + /* * Enable support for CPU caches behaving according to the ARMv7-M ISA. * (so far, only the Cortex-M7 has such caches) diff --git a/include/ec_commands.h b/include/ec_commands.h index c05a1d495a..9f066e0988 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -1336,6 +1336,8 @@ enum ec_feature_code { * MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE. */ EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS = 37, + /* EC supports audio codec. */ + EC_FEATURE_AUDIO_CODEC = 38, }; #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) diff --git a/util/ectool.c b/util/ectool.c index 51cfd37d7b..5eadc99bfb 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -645,6 +645,7 @@ static const char * const ec_feature_names[] = { "Tight timestamp for sensors events", [EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS] = "Refined tablet mode hysteresis", + [EC_FEATURE_AUDIO_CODEC] = "Audio Codec", }; int cmd_inventory(int argc, char *argv[]) |