From a3d8911945887149a8cc12031b53b3370dadb5ae Mon Sep 17 00:00:00 2001 From: Jyotirmoi Sarma Date: Thu, 26 Nov 2020 14:43:13 +0530 Subject: [PATCH] audio-kernel: asoc : Upgrade asoc to support 5.10 kernel Change-Id: Ia54112cfbde418d66b9314d4ba731928aa057558 Signed-off-by: Jyotirmoi Sarma --- asoc/Kbuild | 18 ++++--- asoc/codecs/Kbuild | 10 ++-- asoc/codecs/bolero/Kbuild | 12 ++--- asoc/codecs/bolero/bolero-cdc.c | 4 +- asoc/codecs/bolero/rx-macro.c | 78 +++++++++++++++--------------- asoc/codecs/bolero/tx-macro.c | 20 ++++---- asoc/codecs/bolero/va-macro.c | 14 +++--- asoc/codecs/bolero/wsa-macro.c | 42 ++++++++-------- asoc/codecs/swr-dmic.c | 2 +- asoc/codecs/wcd937x/Kbuild | 11 ++--- asoc/codecs/wcd937x/wcd937x-mbhc.c | 26 +++++----- asoc/codecs/wcd937x/wcd937x.c | 12 ++--- asoc/codecs/wcd938x/Kbuild | 11 ++--- asoc/codecs/wcd938x/wcd938x-mbhc.c | 26 +++++----- asoc/codecs/wcd938x/wcd938x.c | 20 ++++---- asoc/codecs/wcdcal-hwdep.c | 2 +- asoc/codecs/wsa883x/Kbuild | 12 ++--- asoc/codecs/wsa883x/wsa883x.c | 16 +++--- asoc/msm_common.c | 2 +- include/asoc/wcd-mbhc-v2.h | 2 +- include/asoc/wcdcal-hwdep.h | 2 +- 21 files changed, 166 insertions(+), 176 deletions(-) diff --git a/asoc/Kbuild b/asoc/Kbuild index bbeac34983..223301bb77 100644 --- a/asoc/Kbuild +++ b/asoc/Kbuild @@ -57,6 +57,10 @@ ifeq ($(KERNEL_BUILD), 0) include $(AUDIO_ROOT)/config/konaauto.conf INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h endif + ifeq ($(CONFIG_ARCH_WAIPIO), y) + include $(AUDIO_ROOT)/config/waipioauto.conf + INCS += -include $(AUDIO_ROOT)/config/waipioautoconf.h + endif ifeq ($(CONFIG_ARCH_LITO), y) include $(AUDIO_ROOT)/config/litoauto.conf export @@ -156,6 +160,11 @@ ifdef CONFIG_SND_SOC_LAHAINA MACHINE_OBJS += lahaina.o endif +# for WAIPIO sound card driver +ifdef CONFIG_SND_SOC_WAIPIO + MACHINE_OBJS += waipio.o +endif + # for HOLI sound card driver ifdef CONFIG_SND_SOC_HOLI MACHINE_OBJS += holi.o @@ -215,12 +224,6 @@ ifeq ($(call cc-option-yn, -Wheader-guard),y) EXTRA_CFLAGS += -Wheader-guard endif -ifeq ($(KERNEL_BUILD), 0) -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd937x/Module.symvers -endif ifeq ($(KERNEL_BUILD), 1) obj-y += codecs/ endif @@ -246,6 +249,9 @@ machine_dlkm-y := $(MACHINE_OBJS) obj-$(CONFIG_SND_SOC_LAHAINA) += machine_dlkm.o machine_dlkm-y := $(MACHINE_OBJS) +obj-$(CONFIG_SND_SOC_WAIPIO) += machine_dlkm.o +machine_dlkm-y := $(MACHINE_OBJS) + obj-$(CONFIG_SND_SOC_HOLI) += machine_dlkm.o machine_dlkm-y := $(MACHINE_OBJS) diff --git a/asoc/codecs/Kbuild b/asoc/codecs/Kbuild index 2408d0d6d8..f16f290df4 100644 --- a/asoc/codecs/Kbuild +++ b/asoc/codecs/Kbuild @@ -57,6 +57,10 @@ ifeq ($(KERNEL_BUILD), 0) include $(AUDIO_ROOT)/config/konaauto.conf INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h endif + ifeq ($(CONFIG_ARCH_WAIPIO), y) + include $(AUDIO_ROOT)/config/waipioauto.conf + INCS += -include $(AUDIO_ROOT)/config/waipioautoconf.h + endif ifeq ($(CONFIG_ARCH_LITO), y) include $(AUDIO_ROOT)/config/litoauto.conf export @@ -245,12 +249,6 @@ ifeq ($(call cc-option-yn, -Wheader-guard),y) EXTRA_CFLAGS += -Wheader-guard endif - -ifeq ($(KERNEL_BUILD), 0) -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers -endif - ifeq ($(KERNEL_BUILD), 1) obj-y += wcd934x/ obj-y += wcd937x/ diff --git a/asoc/codecs/bolero/Kbuild b/asoc/codecs/bolero/Kbuild index a6a11c1a0e..522816ba2c 100644 --- a/asoc/codecs/bolero/Kbuild +++ b/asoc/codecs/bolero/Kbuild @@ -30,6 +30,10 @@ ifeq ($(KERNEL_BUILD), 0) include $(AUDIO_ROOT)/config/konaauto.conf INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h endif + ifeq ($(CONFIG_ARCH_WAIPIO), y) + include $(AUDIO_ROOT)/config/waipioauto.conf + INCS += -include $(AUDIO_ROOT)/config/waipioautoconf.h + endif ifeq ($(CONFIG_ARCH_LITO), y) include $(AUDIO_ROOT)/config/litoauto.conf export @@ -131,14 +135,6 @@ ifeq ($(call cc-option-yn, -Wheader-guard),y) EXTRA_CFLAGS += -Wheader-guard endif -ifeq ($(KERNEL_BUILD), 0) -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers -endif - # Module information used by KBuild framework obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o bolero_cdc_dlkm-y := $(BOLERO_OBJS) diff --git a/asoc/codecs/bolero/bolero-cdc.c b/asoc/codecs/bolero/bolero-cdc.c index d6af655500..6801343327 100644 --- a/asoc/codecs/bolero/bolero-cdc.c +++ b/asoc/codecs/bolero/bolero-cdc.c @@ -1196,9 +1196,9 @@ static int bolero_soc_codec_probe(struct snd_soc_component *component) } /* Assign bolero version */ - core_id_0 = snd_soc_component_read32(component, + core_id_0 = snd_soc_component_read(component, BOLERO_CDC_VA_TOP_CSR_CORE_ID_0); - core_id_1 = snd_soc_component_read32(component, + core_id_1 = snd_soc_component_read(component, BOLERO_CDC_VA_TOP_CSR_CORE_ID_1); if ((core_id_0 == 0x01) && (core_id_1 == 0x0F)) priv->version = BOLERO_VERSION_2_0; diff --git a/asoc/codecs/bolero/rx-macro.c b/asoc/codecs/bolero/rx-macro.c index dda2233733..3cf15764a6 100644 --- a/asoc/codecs/bolero/rx-macro.c +++ b/asoc/codecs/bolero/rx-macro.c @@ -358,7 +358,7 @@ static int rx_macro_hw_params(struct snd_pcm_substream *substream, static int 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 rx_macro_digital_mute(struct snd_soc_dai *dai, int mute); +static int rx_macro_mute_stream(struct snd_soc_dai *dai, int mute, int stream); static int rx_macro_int_dem_inp_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); static int rx_macro_mux_get(struct snd_kcontrol *kcontrol, @@ -654,7 +654,7 @@ static const struct snd_kcontrol_new rx_mix_tx0_mux = static struct snd_soc_dai_ops rx_macro_dai_ops = { .hw_params = rx_macro_hw_params, .get_channel_map = rx_macro_get_channel_map, - .digital_mute = rx_macro_digital_mute, + .mute_stream = rx_macro_mute_stream, }; static struct snd_soc_dai_driver rx_macro_dai[] = { @@ -953,9 +953,9 @@ static int 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; @@ -1008,7 +1008,7 @@ static int rx_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai, int_mux_cfg1 = BOLERO_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 + @@ -1176,7 +1176,7 @@ static int 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, BOLERO_CDC_RX_INP_MUX_RX_MIX_CFG4); if (val & RX_MACRO_EC_MIX_TX0_MASK) { mask |= 0x1; @@ -1186,7 +1186,7 @@ static int 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, BOLERO_CDC_RX_INP_MUX_RX_MIX_CFG5); if (val & RX_MACRO_EC_MIX_TX2_MASK) { mask |= 0x4; @@ -1202,7 +1202,7 @@ static int rx_macro_get_channel_map(struct snd_soc_dai *dai, return 0; } -static int rx_macro_digital_mute(struct snd_soc_dai *dai, int mute) +static int 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; @@ -1233,11 +1233,11 @@ static int rx_macro_digital_mute(struct snd_soc_dai *dai, int mute) dsm_reg = BOLERO_CDC_RX_RX2_RX_PATH_DSM_CTL; int_mux_cfg0 = BOLERO_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); @@ -1416,7 +1416,7 @@ static int rx_macro_event_handler(struct snd_soc_component *component, reg = BOLERO_CDC_RX_COMPANDER0_CTL0 + (rx_idx * RX_MACRO_COMP_OFFSET); snd_soc_component_write(component, reg, - snd_soc_component_read32(component, reg)); + snd_soc_component_read(component, reg)); break; case BOLERO_MACRO_EVT_IMPED_TRUE: rx_macro_wcd_clsh_imped_config(component, data, true); @@ -1474,9 +1474,9 @@ static int rx_macro_event_handler(struct snd_soc_component *component, bolero_rsc_clk_reset(rx_dev, RX_CORE_CLK); break; case BOLERO_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, BOLERO_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, BOLERO_CDC_RX_RX1_RX_VOL_CTL); if (data) { /* Reduce gain by half only if its greater than -6DB */ @@ -1569,7 +1569,7 @@ static int rx_macro_set_idle_detect_thr(struct snd_soc_component *component, if (path_type == INTERP_MIX_PATH) { mux_reg = BOLERO_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) && @@ -1582,7 +1582,7 @@ static int rx_macro_set_idle_detect_thr(struct snd_soc_component *component, if (path_type == INTERP_MAIN_PATH) { mux_reg = BOLERO_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 = RX_MACRO_INTERP_MUX_NUM_INPUTS; @@ -1594,7 +1594,7 @@ static int rx_macro_set_idle_detect_thr(struct snd_soc_component *component, 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--; @@ -1680,7 +1680,7 @@ static int 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 */ @@ -1704,8 +1704,8 @@ static bool rx_macro_adie_lb(struct snd_soc_component *component, int_mux_cfg0 = BOLERO_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 || @@ -1769,7 +1769,7 @@ static int 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: rx_macro_enable_interp_clk(component, event, w->shift); @@ -1800,7 +1800,7 @@ static int rx_macro_config_compander(struct snd_soc_component *component, (comp * RX_MACRO_RX_PATH_OFFSET); rx0_path_ctl_reg = BOLERO_CDC_RX_RX0_RX_PATH_CTL + (comp * 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 rx_macro_vbat_bcl_gsm_mode_func_get(struct snd_kcontrol *kcontrol, snd_soc_kcontrol_component(kcontrol); ucontrol->value.integer.value[0] = - ((snd_soc_component_read32( + ((snd_soc_component_read( component, BOLERO_CDC_RX_BCL_VBAT_CFG) & 0x04) ? 1 : 0); @@ -2818,7 +2818,7 @@ static int rx_macro_iir_enable_audio_mixer_get(struct snd_kcontrol *kcontrol, u16 iir_reg = BOLERO_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 rx_macro_iir_enable_audio_mixer_put(struct snd_kcontrol *kcontrol, 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, (BOLERO_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, (BOLERO_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, (BOLERO_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, (BOLERO_CDC_RX_SIDETONE_IIR0_IIR_COEF_B2_CTL + 16 * iir_idx)) & 0x3F) << 24); @@ -3039,36 +3039,36 @@ static int rx_macro_set_iir_gain(struct snd_soc_dapm_widget *w, if (strnstr(w->name, "IIR0", sizeof("IIR0"))) { snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B1_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B1_CTL)); snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B2_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B2_CTL)); snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B3_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B3_CTL)); snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B4_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR0_IIR_GAIN_B4_CTL)); } else { snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B1_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B1_CTL)); snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B2_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B2_CTL)); snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B3_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B3_CTL)); snd_soc_component_write(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B4_CTL, - snd_soc_component_read32(component, + snd_soc_component_read(component, BOLERO_CDC_RX_SIDETONE_IIR1_IIR_GAIN_B4_CTL)); } break; @@ -3227,14 +3227,14 @@ static int 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, BOLERO_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, BOLERO_CDC_RX_INP_MUX_RX_MIX_CFG5); if (!(strcmp(w->name, "RX MIX TX2 MUX"))) ec_tx = (val & 0x0f) - 1; diff --git a/asoc/codecs/bolero/tx-macro.c b/asoc/codecs/bolero/tx-macro.c index d882aba6c3..69d5a11a47 100644 --- a/asoc/codecs/bolero/tx-macro.c +++ b/asoc/codecs/bolero/tx-macro.c @@ -494,12 +494,12 @@ static bool is_amic_enabled(struct snd_soc_component *component, int decimator) adc_mux_reg = BOLERO_CDC_TX_INP_MUX_ADC_MUX0_CFG1 + TX_MACRO_ADC_MUX_CFG_OFFSET * decimator; - if (snd_soc_component_read32(component, adc_mux_reg) & SWR_MIC) { + if (snd_soc_component_read(component, adc_mux_reg) & SWR_MIC) { if (tx_priv->version == BOLERO_VERSION_2_1) return true; adc_reg = BOLERO_CDC_TX_INP_MUX_ADC_MUX0_CFG0 + TX_MACRO_ADC_MUX_CFG_OFFSET * decimator; - adc_n = snd_soc_component_read32(component, adc_reg) & + adc_n = snd_soc_component_read(component, adc_reg) & TX_MACRO_SWR_MIC_MUX_SEL_MASK; if (adc_n < BOLERO_ADC_MAX) return true; @@ -535,7 +535,7 @@ static void tx_macro_tx_hpf_corner_freq_callback(struct work_struct *work) if (is_amic_enabled(component, hpf_work->decimator)) { adc_reg = BOLERO_CDC_TX_INP_MUX_ADC_MUX0_CFG0 + TX_MACRO_ADC_MUX_CFG_OFFSET * hpf_work->decimator; - adc_n = snd_soc_component_read32(component, adc_reg) & + adc_n = snd_soc_component_read(component, adc_reg) & TX_MACRO_SWR_MIC_MUX_SEL_MASK; /* analog mic clear TX hold */ bolero_clear_amic_tx_hold(component->dev, adc_n); @@ -948,10 +948,10 @@ static int tx_macro_get_bcs_ch_sel(struct snd_kcontrol *kcontrol, return -EINVAL; if (tx_priv->version == BOLERO_VERSION_2_1) - value = (snd_soc_component_read32(component, + value = (snd_soc_component_read(component, BOLERO_CDC_VA_TOP_CSR_SWR_CTRL)) & 0x0F; else if (tx_priv->version == BOLERO_VERSION_2_0) - value = (snd_soc_component_read32(component, + value = (snd_soc_component_read(component, BOLERO_CDC_TX_TOP_CSR_SWR_CTRL)) & 0x0F; ucontrol->value.integer.value[0] = value; @@ -1061,7 +1061,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, tx_fs_reg = BOLERO_CDC_TX0_TX_PATH_CTL + TX_MACRO_TX_PATH_OFFSET * decimator; - tx_priv->amic_sample_rate = (snd_soc_component_read32(component, + tx_priv->amic_sample_rate = (snd_soc_component_read(component, tx_fs_reg) & 0x0F); switch (event) { @@ -1085,7 +1085,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, usleep_range(1000, 1010); } hpf_cut_off_freq = ( - snd_soc_component_read32(component, dec_cfg_reg) & + snd_soc_component_read(component, dec_cfg_reg) & TX_HPF_CUT_OFF_FREQ_MASK) >> 5; tx_priv->tx_hpf_work[decimator].hpf_cut_off_freq = @@ -1125,7 +1125,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, } /* apply gain after decimator is enabled */ snd_soc_component_write(component, tx_gain_ctl_reg, - snd_soc_component_read32(component, + snd_soc_component_read(component, tx_gain_ctl_reg)); if (tx_priv->bcs_enable) { if (tx_priv->version == BOLERO_VERSION_2_1) @@ -1146,7 +1146,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, 0x40); } if (tx_priv->version == BOLERO_VERSION_2_0) { - if (snd_soc_component_read32(component, adc_mux_reg) + if (snd_soc_component_read(component, adc_mux_reg) & SWR_MIC) { snd_soc_component_update_bits(component, BOLERO_CDC_TX_TOP_CSR_SWR_CTRL, @@ -1207,7 +1207,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, &tx_priv->tx_mute_dwork[decimator].dwork); if (tx_priv->version == BOLERO_VERSION_2_0) { - if (snd_soc_component_read32(component, adc_mux_reg) + if (snd_soc_component_read(component, adc_mux_reg) & SWR_MIC) snd_soc_component_update_bits(component, BOLERO_CDC_TX_TOP_CSR_SWR_CTRL, diff --git a/asoc/codecs/bolero/va-macro.c b/asoc/codecs/bolero/va-macro.c index 32c180ba62..af7b976c5c 100644 --- a/asoc/codecs/bolero/va-macro.c +++ b/asoc/codecs/bolero/va-macro.c @@ -838,12 +838,12 @@ static bool is_amic_enabled(struct snd_soc_component *component, int decimator) adc_mux_reg = BOLERO_CDC_VA_INP_MUX_ADC_MUX0_CFG1 + VA_MACRO_ADC_MUX_CFG_OFFSET * decimator; - if (snd_soc_component_read32(component, adc_mux_reg) & SWR_MIC) { + if (snd_soc_component_read(component, adc_mux_reg) & SWR_MIC) { if (va_priv->version == BOLERO_VERSION_2_1) return true; adc_reg = BOLERO_CDC_VA_INP_MUX_ADC_MUX0_CFG0 + VA_MACRO_ADC_MUX_CFG_OFFSET * decimator; - adc_n = snd_soc_component_read32(component, adc_reg) & + adc_n = snd_soc_component_read(component, adc_reg) & VA_MACRO_SWR_MIC_MUX_SEL_MASK; if (adc_n < BOLERO_ADC_MAX) return true; @@ -879,7 +879,7 @@ static void va_macro_tx_hpf_corner_freq_callback(struct work_struct *work) if (is_amic_enabled(component, hpf_work->decimator)) { adc_reg = BOLERO_CDC_VA_INP_MUX_ADC_MUX0_CFG0 + VA_MACRO_ADC_MUX_CFG_OFFSET * hpf_work->decimator; - adc_n = snd_soc_component_read32(component, adc_reg) & + adc_n = snd_soc_component_read(component, adc_reg) & VA_MACRO_SWR_MIC_MUX_SEL_MASK; /* analog mic clear TX hold */ bolero_clear_amic_tx_hold(component->dev, adc_n); @@ -1188,7 +1188,7 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w, */ usleep_range(1000, 1010); } - hpf_cut_off_freq = (snd_soc_component_read32( + hpf_cut_off_freq = (snd_soc_component_read( component, dec_cfg_reg) & TX_HPF_CUT_OFF_FREQ_MASK) >> 5; va_priv->va_hpf_work[decimator].hpf_cut_off_freq = @@ -1231,9 +1231,9 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w, msecs_to_jiffies(hpf_delay)); /* apply gain after decimator is enabled */ snd_soc_component_write(component, tx_gain_ctl_reg, - snd_soc_component_read32(component, tx_gain_ctl_reg)); + snd_soc_component_read(component, tx_gain_ctl_reg)); if (va_priv->version == BOLERO_VERSION_2_0) { - if (snd_soc_component_read32(component, adc_mux_reg) + if (snd_soc_component_read(component, adc_mux_reg) & SWR_MIC) { snd_soc_component_update_bits(component, BOLERO_CDC_TX_TOP_CSR_SWR_CTRL, @@ -1292,7 +1292,7 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w, cancel_delayed_work_sync( &va_priv->va_mute_dwork[decimator].dwork); if (va_priv->version == BOLERO_VERSION_2_0) { - if (snd_soc_component_read32(component, adc_mux_reg) + if (snd_soc_component_read(component, adc_mux_reg) & SWR_MIC) snd_soc_component_update_bits(component, BOLERO_CDC_TX_TOP_CSR_SWR_CTRL, diff --git a/asoc/codecs/bolero/wsa-macro.c b/asoc/codecs/bolero/wsa-macro.c index f689d3cea5..5699570ef2 100644 --- a/asoc/codecs/bolero/wsa-macro.c +++ b/asoc/codecs/bolero/wsa-macro.c @@ -148,7 +148,7 @@ static int wsa_macro_hw_params(struct snd_pcm_substream *substream, static int wsa_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 wsa_macro_digital_mute(struct snd_soc_dai *dai, int mute); +static int wsa_macro_mute_stream(struct snd_soc_dai *dai, int mute, int stream); /* Hold instance to soundwire platform device */ struct wsa_macro_swr_ctrl_data { struct platform_device *wsa_swr_pdev; @@ -378,7 +378,7 @@ static const struct snd_kcontrol_new rx_mix_ec1_mux = static struct snd_soc_dai_ops wsa_macro_dai_ops = { .hw_params = wsa_macro_hw_params, .get_channel_map = wsa_macro_get_channel_map, - .digital_mute = wsa_macro_digital_mute, + .mute_stream = wsa_macro_mute_stream, }; static struct snd_soc_dai_driver wsa_macro_dai[] = { @@ -612,9 +612,9 @@ static int wsa_macro_set_prim_interpolator_rate(struct snd_soc_dai *dai, for (j = 0; j < NUM_INTERPOLATORS; j++) { int_mux_cfg1 = int_mux_cfg0 + WSA_MACRO_MUX_CFG1_OFFSET; - 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); inp0_sel = int_mux_cfg0_val & WSA_MACRO_MUX_INP_MASK1; inp1_sel = (int_mux_cfg0_val >> @@ -676,7 +676,7 @@ static int wsa_macro_set_mix_interpolator_rate(struct snd_soc_dai *dai, int_mux_cfg1 = BOLERO_CDC_WSA_RX_INP_MUX_RX_INT0_CFG1; for (j = 0; j < NUM_INTERPOLATORS; j++) { - int_mux_cfg1_val = snd_soc_component_read32(component, + int_mux_cfg1_val = snd_soc_component_read(component, int_mux_cfg1) & WSA_MACRO_MUX_INP_MASK1; if (int_mux_cfg1_val == int_2_inp + @@ -815,7 +815,7 @@ static int wsa_macro_get_channel_map(struct snd_soc_dai *dai, *rx_num = cnt; break; case WSA_MACRO_AIF_ECHO: - val = snd_soc_component_read32(component, + val = snd_soc_component_read(component, BOLERO_CDC_WSA_RX_INP_MUX_RX_MIX_CFG0); if (val & WSA_MACRO_EC_MIX_TX1_MASK) { mask |= 0x2; @@ -835,7 +835,7 @@ static int wsa_macro_get_channel_map(struct snd_soc_dai *dai, return 0; } -static int wsa_macro_digital_mute(struct snd_soc_dai *dai, int mute) +static int wsa_macro_mute_stream(struct snd_soc_dai *dai, int mute, int stream) { struct snd_soc_component *component = dai->component; struct device *wsa_dev = NULL; @@ -864,11 +864,11 @@ static int wsa_macro_digital_mute(struct snd_soc_dai *dai, int mute) WSA_MACRO_RX_PATH_DSMDEM_OFFSET; int_mux_cfg0 = BOLERO_CDC_WSA_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 & 0x38)) snd_soc_component_update_bits(component, reg, 0x20, 0x20); @@ -1289,7 +1289,7 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: wsa_macro_enable_swr(w, kcontrol, event); - val = snd_soc_component_read32(component, gain_reg); + val = snd_soc_component_read(component, gain_reg); val += offset_val; snd_soc_component_write(component, gain_reg, val); break; @@ -1441,8 +1441,8 @@ static bool wsa_macro_adie_lb(struct snd_soc_component *component, int_mux_cfg0 = BOLERO_CDC_WSA_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 || @@ -1543,7 +1543,7 @@ static int wsa_macro_enable_prim_interpolator( 0x1, 0x1); } if ((reg != prim_int_reg) && - ((snd_soc_component_read32( + ((snd_soc_component_read( component, prim_int_reg)) & 0x10)) snd_soc_component_update_bits(component, reg, 0x10, 0x10); @@ -1629,7 +1629,7 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w, 0x01, 0x01); offset_val = -2; } - val = snd_soc_component_read32(component, gain_reg); + val = snd_soc_component_read(component, gain_reg); val += offset_val; snd_soc_component_write(component, gain_reg, val); wsa_macro_config_ear_spkr_gain(component, wsa_priv, @@ -1658,7 +1658,7 @@ static int wsa_macro_enable_interpolator(struct snd_soc_dapm_widget *w, BOLERO_CDC_WSA_RX1_RX_PATH_MIX_SEC0, 0x01, 0x00); offset_val = 2; - val = snd_soc_component_read32(component, gain_reg); + val = snd_soc_component_read(component, gain_reg); val += offset_val; snd_soc_component_write(component, gain_reg, val); } @@ -1753,7 +1753,7 @@ static int wsa_macro_spk_boost_event(struct snd_soc_dapm_widget *w, 0x01, 0x01); snd_soc_component_update_bits(component, boost_path_ctl, 0x10, 0x10); - if ((snd_soc_component_read32(component, reg_mix)) & 0x10) + if ((snd_soc_component_read(component, reg_mix)) & 0x10) snd_soc_component_update_bits(component, reg_mix, 0x10, 0x00); break; @@ -1913,7 +1913,7 @@ static int wsa_macro_enable_echo(struct snd_soc_dapm_widget *w, dev_dbg(wsa_dev, "%s %d %s\n", __func__, event, w->name); - val = snd_soc_component_read32(component, + val = snd_soc_component_read(component, BOLERO_CDC_WSA_RX_INP_MUX_RX_MIX_CFG0); if (!(strcmp(w->name, "WSA RX_MIX EC0_MUX"))) ec_tx = (val & 0x07) - 1; @@ -2135,7 +2135,7 @@ static int wsa_macro_spkr_left_boost_stage_get(struct snd_kcontrol *kcontrol, struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); - bst_state_max = snd_soc_component_read32(component, + bst_state_max = snd_soc_component_read(component, BOLERO_CDC_WSA_BOOST0_BOOST_CTL); bst_state_max = (bst_state_max & 0x0c) >> 2; ucontrol->value.integer.value[0] = bst_state_max; @@ -2167,7 +2167,7 @@ static int wsa_macro_spkr_right_boost_stage_get(struct snd_kcontrol *kcontrol, struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); - bst_state_max = snd_soc_component_read32(component, + bst_state_max = snd_soc_component_read(component, BOLERO_CDC_WSA_BOOST1_BOOST_CTL); bst_state_max = (bst_state_max & 0x0c) >> 2; ucontrol->value.integer.value[0] = bst_state_max; @@ -2276,7 +2276,7 @@ static int wsa_macro_vbat_bcl_gsm_mode_func_get(struct snd_kcontrol *kcontrol, snd_soc_kcontrol_component(kcontrol); ucontrol->value.integer.value[0] = - ((snd_soc_component_read32( + ((snd_soc_component_read( component, BOLERO_CDC_WSA_VBAT_BCL_VBAT_CFG) & 0x04) ? 1 : 0); diff --git a/asoc/codecs/swr-dmic.c b/asoc/codecs/swr-dmic.c index 3ce3d4ad10..479e64c8e5 100644 --- a/asoc/codecs/swr-dmic.c +++ b/asoc/codecs/swr-dmic.c @@ -631,7 +631,7 @@ static int swr_dmic_probe(struct swr_device *pdev) goto dev_err; } strlcpy(prefix_name, swr_dmic_name_prefix_of, - strlen(swr_dmic_name_prefix_of) + 1); + strlen(prefix_name) + 1); component->name_prefix = prefix_name; return 0; diff --git a/asoc/codecs/wcd937x/Kbuild b/asoc/codecs/wcd937x/Kbuild index c7286d0cd8..7ebf0335fc 100644 --- a/asoc/codecs/wcd937x/Kbuild +++ b/asoc/codecs/wcd937x/Kbuild @@ -36,6 +36,10 @@ ifeq ($(KERNEL_BUILD), 0) export INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h endif + ifeq ($(CONFIG_ARCH_WAIPIO), y) + include $(AUDIO_ROOT)/config/waipioauto.conf + INCS += -include $(AUDIO_ROOT)/config/waipioautoconf.h + endif endif # As per target team, build is done as follows: @@ -109,13 +113,6 @@ ifeq ($(call cc-option-yn, -Wheader-guard),y) EXTRA_CFLAGS += -Wheader-guard endif -ifeq ($(KERNEL_BUILD), 0) -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers -endif # Module information used by KBuild framework obj-$(CONFIG_SND_SOC_WCD937X) += wcd937x_dlkm.o diff --git a/asoc/codecs/wcd937x/wcd937x-mbhc.c b/asoc/codecs/wcd937x/wcd937x-mbhc.c index 039f5118be..bcf06d3b41 100644 --- a/asoc/codecs/wcd937x/wcd937x-mbhc.c +++ b/asoc/codecs/wcd937x/wcd937x-mbhc.c @@ -200,7 +200,7 @@ static void wcd937x_mbhc_clk_setup(struct snd_soc_component *component, static int wcd937x_mbhc_btn_to_num(struct snd_soc_component *component) { - return snd_soc_component_read32(component, WCD937X_ANA_MBHC_RESULT_3) & + return snd_soc_component_read(component, WCD937X_ANA_MBHC_RESULT_3) & 0x7; } @@ -268,7 +268,7 @@ static bool wcd937x_mbhc_micb_en_status(struct wcd_mbhc *mbhc, int micb_num) u8 val = 0; if (micb_num == MIC_BIAS_2) { - val = ((snd_soc_component_read32(mbhc->component, + val = ((snd_soc_component_read(mbhc->component, WCD937X_ANA_MICB2) & 0xC0) >> 6); if (val == 0x01) @@ -279,7 +279,7 @@ static bool wcd937x_mbhc_micb_en_status(struct wcd_mbhc *mbhc, int micb_num) static bool wcd937x_mbhc_hph_pa_on_status(struct snd_soc_component *component) { - return (snd_soc_component_read32(component, WCD937X_ANA_HPH) & 0xC0) ? + return (snd_soc_component_read(component, WCD937X_ANA_HPH) & 0xC0) ? true : false; } @@ -485,10 +485,10 @@ static inline void wcd937x_wcd_mbhc_qfuse_cal( int q1_cal; if (*z_val < (WCD937X_ZDET_VAL_400/1000)) - q1 = snd_soc_component_read32(component, + q1 = snd_soc_component_read(component, WCD937X_DIGITAL_EFUSE_REG_23 + (2 * flag_l_r)); else - q1 = snd_soc_component_read32(component, + q1 = snd_soc_component_read(component, WCD937X_DIGITAL_EFUSE_REG_24 + (2 * flag_l_r)); if (q1 & 0x80) q1_cal = (10000 - ((q1 & 0x7F) * 25)); @@ -524,14 +524,14 @@ static void wcd937x_wcd_mbhc_calc_impedance(struct wcd_mbhc *mbhc, uint32_t *zl, WCD_MBHC_RSC_ASSERT_LOCKED(mbhc); - reg0 = snd_soc_component_read32(component, WCD937X_ANA_MBHC_BTN5); - reg1 = snd_soc_component_read32(component, WCD937X_ANA_MBHC_BTN6); - reg2 = snd_soc_component_read32(component, WCD937X_ANA_MBHC_BTN7); - reg3 = snd_soc_component_read32(component, WCD937X_MBHC_CTL_CLK); - reg4 = snd_soc_component_read32(component, + reg0 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN5); + reg1 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN6); + reg2 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN7); + reg3 = snd_soc_component_read(component, WCD937X_MBHC_CTL_CLK); + reg4 = snd_soc_component_read(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL); - if (snd_soc_component_read32(component, WCD937X_ANA_MBHC_ELECT) & + if (snd_soc_component_read(component, WCD937X_ANA_MBHC_ELECT) & 0x80) { is_fsm_disable = true; regmap_update_bits(wcd937x->regmap, @@ -786,13 +786,13 @@ static bool wcd937x_mbhc_get_moisture_status(struct wcd_mbhc *mbhc) /* If moisture_en is already enabled, then skip to plug type * detection. */ - if ((snd_soc_component_read32(component, WCD937X_MBHC_NEW_CTL_2) & + if ((snd_soc_component_read(component, WCD937X_MBHC_NEW_CTL_2) & 0x0C)) goto done; wcd937x_mbhc_moisture_detect_en(mbhc, true); /* Read moisture comparator status */ - ret = ((snd_soc_component_read32(component, WCD937X_MBHC_NEW_FSM_STATUS) + ret = ((snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS) & 0x20) ? 0 : 1); done: diff --git a/asoc/codecs/wcd937x/wcd937x.c b/asoc/codecs/wcd937x/wcd937x.c index 7967dff74c..22a452e2da 100644 --- a/asoc/codecs/wcd937x/wcd937x.c +++ b/asoc/codecs/wcd937x/wcd937x.c @@ -969,7 +969,7 @@ static int wcd937x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w, * depending on mux value */ wcd937x->ear_rx_path = - snd_soc_component_read32( + snd_soc_component_read( component, WCD937X_DIGITAL_CDC_EAR_PATH_CTL); if (wcd937x->ear_rx_path & EAR_RX_PATH_AUX) snd_soc_component_update_bits(component, @@ -1282,7 +1282,7 @@ int wcd937x_mbhc_micb_adjust_voltage(struct snd_soc_component *component, * momentarily, change the micbias value and then re-enable * micbias. */ - micb_val = snd_soc_component_read32(component, micb_reg); + micb_val = snd_soc_component_read(component, micb_reg); micb_en = (micb_val & 0xC0) >> 6; cur_vout_ctl = micb_val & 0x3F; @@ -1332,7 +1332,7 @@ static int wcd937x_tx_swr_ctrl(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_PRE_PMU: if (strnstr(w->name, "ADC", sizeof("ADC"))) { /* Enable BCS for Headset mic */ - if (w->shift == 1 && !(snd_soc_component_read32(component, + if (w->shift == 1 && !(snd_soc_component_read(component, WCD937X_TX_NEW_TX_CH2_SEL) & 0x80)) { wcd937x_tx_connect_port(component, MBHC, true); set_bit(AMIC2_BCS_ENABLE, &wcd937x->status_mask); @@ -1621,7 +1621,7 @@ static bool get_usbc_hs_status(struct snd_soc_component *component, struct wcd_mbhc_config *mbhc_cfg) { if (mbhc_cfg->enable_usbc_analog) { - if (!(snd_soc_component_read32(component, WCD937X_ANA_MBHC_MECH) + if (!(snd_soc_component_read(component, WCD937X_ANA_MBHC_MECH) & 0x20)) return true; } @@ -1868,7 +1868,7 @@ static int wcd937x_ear_pa_gain_get(struct snd_kcontrol *kcontrol, struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); - ear_pa_gain = snd_soc_component_read32(component, + ear_pa_gain = snd_soc_component_read(component, WCD937X_ANA_EAR_COMPANDER_CTL); ear_pa_gain = (ear_pa_gain & 0x7C) >> 2; @@ -2739,7 +2739,7 @@ static int wcd937x_soc_codec_probe(struct snd_soc_component *component) wcd937x->component = component; snd_soc_component_init_regmap(component, wcd937x->regmap); - variant = (snd_soc_component_read32( + variant = (snd_soc_component_read( component, WCD937X_DIGITAL_EFUSE_REG_0) & 0x1E) >> 1; wcd937x->variant = variant; diff --git a/asoc/codecs/wcd938x/Kbuild b/asoc/codecs/wcd938x/Kbuild index 873a7b29d4..3400f3c037 100644 --- a/asoc/codecs/wcd938x/Kbuild +++ b/asoc/codecs/wcd938x/Kbuild @@ -23,6 +23,10 @@ ifeq ($(KERNEL_BUILD), 0) export INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h endif + ifeq ($(CONFIG_ARCH_WAIPIO), y) + include $(AUDIO_ROOT)/config/waipioauto.conf + INCS += -include $(AUDIO_ROOT)/config/waipioautoconf.h + endif endif @@ -97,13 +101,6 @@ ifeq ($(call cc-option-yn, -Wheader-guard),y) EXTRA_CFLAGS += -Wheader-guard endif -ifeq ($(KERNEL_BUILD), 0) -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers -endif # Module information used by KBuild framework obj-$(CONFIG_SND_SOC_WCD938X) += wcd938x_dlkm.o diff --git a/asoc/codecs/wcd938x/wcd938x-mbhc.c b/asoc/codecs/wcd938x/wcd938x-mbhc.c index 0687de6475..8bbf083e6f 100644 --- a/asoc/codecs/wcd938x/wcd938x-mbhc.c +++ b/asoc/codecs/wcd938x/wcd938x-mbhc.c @@ -201,7 +201,7 @@ static void wcd938x_mbhc_clk_setup(struct snd_soc_component *component, static int wcd938x_mbhc_btn_to_num(struct snd_soc_component *component) { - return snd_soc_component_read32(component, WCD938X_ANA_MBHC_RESULT_3) & 0x7; + return snd_soc_component_read(component, WCD938X_ANA_MBHC_RESULT_3) & 0x7; } static void wcd938x_mbhc_mbhc_bias_control(struct snd_soc_component *component, @@ -268,7 +268,7 @@ static bool wcd938x_mbhc_micb_en_status(struct wcd_mbhc *mbhc, int micb_num) u8 val = 0; if (micb_num == MIC_BIAS_2) { - val = ((snd_soc_component_read32(mbhc->component, + val = ((snd_soc_component_read(mbhc->component, WCD938X_ANA_MICB2) & 0xC0) >> 6); if (val == 0x01) @@ -279,7 +279,7 @@ static bool wcd938x_mbhc_micb_en_status(struct wcd_mbhc *mbhc, int micb_num) static bool wcd938x_mbhc_hph_pa_on_status(struct snd_soc_component *component) { - return (snd_soc_component_read32(component, WCD938X_ANA_HPH) & 0xC0) ? + return (snd_soc_component_read(component, WCD938X_ANA_HPH) & 0xC0) ? true : false; } @@ -487,10 +487,10 @@ static inline void wcd938x_wcd_mbhc_qfuse_cal( int q1_cal; if (*z_val < (WCD938X_ZDET_VAL_400/1000)) - q1 = snd_soc_component_read32(component, + q1 = snd_soc_component_read(component, WCD938X_DIGITAL_EFUSE_REG_23 + (2 * flag_l_r)); else - q1 = snd_soc_component_read32(component, + q1 = snd_soc_component_read(component, WCD938X_DIGITAL_EFUSE_REG_24 + (2 * flag_l_r)); if (q1 & 0x80) q1_cal = (10000 - ((q1 & 0x7F) * 25)); @@ -526,13 +526,13 @@ static void wcd938x_wcd_mbhc_calc_impedance(struct wcd_mbhc *mbhc, uint32_t *zl, WCD_MBHC_RSC_ASSERT_LOCKED(mbhc); - reg0 = snd_soc_component_read32(component, WCD938X_ANA_MBHC_BTN5); - reg1 = snd_soc_component_read32(component, WCD938X_ANA_MBHC_BTN6); - reg2 = snd_soc_component_read32(component, WCD938X_ANA_MBHC_BTN7); - reg3 = snd_soc_component_read32(component, WCD938X_MBHC_CTL_CLK); - reg4 = snd_soc_component_read32(component, WCD938X_MBHC_NEW_ZDET_ANA_CTL); + reg0 = snd_soc_component_read(component, WCD938X_ANA_MBHC_BTN5); + reg1 = snd_soc_component_read(component, WCD938X_ANA_MBHC_BTN6); + reg2 = snd_soc_component_read(component, WCD938X_ANA_MBHC_BTN7); + reg3 = snd_soc_component_read(component, WCD938X_MBHC_CTL_CLK); + reg4 = snd_soc_component_read(component, WCD938X_MBHC_NEW_ZDET_ANA_CTL); - if (snd_soc_component_read32(component, WCD938X_ANA_MBHC_ELECT) & 0x80) { + if (snd_soc_component_read(component, WCD938X_ANA_MBHC_ELECT) & 0x80) { is_fsm_disable = true; regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ELECT, 0x80, 0x00); @@ -780,12 +780,12 @@ static bool wcd938x_mbhc_get_moisture_status(struct wcd_mbhc *mbhc) * If moisture_en is already enabled, then skip to plug type * detection. */ - if ((snd_soc_component_read32(component, WCD938X_MBHC_NEW_CTL_2) & 0x0C)) + if ((snd_soc_component_read(component, WCD938X_MBHC_NEW_CTL_2) & 0x0C)) goto done; wcd938x_mbhc_moisture_detect_en(mbhc, true); /* Read moisture comparator status */ - ret = ((snd_soc_component_read32(component, WCD938X_MBHC_NEW_FSM_STATUS) + ret = ((snd_soc_component_read(component, WCD938X_MBHC_NEW_FSM_STATUS) & 0x20) ? 0 : 1); done: diff --git a/asoc/codecs/wcd938x/wcd938x.c b/asoc/codecs/wcd938x/wcd938x.c index 46886f4a4e..d58f18f438 100644 --- a/asoc/codecs/wcd938x/wcd938x.c +++ b/asoc/codecs/wcd938x/wcd938x.c @@ -288,7 +288,7 @@ static int wcd938x_init_reg(struct snd_soc_component *component) snd_soc_component_update_bits(component, WCD938X_TX_3_4_TEST_BLK_EN2, 0x01, 0x00); snd_soc_component_update_bits(component, WCD938X_SLEEP_CTL, 0x0E, - ((snd_soc_component_read32(component, + ((snd_soc_component_read(component, WCD938X_DIGITAL_EFUSE_REG_30) & 0x07) << 1)); snd_soc_component_update_bits(component, WCD938X_HPH_SURGE_HPHLR_SURGE_EN, 0xC0, 0xC0); @@ -583,7 +583,7 @@ static int wcd938x_codec_hphl_dac_event(struct snd_soc_dapm_widget *w, WCD938X_DIGITAL_CDC_COMP_CTL_0, 0x02, 0x02); /* 5msec compander delay as per HW requirement */ if (!wcd938x->comp2_enable || - (snd_soc_component_read32(component, + (snd_soc_component_read(component, WCD938X_DIGITAL_CDC_COMP_CTL_0) & 0x01)) usleep_range(5000, 5010); snd_soc_component_update_bits(component, @@ -635,7 +635,7 @@ static int wcd938x_codec_hphr_dac_event(struct snd_soc_dapm_widget *w, WCD938X_DIGITAL_CDC_COMP_CTL_0, 0x01, 0x01); /* 5msec compander delay as per HW requirement */ if (!wcd938x->comp1_enable || - (snd_soc_component_read32(component, + (snd_soc_component_read(component, WCD938X_DIGITAL_CDC_COMP_CTL_0) & 0x02)) usleep_range(5000, 5010); snd_soc_component_update_bits(component, @@ -672,7 +672,7 @@ static int wcd938x_codec_ear_dac_event(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_PRE_PMU: wcd938x_rx_clk_enable(component); wcd938x->ear_rx_path = - snd_soc_component_read32( + snd_soc_component_read( component, WCD938X_DIGITAL_CDC_EAR_PATH_CTL); if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { snd_soc_component_update_bits(component, @@ -1128,7 +1128,7 @@ static int wcd938x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w, * depending on mux value */ wcd938x->ear_rx_path = - snd_soc_component_read32( + snd_soc_component_read( component, WCD938X_DIGITAL_CDC_EAR_PATH_CTL); if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) snd_soc_component_update_bits(component, @@ -1490,7 +1490,7 @@ int wcd938x_mbhc_micb_adjust_voltage(struct snd_soc_component *component, * momentarily, change the micbias value and then re-enable * micbias. */ - micb_val = snd_soc_component_read32(component, micb_reg); + micb_val = snd_soc_component_read(component, micb_reg); micb_en = (micb_val & 0xC0) >> 6; cur_vout_ctl = micb_val & 0x3F; @@ -1552,7 +1552,7 @@ static int wcd938x_tx_swr_ctrl(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: /* Check AMIC2 is connected to ADC2 to take an action on BCS */ - if (w->shift == ADC2 && !(snd_soc_component_read32(component, + if (w->shift == ADC2 && !(snd_soc_component_read(component, WCD938X_TX_NEW_AMIC_MUX_CFG) & 0x80)) { if (!wcd938x->bcs_dis) wcd938x_tx_connect_port(component, MBHC, @@ -2079,7 +2079,7 @@ static bool get_usbc_hs_status(struct snd_soc_component *component, struct wcd_mbhc_config *mbhc_cfg) { if (mbhc_cfg->enable_usbc_analog) { - if (!(snd_soc_component_read32(component, WCD938X_ANA_MBHC_MECH) + if (!(snd_soc_component_read(component, WCD938X_ANA_MBHC_MECH) & 0x20)) return true; } @@ -2630,7 +2630,7 @@ static int wcd938x_ear_pa_gain_get(struct snd_kcontrol *kcontrol, struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); - ear_pa_gain = snd_soc_component_read32(component, + ear_pa_gain = snd_soc_component_read(component, WCD938X_ANA_EAR_COMPANDER_CTL); ear_pa_gain = (ear_pa_gain & 0x7C) >> 2; @@ -3752,7 +3752,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component) wcd938x->component = component; snd_soc_component_init_regmap(component, wcd938x->regmap); - variant = (snd_soc_component_read32(component, + variant = (snd_soc_component_read(component, WCD938X_DIGITAL_EFUSE_REG_0) & 0x1E) >> 1; wcd938x->variant = variant; diff --git a/asoc/codecs/wcdcal-hwdep.c b/asoc/codecs/wcdcal-hwdep.c index 7e2b984a93..54338217b0 100644 --- a/asoc/codecs/wcdcal-hwdep.c +++ b/asoc/codecs/wcdcal-hwdep.c @@ -9,7 +9,7 @@ #include #include #include -#include