|
@@ -356,7 +356,7 @@ static int lpass_cdc_rx_macro_hw_params(struct snd_pcm_substream *substream,
|
|
|
static int lpass_cdc_rx_macro_get_channel_map(struct snd_soc_dai *dai,
|
|
|
unsigned int *tx_num, unsigned int *tx_slot,
|
|
|
unsigned int *rx_num, unsigned int *rx_slot);
|
|
|
-static int lpass_cdc_rx_macro_digital_mute(struct snd_soc_dai *dai, int mute);
|
|
|
+static int lpass_cdc_rx_macro_mute_stream(struct snd_soc_dai *dai, int mute, int stream);
|
|
|
static int lpass_cdc_rx_macro_int_dem_inp_mux_put(struct snd_kcontrol *kcontrol,
|
|
|
struct snd_ctl_elem_value *ucontrol);
|
|
|
static int lpass_cdc_rx_macro_mux_get(struct snd_kcontrol *kcontrol,
|
|
@@ -653,7 +653,7 @@ static const struct snd_kcontrol_new rx_mix_tx0_mux =
|
|
|
static struct snd_soc_dai_ops lpass_cdc_rx_macro_dai_ops = {
|
|
|
.hw_params = lpass_cdc_rx_macro_hw_params,
|
|
|
.get_channel_map = lpass_cdc_rx_macro_get_channel_map,
|
|
|
- .digital_mute = lpass_cdc_rx_macro_digital_mute,
|
|
|
+ .mute_stream = lpass_cdc_rx_macro_mute_stream,
|
|
|
};
|
|
|
|
|
|
static struct snd_soc_dai_driver lpass_cdc_rx_macro_dai[] = {
|
|
@@ -952,9 +952,9 @@ static int lpass_cdc_rx_macro_set_prim_interpolator_rate(struct snd_soc_dai *dai
|
|
|
for (j = 0; j < INTERP_MAX; j++) {
|
|
|
int_mux_cfg1 = int_mux_cfg0 + 4;
|
|
|
|
|
|
- int_mux_cfg0_val = snd_soc_component_read32(
|
|
|
+ int_mux_cfg0_val = snd_soc_component_read(
|
|
|
component, int_mux_cfg0);
|
|
|
- int_mux_cfg1_val = snd_soc_component_read32(
|
|
|
+ int_mux_cfg1_val = snd_soc_component_read(
|
|
|
component, int_mux_cfg1);
|
|
|
inp0_sel = int_mux_cfg0_val & 0x0F;
|
|
|
inp1_sel = (int_mux_cfg0_val >> 4) & 0x0F;
|
|
@@ -1007,7 +1007,7 @@ static int lpass_cdc_rx_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai,
|
|
|
|
|
|
int_mux_cfg1 = LPASS_CDC_RX_INP_MUX_RX_INT0_CFG1;
|
|
|
for (j = 0; j < INTERP_MAX; j++) {
|
|
|
- int_mux_cfg1_val = snd_soc_component_read32(
|
|
|
+ int_mux_cfg1_val = snd_soc_component_read(
|
|
|
component, int_mux_cfg1) &
|
|
|
0x0F;
|
|
|
if (int_mux_cfg1_val == int_2_inp +
|
|
@@ -1175,7 +1175,7 @@ static int lpass_cdc_rx_macro_get_channel_map(struct snd_soc_dai *dai,
|
|
|
__func__, dai->id, *rx_slot, *rx_num);
|
|
|
break;
|
|
|
case RX_MACRO_AIF_ECHO:
|
|
|
- val = snd_soc_component_read32(component,
|
|
|
+ val = snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_INP_MUX_RX_MIX_CFG4);
|
|
|
if (val & LPASS_CDC_RX_MACRO_EC_MIX_TX0_MASK) {
|
|
|
mask |= 0x1;
|
|
@@ -1185,7 +1185,7 @@ static int lpass_cdc_rx_macro_get_channel_map(struct snd_soc_dai *dai,
|
|
|
mask |= 0x2;
|
|
|
cnt++;
|
|
|
}
|
|
|
- val = snd_soc_component_read32(component,
|
|
|
+ val = snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_INP_MUX_RX_MIX_CFG5);
|
|
|
if (val & LPASS_CDC_RX_MACRO_EC_MIX_TX2_MASK) {
|
|
|
mask |= 0x4;
|
|
@@ -1201,7 +1201,7 @@ static int lpass_cdc_rx_macro_get_channel_map(struct snd_soc_dai *dai,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int lpass_cdc_rx_macro_digital_mute(struct snd_soc_dai *dai, int mute)
|
|
|
+static int lpass_cdc_rx_macro_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
|
|
|
{
|
|
|
struct snd_soc_component *component = dai->component;
|
|
|
struct device *rx_dev = NULL;
|
|
@@ -1232,11 +1232,11 @@ static int lpass_cdc_rx_macro_digital_mute(struct snd_soc_dai *dai, int mute)
|
|
|
dsm_reg = LPASS_CDC_RX_RX2_RX_PATH_DSM_CTL;
|
|
|
int_mux_cfg0 = LPASS_CDC_RX_INP_MUX_RX_INT0_CFG0 + j * 8;
|
|
|
int_mux_cfg1 = int_mux_cfg0 + 4;
|
|
|
- int_mux_cfg0_val = snd_soc_component_read32(component,
|
|
|
+ int_mux_cfg0_val = snd_soc_component_read(component,
|
|
|
int_mux_cfg0);
|
|
|
- int_mux_cfg1_val = snd_soc_component_read32(component,
|
|
|
+ int_mux_cfg1_val = snd_soc_component_read(component,
|
|
|
int_mux_cfg1);
|
|
|
- if (snd_soc_component_read32(component, dsm_reg) & 0x01) {
|
|
|
+ if (snd_soc_component_read(component, dsm_reg) & 0x01) {
|
|
|
if (int_mux_cfg0_val || (int_mux_cfg1_val & 0xF0))
|
|
|
snd_soc_component_update_bits(component,
|
|
|
reg, 0x20, 0x20);
|
|
@@ -1414,7 +1414,7 @@ static int lpass_cdc_rx_macro_event_handler(struct snd_soc_component *component,
|
|
|
reg = LPASS_CDC_RX_COMPANDER0_CTL0 +
|
|
|
(rx_idx * LPASS_CDC_RX_MACRO_COMP_OFFSET);
|
|
|
snd_soc_component_write(component, reg,
|
|
|
- snd_soc_component_read32(component, reg));
|
|
|
+ snd_soc_component_read(component, reg));
|
|
|
break;
|
|
|
case LPASS_CDC_MACRO_EVT_IMPED_TRUE:
|
|
|
lpass_cdc_rx_macro_wcd_clsh_imped_config(component, data, true);
|
|
@@ -1469,9 +1469,9 @@ static int lpass_cdc_rx_macro_event_handler(struct snd_soc_component *component,
|
|
|
lpass_cdc_rsc_clk_reset(rx_dev, RX_CORE_CLK);
|
|
|
break;
|
|
|
case LPASS_CDC_MACRO_EVT_RX_PA_GAIN_UPDATE:
|
|
|
- rx_priv->rx0_gain_val = snd_soc_component_read32(component,
|
|
|
+ rx_priv->rx0_gain_val = snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_RX0_RX_VOL_CTL);
|
|
|
- rx_priv->rx1_gain_val = snd_soc_component_read32(component,
|
|
|
+ rx_priv->rx1_gain_val = snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_RX1_RX_VOL_CTL);
|
|
|
if (data) {
|
|
|
/* Reduce gain by half only if its greater than -6DB */
|
|
@@ -1564,7 +1564,7 @@ static int lpass_cdc_rx_macro_set_idle_detect_thr(struct snd_soc_component *comp
|
|
|
if (path_type == INTERP_MIX_PATH) {
|
|
|
mux_reg = LPASS_CDC_RX_INP_MUX_RX_INT0_CFG1 +
|
|
|
2 * interp;
|
|
|
- mux_reg_val = snd_soc_component_read32(component, mux_reg) &
|
|
|
+ mux_reg_val = snd_soc_component_read(component, mux_reg) &
|
|
|
0x0f;
|
|
|
|
|
|
if ((mux_reg_val >= INTn_2_INP_SEL_RX0) &&
|
|
@@ -1577,7 +1577,7 @@ static int lpass_cdc_rx_macro_set_idle_detect_thr(struct snd_soc_component *comp
|
|
|
if (path_type == INTERP_MAIN_PATH) {
|
|
|
mux_reg = LPASS_CDC_RX_INP_MUX_RX_INT1_CFG0 +
|
|
|
2 * (interp - 1);
|
|
|
- mux_reg_val = snd_soc_component_read32(component, mux_reg) &
|
|
|
+ mux_reg_val = snd_soc_component_read(component, mux_reg) &
|
|
|
0x0f;
|
|
|
i = LPASS_CDC_RX_MACRO_INTERP_MUX_NUM_INPUTS;
|
|
|
|
|
@@ -1589,7 +1589,7 @@ static int lpass_cdc_rx_macro_set_idle_detect_thr(struct snd_soc_component *comp
|
|
|
num_ports++;
|
|
|
}
|
|
|
mux_reg_val =
|
|
|
- (snd_soc_component_read32(component, mux_reg) &
|
|
|
+ (snd_soc_component_read(component, mux_reg) &
|
|
|
0xf0) >> 4;
|
|
|
mux_reg += 1;
|
|
|
i--;
|
|
@@ -1675,7 +1675,7 @@ static int lpass_cdc_rx_macro_enable_mix_path(struct snd_soc_dapm_widget *w,
|
|
|
break;
|
|
|
case SND_SOC_DAPM_POST_PMU:
|
|
|
snd_soc_component_write(component, gain_reg,
|
|
|
- snd_soc_component_read32(component, gain_reg));
|
|
|
+ snd_soc_component_read(component, gain_reg));
|
|
|
break;
|
|
|
case SND_SOC_DAPM_POST_PMD:
|
|
|
/* Clk Disable */
|
|
@@ -1699,8 +1699,8 @@ static bool lpass_cdc_rx_macro_adie_lb(struct snd_soc_component *component,
|
|
|
|
|
|
int_mux_cfg0 = LPASS_CDC_RX_INP_MUX_RX_INT0_CFG0 + interp_idx * 8;
|
|
|
int_mux_cfg1 = int_mux_cfg0 + 4;
|
|
|
- int_mux_cfg0_val = snd_soc_component_read32(component, int_mux_cfg0);
|
|
|
- int_mux_cfg1_val = snd_soc_component_read32(component, int_mux_cfg1);
|
|
|
+ int_mux_cfg0_val = snd_soc_component_read(component, int_mux_cfg0);
|
|
|
+ int_mux_cfg1_val = snd_soc_component_read(component, int_mux_cfg1);
|
|
|
|
|
|
int_n_inp0 = int_mux_cfg0_val & 0x0F;
|
|
|
if (int_n_inp0 == INTn_1_INP_SEL_DEC0 ||
|
|
@@ -1764,7 +1764,7 @@ static int lpass_cdc_rx_macro_enable_main_path(struct snd_soc_dapm_widget *w,
|
|
|
break;
|
|
|
case SND_SOC_DAPM_POST_PMU:
|
|
|
snd_soc_component_write(component, gain_reg,
|
|
|
- snd_soc_component_read32(component, gain_reg));
|
|
|
+ snd_soc_component_read(component, gain_reg));
|
|
|
break;
|
|
|
case SND_SOC_DAPM_POST_PMD:
|
|
|
lpass_cdc_rx_macro_enable_interp_clk(component, event, w->shift);
|
|
@@ -1795,7 +1795,7 @@ static int lpass_cdc_rx_macro_config_compander(struct snd_soc_component *compone
|
|
|
(comp * LPASS_CDC_RX_MACRO_RX_PATH_OFFSET);
|
|
|
rx0_path_ctl_reg = LPASS_CDC_RX_RX0_RX_PATH_CTL +
|
|
|
(comp * LPASS_CDC_RX_MACRO_RX_PATH_OFFSET);
|
|
|
- pcm_rate = (snd_soc_component_read32(component, rx0_path_ctl_reg)
|
|
|
+ pcm_rate = (snd_soc_component_read(component, rx0_path_ctl_reg)
|
|
|
& 0x0F);
|
|
|
if (pcm_rate < 0x06)
|
|
|
val = 0x03;
|
|
@@ -2325,7 +2325,7 @@ static int lpass_cdc_rx_macro_vbat_bcl_gsm_mode_func_get(struct snd_kcontrol *kc
|
|
|
snd_soc_kcontrol_component(kcontrol);
|
|
|
|
|
|
ucontrol->value.integer.value[0] =
|
|
|
- ((snd_soc_component_read32(
|
|
|
+ ((snd_soc_component_read(
|
|
|
component, LPASS_CDC_RX_BCL_VBAT_CFG) & 0x04) ?
|
|
|
1 : 0);
|
|
|
|
|
@@ -2818,7 +2818,7 @@ static int lpass_cdc_rx_macro_iir_enable_audio_mixer_get(struct snd_kcontrol *kc
|
|
|
u16 iir_reg = LPASS_CDC_RX_SIDETONE_IIR0_IIR_CTL + 0x80 * iir_idx;
|
|
|
|
|
|
ucontrol->value.integer.value[0] = (
|
|
|
- snd_soc_component_read32(component, iir_reg) &
|
|
|
+ snd_soc_component_read(component, iir_reg) &
|
|
|
(1 << band_idx)) != 0;
|
|
|
|
|
|
dev_dbg(component->dev, "%s: IIR #%d band #%d enable %d\n", __func__,
|
|
@@ -2851,7 +2851,7 @@ static int lpass_cdc_rx_macro_iir_enable_audio_mixer_put(struct snd_kcontrol *kc
|
|
|
snd_soc_component_update_bits(component, iir_reg, (1 << band_idx),
|
|
|
(value << band_idx));
|
|
|
|
|
|
- iir_band_en_status = ((snd_soc_component_read32(component, iir_reg) &
|
|
|
+ iir_band_en_status = ((snd_soc_component_read(component, iir_reg) &
|
|
|
(1 << band_idx)) != 0);
|
|
|
dev_dbg(component->dev, "%s: IIR #%d band #%d enable %d\n", __func__,
|
|
|
iir_idx, band_idx, iir_band_en_status);
|
|
@@ -2870,7 +2870,7 @@ static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
|
|
|
((band_idx * BAND_MAX + coeff_idx)
|
|
|
* sizeof(uint32_t)) & 0x7F);
|
|
|
|
|
|
- value |= snd_soc_component_read32(component,
|
|
|
+ value |= snd_soc_component_read(component,
|
|
|
(LPASS_CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL + 0x80 * iir_idx));
|
|
|
|
|
|
snd_soc_component_write(component,
|
|
@@ -2878,7 +2878,7 @@ static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
|
|
|
((band_idx * BAND_MAX + coeff_idx)
|
|
|
* sizeof(uint32_t) + 1) & 0x7F);
|
|
|
|
|
|
- value |= (snd_soc_component_read32(component,
|
|
|
+ value |= (snd_soc_component_read(component,
|
|
|
(LPASS_CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL +
|
|
|
0x80 * iir_idx)) << 8);
|
|
|
|
|
@@ -2887,7 +2887,7 @@ static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
|
|
|
((band_idx * BAND_MAX + coeff_idx)
|
|
|
* sizeof(uint32_t) + 2) & 0x7F);
|
|
|
|
|
|
- value |= (snd_soc_component_read32(component,
|
|
|
+ value |= (snd_soc_component_read(component,
|
|
|
(LPASS_CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL +
|
|
|
0x80 * iir_idx)) << 16);
|
|
|
|
|
@@ -2897,7 +2897,7 @@ static uint32_t get_iir_band_coeff(struct snd_soc_component *component,
|
|
|
* sizeof(uint32_t) + 3) & 0x7F);
|
|
|
|
|
|
/* Mask bits top 2 bits since they are reserved */
|
|
|
- value |= ((snd_soc_component_read32(component,
|
|
|
+ value |= ((snd_soc_component_read(component,
|
|
|
(LPASS_CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL +
|
|
|
16 * iir_idx)) & 0x3F) << 24);
|
|
|
|
|
@@ -3039,36 +3039,36 @@ static int lpass_cdc_rx_macro_set_iir_gain(struct snd_soc_dapm_widget *w,
|
|
|
if (strnstr(w->name, "IIR0", sizeof("IIR0"))) {
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B1_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B1_CTL));
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B2_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B2_CTL));
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B3_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B3_CTL));
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B4_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B4_CTL));
|
|
|
} else {
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B1_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B1_CTL));
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B2_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B2_CTL));
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B3_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B3_CTL));
|
|
|
snd_soc_component_write(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B4_CTL,
|
|
|
- snd_soc_component_read32(component,
|
|
|
+ snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B4_CTL));
|
|
|
}
|
|
|
break;
|
|
@@ -3227,14 +3227,14 @@ static int lpass_cdc_rx_macro_enable_echo(struct snd_soc_dapm_widget *w,
|
|
|
|
|
|
dev_dbg(rx_dev, "%s %d %s\n", __func__, event, w->name);
|
|
|
|
|
|
- val = snd_soc_component_read32(component,
|
|
|
+ val = snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_INP_MUX_RX_MIX_CFG4);
|
|
|
if (!(strcmp(w->name, "RX MIX TX0 MUX")))
|
|
|
ec_tx = ((val & 0xf0) >> 0x4) - 1;
|
|
|
else if (!(strcmp(w->name, "RX MIX TX1 MUX")))
|
|
|
ec_tx = (val & 0x0f) - 1;
|
|
|
|
|
|
- val = snd_soc_component_read32(component,
|
|
|
+ val = snd_soc_component_read(component,
|
|
|
LPASS_CDC_RX_INP_MUX_RX_MIX_CFG5);
|
|
|
if (!(strcmp(w->name, "RX MIX TX2 MUX")))
|
|
|
ec_tx = (val & 0x0f) - 1;
|