ASoC: cros_ec_codec: read max DMIC gain from EC codec
Read max DMIC gain from EC codec instead of DTS. Also removes the dt-binding of max-dmic-gain. Acked-by: Rob Herring <robh@kernel.org> Acked-by: Benson Leung <bleung@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20191017213539.05.Id4657c864d544634f2b5c1c9b34fa8232ecba44d@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
104c6f8f7f
commit
f3e82ad43c
3 changed files with 73 additions and 27 deletions
|
|
@ -4530,30 +4530,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;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue