asoc: codecs: bolero: Update mixing path and channel mask for RX path

RX_CDC_DMA_RX0/1/2/3 ports  drives RX0/RX1, RX2/RX3, RX4 and RX5
channels on bolero rx-macro. Update channel mask
as per these mapping and return to channel map
accordingly.

Change-Id: I2e66e601b5137ebc513527827332bbb7cde0acb3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
此提交包含在:
Laxminath Kasam
2019-08-09 21:47:33 +05:30
父節點 52ae6581d7
當前提交 f8adb5f3c3
共有 2 個檔案被更改,包括 56 行新增15 行删除

查看文件

@@ -54,6 +54,7 @@
#define WSA_MACRO_EC_MIX_TX0_MASK 0x03
#define WSA_MACRO_EC_MIX_TX1_MASK 0x18
#define WSA_MACRO_MAX_DMA_CH_PER_PORT 0x2
enum {
WSA_MACRO_RX0 = 0,
@@ -98,6 +99,14 @@ enum {
INTn_1_INP_SEL_DEC1,
};
enum {
INTn_2_INP_SEL_ZERO = 0,
INTn_2_INP_SEL_RX0,
INTn_2_INP_SEL_RX1,
INTn_2_INP_SEL_RX2,
INTn_2_INP_SEL_RX3,
};
struct interp_sample_rate {
int sample_rate;
int rate_val;
@@ -614,9 +623,9 @@ static int wsa_macro_set_prim_interpolator_rate(struct snd_soc_dai *dai,
inp2_sel = (int_mux_cfg1_val >>
WSA_MACRO_MUX_INP_SHFT) &
WSA_MACRO_MUX_INP_MASK2;
if ((inp0_sel == int_1_mix1_inp) ||
(inp1_sel == int_1_mix1_inp) ||
(inp2_sel == int_1_mix1_inp)) {
if ((inp0_sel == int_1_mix1_inp + INTn_1_INP_SEL_RX0) ||
(inp1_sel == int_1_mix1_inp + INTn_1_INP_SEL_RX0) ||
(inp2_sel == int_1_mix1_inp + INTn_1_INP_SEL_RX0)) {
int_fs_reg = BOLERO_CDC_WSA_RX0_RX_PATH_CTL +
WSA_MACRO_RX_PATH_OFFSET * j;
dev_dbg(wsa_dev,
@@ -670,7 +679,8 @@ static int wsa_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai,
int_mux_cfg1_val = snd_soc_component_read32(component,
int_mux_cfg1) &
WSA_MACRO_MUX_INP_MASK1;
if (int_mux_cfg1_val == int_2_inp) {
if (int_mux_cfg1_val == int_2_inp +
INTn_2_INP_SEL_RX0) {
int_fs_reg =
BOLERO_CDC_WSA_RX0_RX_PATH_MIX_CTL +
WSA_MACRO_RX_PATH_OFFSET * j;
@@ -766,7 +776,7 @@ static int wsa_macro_get_channel_map(struct snd_soc_dai *dai,
struct snd_soc_component *component = dai->component;
struct device *wsa_dev = NULL;
struct wsa_macro_priv *wsa_priv = NULL;
u16 val = 0, mask = 0, cnt = 0;
u16 val = 0, mask = 0, cnt = 0, temp = 0;
if (!wsa_macro_get_data(component, &wsa_dev, &wsa_priv, __func__))
return -EINVAL;
@@ -782,8 +792,16 @@ static int wsa_macro_get_channel_map(struct snd_soc_dai *dai,
break;
case WSA_MACRO_AIF1_PB:
case WSA_MACRO_AIF_MIX1_PB:
*rx_slot = wsa_priv->active_ch_mask[dai->id];
*rx_num = wsa_priv->active_ch_cnt[dai->id];
for_each_set_bit(temp, &wsa_priv->active_ch_mask[dai->id],
WSA_MACRO_RX_MAX) {
mask |= (1 << temp);
if (++cnt == WSA_MACRO_MAX_DMA_CH_PER_PORT)
break;
}
if (mask & 0x0C)
mask = mask >> 0x2;
*rx_slot = mask;
*rx_num = cnt;
break;
case WSA_MACRO_AIF_ECHO:
val = snd_soc_component_read32(component,
@@ -842,9 +860,12 @@ static int wsa_macro_digital_mute(struct snd_soc_dai *dai, int mute)
if (int_mux_cfg0_val || (int_mux_cfg1_val & 0x38))
snd_soc_component_update_bits(component, reg,
0x20, 0x20);
if (int_mux_cfg1_val & 0x07)
if (int_mux_cfg1_val & 0x07) {
snd_soc_component_update_bits(component, reg,
0x20, 0x20);
snd_soc_component_update_bits(component,
mix_reg, 0x20, 0x20);
}
}
}
break;
@@ -2179,8 +2200,6 @@ static int wsa_macro_rx_mux_put(struct snd_kcontrol *kcontrol,
wsa_priv->rx_port_value[widget->shift] = rx_port_value;
bit_input = widget->shift;
if (widget->shift >= WSA_MACRO_RX_MIX)
bit_input %= WSA_MACRO_RX_MIX;
dev_dbg(wsa_dev,
"%s: mux input: %d, mux output: %d, bit: %d\n",