summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@chromium.org>2019-05-17 11:22:53 +0800
committerCommit Bot <commit-bot@chromium.org>2019-09-17 14:56:58 +0000
commit0ba3ba3049226e92d6cf64ed06031ec9a3bb7949 (patch)
treeb4f3aff83258c93042ad2b3a02bda7f2f50e3af3 /include/ec_commands.h
parentbb5d21d349efbc12fa5596a811a241508621e64d (diff)
downloadchrome-ec-0ba3ba3049226e92d6cf64ed06031ec9a3bb7949.tar.gz
audio_codec: add DMIC abstract layer
Common DMIC host commands: - get_max_gain - get_gain_idx - set_gain_idx BRANCH=none BUG=b:122027734, b:123268236 TEST=1. define CONFIG_AUDIO_CODEC in board.h 2. define CONFIG_AUDIO_CODEC_DMIC in board.h 3. make BOARD=kukui_scp -j Change-Id: I7b4cc11645675f9d790947b17c3ea385dae13483 Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1564502 Commit-Queue: Sean Abraham <seanabraham@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 057c3411f4..e553ecdfa9 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -4723,30 +4723,53 @@ struct __ec_align4 ec_response_ec_codec_get_shm_addr {
#define EC_CMD_EC_CODEC_DMIC 0x00BD
enum ec_codec_dmic_subcmd {
- EC_CODEC_DMIC_SET_GAIN = 0x0,
- EC_CODEC_DMIC_GET_GAIN = 0x1,
+ EC_CODEC_DMIC_GET_MAX_GAIN = 0x0,
+ EC_CODEC_DMIC_SET_GAIN_IDX = 0x1,
+ EC_CODEC_DMIC_GET_GAIN_IDX = 0x2,
EC_CODEC_DMIC_SUBCMD_COUNT,
};
-struct __ec_align1 ec_param_ec_codec_dmic_set_gain {
- uint8_t left;
- uint8_t right;
+enum ec_codec_dmic_channel {
+ EC_CODEC_DMIC_CHANNEL_0 = 0x0,
+ EC_CODEC_DMIC_CHANNEL_1 = 0x1,
+ EC_CODEC_DMIC_CHANNEL_2 = 0x2,
+ EC_CODEC_DMIC_CHANNEL_3 = 0x3,
+ EC_CODEC_DMIC_CHANNEL_4 = 0x4,
+ EC_CODEC_DMIC_CHANNEL_5 = 0x5,
+ EC_CODEC_DMIC_CHANNEL_6 = 0x6,
+ EC_CODEC_DMIC_CHANNEL_7 = 0x7,
+ EC_CODEC_DMIC_CHANNEL_COUNT,
+};
+
+struct __ec_align1 ec_param_ec_codec_dmic_set_gain_idx {
+ uint8_t channel; /* enum ec_codec_dmic_channel */
+ uint8_t gain;
uint8_t reserved[2];
};
+struct __ec_align1 ec_param_ec_codec_dmic_get_gain_idx {
+ uint8_t channel; /* enum ec_codec_dmic_channel */
+ uint8_t reserved[3];
+};
+
struct __ec_align4 ec_param_ec_codec_dmic {
uint8_t cmd; /* enum ec_codec_dmic_subcmd */
uint8_t reserved[3];
union {
- struct ec_param_ec_codec_dmic_set_gain
- set_gain_param;
+ struct ec_param_ec_codec_dmic_set_gain_idx
+ set_gain_idx_param;
+ struct ec_param_ec_codec_dmic_get_gain_idx
+ get_gain_idx_param;
};
};
-struct __ec_align1 ec_response_ec_codec_dmic_get_gain {
- uint8_t left;
- uint8_t right;
+struct __ec_align1 ec_response_ec_codec_dmic_get_max_gain {
+ uint8_t max_gain;
+};
+
+struct __ec_align1 ec_response_ec_codec_dmic_get_gain_idx {
+ uint8_t gain;
};
/*****************************************************************************/