ASoC: Audio bringup changes for msm8937_32go.

Enable compilation for msm8937_32go, 8953, sdm439, sdm429 targets.
Bring in msm8952 machine driver and SDM450 auto configs.
Update asoc, codec driver to component driver to align
with kernel-4.19 ALSA.

Change-Id: I95a6ee3dbb3b9d3b89cc6961346baf1efb3cb9c8
Signed-off-by: Subhadra Jagadeesan <subhja@codeaurora.org>
This commit is contained in:
Subhadra Jagadeesan committed 2021-01-27 11:39:25 +05:30
1 parent 6f7624eab4
commit 411c3d05fc
34 files changed
+12764 -46

No files matched your search

+5 -2
View File
@@ -3,7 +3,7 @@ MY_LOCAL_PATH := $(call my-dir)
UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
$(shell mkdir -p $(UAPI_OUT)/linux;) $(shell mkdir -p $(UAPI_OUT)/linux;)
$(shell mkdir -p $(UAPI_OUT)/sound;) $(shell mkdir -p $(UAPI_OUT)/sound;)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers) $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers)
@@ -12,6 +12,9 @@ $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/codecs
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers) $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers) $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers) $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers)
ifeq ($(call is-board-platform-in-list, msm8953 msm8937),true)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers)
endif
include $(MY_LOCAL_PATH)/include/uapi/Android.mk include $(MY_LOCAL_PATH)/include/uapi/Android.mk
include $(MY_LOCAL_PATH)/ipc/Android.mk include $(MY_LOCAL_PATH)/ipc/Android.mk
@@ -71,7 +74,7 @@ $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codec
include $(MY_LOCAL_PATH)/asoc/codecs/wsa883x/Android.mk include $(MY_LOCAL_PATH)/asoc/codecs/wsa883x/Android.mk
endif endif
ifeq ($(call is-board-platform-in-list, sdm660),true) ifeq ($(call is-board-platform-in-list, sdm660 msm8953 msm8937),true)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers) $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers) $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers)
include $(MY_LOCAL_PATH)/asoc/codecs/sdm660_cdc/Android.mk include $(MY_LOCAL_PATH)/asoc/codecs/sdm660_cdc/Android.mk
+4 -1
View File
@@ -20,6 +20,9 @@ endif
ifeq ($(TARGET_SUPPORT),sdm660) ifeq ($(TARGET_SUPPORT),sdm660)
KBUILD_OPTIONS += CONFIG_ARCH_SDM660=y KBUILD_OPTIONS += CONFIG_ARCH_SDM660=y
endif endif
ifeq ($(TARGET_SUPPORT),apq8053 msm8953 msm8937)
KBUILD_OPTIONS += CONFIG_ARCH_SDM450=y
endif
obj-m := ipc/ obj-m := ipc/
obj-m += dsp/ obj-m += dsp/
@@ -45,7 +48,7 @@ obj-m += asoc/codecs/bolero/
obj-m += asoc/codecs/wcd938x/ obj-m += asoc/codecs/wcd938x/
endif endif
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdm660)) ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), apq8053 sdm660 msm8953 msm8937))
obj-m += asoc/codecs/sdm660_cdc/ obj-m += asoc/codecs/sdm660_cdc/
endif endif
+18 -2
View File
@@ -46,9 +46,15 @@ TARGET := sdm660
AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m
endif endif
ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
TARGET := sdm450
AUDIO_SELECT += CONFIG_SND_SOC_SDM450=m
AUDIO_SELECT += CONFIG_SND_SOC_EXT_CODEC_SDM450=m
endif
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
@@ -83,7 +89,7 @@ LOCAL_MODULE_DEBUG_ENABLE := true
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk include $(DLKM_DIR)/AndroidKernelModule.mk
########################################################### ###########################################################
ifeq ($(call is-board-platform-in-list, ),true) ifeq ($(call is-board-platform-in-list, msm8953 msm8937),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := $(AUDIO_CHIPSET)_cpe_lsm.ko LOCAL_MODULE := $(AUDIO_CHIPSET)_cpe_lsm.ko
LOCAL_MODULE_KBUILD_NAME := cpe_lsm_dlkm.ko LOCAL_MODULE_KBUILD_NAME := cpe_lsm_dlkm.ko
@@ -101,6 +107,16 @@ LOCAL_MODULE_DEBUG_ENABLE := true
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk include $(DLKM_DIR)/AndroidKernelModule.mk
########################################################### ###########################################################
ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
include $(CLEAR_VARS)
LOCAL_MODULE := $(AUDIO_CHIPSET)_machine_ext_$(TARGET).ko
LOCAL_MODULE_KBUILD_NAME := machine_ext_dlkm.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_DEBUG_ENABLE := true
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk
endif
###########################################################
endif # DLKM check endif # DLKM check
endif # supported target check endif # supported target check
+32
View File
@@ -81,6 +81,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows:
@@ -170,6 +185,17 @@ ifdef CONFIG_SND_SOC_CPE
CPE_LSM_OBJS += msm-cpe-lsm.o CPE_LSM_OBJS += msm-cpe-lsm.o
endif endif
# for SDM450 internal codec sound card driver
ifdef CONFIG_SND_SOC_SDM450
MACHINE_OBJS += msm8952.o
endif
# for SDM450 external codec sound card driver
ifdef CONFIG_SND_SOC_EXT_CODEC_SDM450
MACHINE_EXT_OBJS += msm8952-slimbus.o
MACHINE_EXT_OBJS += msm8952-dai-links.o
endif
ifdef CONFIG_SND_SOC_QDSP6V2 ifdef CONFIG_SND_SOC_QDSP6V2
PLATFORM_OBJS += msm-audio-effects-q6-v2.o PLATFORM_OBJS += msm-audio-effects-q6-v2.o
PLATFORM_OBJS += msm-compress-q6-v2.o PLATFORM_OBJS += msm-compress-q6-v2.o
@@ -254,6 +280,12 @@ endif
obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
platform_dlkm-y := $(PLATFORM_OBJS) platform_dlkm-y := $(PLATFORM_OBJS)
obj-$(CONFIG_SND_SOC_SDM450) += machine_dlkm.o
machine_dlkm-y := $(MACHINE_OBJS)
obj-$(CONFIG_SND_SOC_EXT_CODEC_SDM450) += machine_ext_dlkm.o
machine_ext_dlkm-y := $(MACHINE_EXT_OBJS)
obj-$(CONFIG_SND_SOC_SM8150) += machine_dlkm.o obj-$(CONFIG_SND_SOC_SM8150) += machine_dlkm.o
machine_dlkm-y := $(MACHINE_OBJS) machine_dlkm-y := $(MACHINE_OBJS)
+9 -4
View File
@@ -39,9 +39,14 @@ ifeq ($(call is-board-platform,sdm660),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m
endif endif
ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
AUDIO_SELECT += CONFIG_SND_SOC_SDM450=m
AUDIO_SELECT += CONFIG_SND_SOC_EXT_CODEC_SDM450=m
endif
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
@@ -85,7 +90,7 @@ LOCAL_MODULE_DEBUG_ENABLE := true
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk include $(DLKM_DIR)/AndroidKernelModule.mk
########################################################### ###########################################################
ifeq ($(call is-board-platform-in-list, ),true) ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko
LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko
@@ -105,7 +110,7 @@ LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk include $(DLKM_DIR)/AndroidKernelModule.mk
endif endif
########################################################### ###########################################################
ifeq ($(call is-board-platform-in-list, sdm660),true) ifeq ($(call is-board-platform-in-list, sdm660 msm8953 msm8937),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko
LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko
@@ -125,7 +130,7 @@ LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk include $(DLKM_DIR)/AndroidKernelModule.mk
endif endif
########################################################### ###########################################################
ifeq ($(call is-board-platform-in-list, bengal),true) ifeq ($(call is-board-platform-in-list, bengal msm8953 msm8937),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x_analog.ko LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x_analog.ko
LOCAL_MODULE_KBUILD_NAME := wsa881x_analog_dlkm.ko LOCAL_MODULE_KBUILD_NAME := wsa881x_analog_dlkm.ko
+15
View File
@@ -75,6 +75,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows:
+15
View File
@@ -20,6 +20,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows:
+1 -1
View File
@@ -4,7 +4,7 @@
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list, sdm660),true) ifeq ($(call is-board-platform-in-list, sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
+22
View File
@@ -20,6 +20,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows:
@@ -58,6 +73,10 @@ ifdef CONFIG_SND_SOC_DIGITAL_CDC
DIGITAL_CDC_OBJS += msm-digital-cdc.o DIGITAL_CDC_OBJS += msm-digital-cdc.o
DIGITAL_CDC_OBJS += msm-digital-cdc-regmap.o DIGITAL_CDC_OBJS += msm-digital-cdc-regmap.o
endif endif
ifdef CONFIG_SND_SOC_DIGITAL_CDC_LEGACY
DIGITAL_CDC_OBJS += msm-digital-cdc-legacy.o
DIGITAL_CDC_OBJS += msm-digital-cdc-legacy-regmap.o
endif
LINUX_INC += -Iinclude/linux LINUX_INC += -Iinclude/linux
INCS += $(COMMON_INC) \ INCS += $(COMMON_INC) \
@@ -111,5 +130,8 @@ analog_cdc_dlkm-y := $(ANALOG_CDC_OBJS)
obj-$(CONFIG_SND_SOC_DIGITAL_CDC) += digital_cdc_dlkm.o obj-$(CONFIG_SND_SOC_DIGITAL_CDC) += digital_cdc_dlkm.o
digital_cdc_dlkm-y := $(DIGITAL_CDC_OBJS) digital_cdc_dlkm-y := $(DIGITAL_CDC_OBJS)
obj-$(CONFIG_SND_SOC_DIGITAL_CDC_LEGACY) += digital_cdc_dlkm.o
digital_cdc_dlkm-y := $(DIGITAL_CDC_OBJS)
# inject some build related information # inject some build related information
DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"
+3 -3
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2015-2018, 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#ifndef MSM_ANALOG_CDC_H #ifndef MSM_ANALOG_CDC_H
#define MSM_ANALOG_CDC_H #define MSM_ANALOG_CDC_H
@@ -227,7 +227,7 @@ extern int msm_anlg_cdc_mclk_enable(struct snd_soc_component *component,
extern int msm_anlg_cdc_hs_detect(struct snd_soc_component *component, extern int msm_anlg_cdc_hs_detect(struct snd_soc_component *component,
struct wcd_mbhc_config *mbhc_cfg); struct wcd_mbhc_config *mbhc_cfg);
extern void msm_anlg_cdc_hs_detect_exit(struct snd_soc_component *component); extern void msm_anlg_cdc_hs_detect_exit(struct snd_soc_component *component);
extern void sdm660_cdc_update_int_spk_boost(bool enable); extern void msm_anlg_cdc_update_int_spk_boost(bool enable);
extern void msm_anlg_cdc_spk_ext_pa_cb( extern void msm_anlg_cdc_spk_ext_pa_cb(
int (*codec_spk_ext_pa)(struct snd_soc_component *component, int (*codec_spk_ext_pa)(struct snd_soc_component *component,
int enable), struct snd_soc_component *component); int enable), struct snd_soc_component *component);
@@ -249,7 +249,7 @@ static inline void msm_anlg_cdc_hs_detect_exit(
{ {
} }
static inline void sdm660_cdc_update_int_spk_boost(bool enable) static inline void msm_anlg_cdc_update_int_spk_boost(bool enable)
{ {
} }
+2 -1
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2016-2017, 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2017, 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/regmap.h> #include <linux/regmap.h>
@@ -56,5 +56,6 @@ enum dig_cdc_notify_event {
DIG_CDC_EVENT_POST_RX2_INT_OFF, DIG_CDC_EVENT_POST_RX2_INT_OFF,
DIG_CDC_EVENT_SSR_DOWN, DIG_CDC_EVENT_SSR_DOWN,
DIG_CDC_EVENT_SSR_UP, DIG_CDC_EVENT_SSR_UP,
DIG_CDC_EVENT_CAP_CONFIGURE,
DIG_CDC_EVENT_LAST, DIG_CDC_EVENT_LAST,
}; };
@@ -0,0 +1,418 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015-2018, 2021, The Linux Foundation. All rights reserved.
*/
#include <linux/regmap.h>
#include "msm-cdc-common.h"
#include "sdm660-cdc-registers.h"
/*
* Default register reset values that are common across different versions
* are defined here. If a register reset value is changed based on version
* then remove it from this structure and add it in version specific
* structures.
*/
struct reg_default
msm89xx_cdc_core_defaults[MSM89XX_CDC_CORE_CACHE_SIZE] = {
{MSM89XX_CDC_CORE_CLK_RX_RESET_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_TX_RESET_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_DMIC_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_RX_I2S_CTL, 0x13},
{MSM89XX_CDC_CORE_CLK_TX_I2S_CTL, 0x13},
{MSM89XX_CDC_CORE_CLK_OTHR_RESET_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_TX_CLK_EN_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_OTHR_CTL, 0x04},
{MSM89XX_CDC_CORE_CLK_RX_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_MCLK_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_PDM_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_SD_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_DMIC_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CLK_RX_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_B5_CTL, 0x68},
{MSM89XX_CDC_CORE_RX2_B5_CTL, 0x68},
{MSM89XX_CDC_CORE_RX3_B5_CTL, 0x68},
{MSM89XX_CDC_CORE_RX1_B6_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_B6_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_B6_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_VOL_CTL_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_VOL_CTL_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_VOL_CTL_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_RX1_VOL_CTL_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_RX2_VOL_CTL_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_RX3_VOL_CTL_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_TOP_GAIN_UPDATE, 0x00},
{MSM89XX_CDC_CORE_TOP_CTL, 0x01},
{MSM89XX_CDC_CORE_COMP0_B1_CTL, 0x30},
{MSM89XX_CDC_CORE_COMP0_B2_CTL, 0xB5},
{MSM89XX_CDC_CORE_COMP0_B3_CTL, 0x28},
{MSM89XX_CDC_CORE_COMP0_B4_CTL, 0x37},
{MSM89XX_CDC_CORE_COMP0_B5_CTL, 0x7F},
{MSM89XX_CDC_CORE_COMP0_B6_CTL, 0x00},
{MSM89XX_CDC_CORE_COMP0_SHUT_DOWN_STATUS, 0x03},
{MSM89XX_CDC_CORE_COMP0_FS_CFG, 0x03},
{MSM89XX_CDC_CORE_COMP0_DELAY_BUF_CTL, 0x02},
{MSM89XX_CDC_CORE_DEBUG_DESER1_CTL, 0x00},
{MSM89XX_CDC_CORE_DEBUG_DESER2_CTL, 0x00},
{MSM89XX_CDC_CORE_DEBUG_B1_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_DEBUG_B2_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_DEBUG_B3_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B5_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B5_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B6_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B6_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B7_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B7_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_GAIN_B8_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_B8_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_CTL, 0x40},
{MSM89XX_CDC_CORE_IIR2_CTL, 0x40},
{MSM89XX_CDC_CORE_IIR1_GAIN_TIMER_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_GAIN_TIMER_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_COEF_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_COEF_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR1_COEF_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_IIR2_COEF_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX1_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX1_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX1_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX2_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX2_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX2_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX3_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_RX3_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_TX_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_TX_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ1_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ1_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ1_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ1_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ2_B1_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ2_B2_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ2_B3_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_EQ2_B4_CTL, 0x00},
{MSM89XX_CDC_CORE_CONN_TX_I2S_SD1_CTL, 0x00},
{MSM89XX_CDC_CORE_TX1_VOL_CTL_TIMER, 0x00},
{MSM89XX_CDC_CORE_TX2_VOL_CTL_TIMER, 0x00},
{MSM89XX_CDC_CORE_TX3_VOL_CTL_TIMER, 0x00},
{MSM89XX_CDC_CORE_TX4_VOL_CTL_TIMER, 0x00},
{MSM89XX_CDC_CORE_TX1_VOL_CTL_GAIN, 0x00},
{MSM89XX_CDC_CORE_TX2_VOL_CTL_GAIN, 0x00},
{MSM89XX_CDC_CORE_TX3_VOL_CTL_GAIN, 0x00},
{MSM89XX_CDC_CORE_TX4_VOL_CTL_GAIN, 0x00},
{MSM89XX_CDC_CORE_TX1_VOL_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_TX2_VOL_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_TX3_VOL_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_TX4_VOL_CTL_CFG, 0x00},
{MSM89XX_CDC_CORE_TX1_MUX_CTL, 0x00},
{MSM89XX_CDC_CORE_TX2_MUX_CTL, 0x00},
{MSM89XX_CDC_CORE_TX3_MUX_CTL, 0x00},
{MSM89XX_CDC_CORE_TX4_MUX_CTL, 0x00},
{MSM89XX_CDC_CORE_TX1_CLK_FS_CTL, 0x03},
{MSM89XX_CDC_CORE_TX2_CLK_FS_CTL, 0x03},
{MSM89XX_CDC_CORE_TX3_CLK_FS_CTL, 0x03},
{MSM89XX_CDC_CORE_TX4_CLK_FS_CTL, 0x03},
{MSM89XX_CDC_CORE_TX1_DMIC_CTL, 0x00},
{MSM89XX_CDC_CORE_TX2_DMIC_CTL, 0x00},
{MSM89XX_CDC_CORE_TX3_DMIC_CTL, 0x00},
{MSM89XX_CDC_CORE_TX4_DMIC_CTL, 0x00},
};
static const u8 msm89xx_cdc_core_reg_readable[MSM89XX_CDC_CORE_CACHE_SIZE] = {
[MSM89XX_CDC_CORE_CLK_RX_RESET_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_TX_RESET_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_DMIC_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_RX_I2S_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_TX_I2S_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_OTHR_RESET_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_TX_CLK_EN_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_OTHR_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_RX_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_MCLK_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_PDM_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_SD_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_DMIC_B2_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_RX_B2_CTL] = 1,
[MSM89XX_CDC_CORE_RX1_B1_CTL] = 1,
[MSM89XX_CDC_CORE_RX2_B1_CTL] = 1,
[MSM89XX_CDC_CORE_RX3_B1_CTL] = 1,
[MSM89XX_CDC_CORE_RX1_B2_CTL] = 1,
[MSM89XX_CDC_CORE_RX2_B2_CTL] = 1,
[MSM89XX_CDC_CORE_RX3_B2_CTL] = 1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GAIN] = 1,
[MSM89XX_CDC_CORE_TX1_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX2_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX3_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX4_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX1_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX2_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX3_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX4_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX1_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX2_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX3_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX4_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX1_DMIC_CTL] = 1,
[MSM89XX_CDC_CORE_TX2_DMIC_CTL] = 1,
[MSM89XX_CDC_CORE_TX3_DMIC_CTL] = 1,
[MSM89XX_CDC_CORE_TX4_DMIC_CTL] = 1,
};
static const u8 msm89xx_cdc_core_reg_writeable[MSM89XX_CDC_CORE_CACHE_SIZE] = {
[MSM89XX_CDC_CORE_CLK_RX_RESET_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_TX_RESET_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_DMIC_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_RX_I2S_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_TX_I2S_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_OTHR_RESET_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_TX_CLK_EN_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_OTHR_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_RX_B1_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_MCLK_CTL] = 1,
[MSM89XX_CDC_CORE_CLK_PDM_CTL] = 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[MSM89XX_CDC_CORE_TX2_VOL_CTL_TIMER] = 1,
[MSM89XX_CDC_CORE_TX3_VOL_CTL_TIMER] = 1,
[MSM89XX_CDC_CORE_TX4_VOL_CTL_TIMER] = 1,
[MSM89XX_CDC_CORE_TX1_VOL_CTL_GAIN] = 1,
[MSM89XX_CDC_CORE_TX2_VOL_CTL_GAIN] = 1,
[MSM89XX_CDC_CORE_TX3_VOL_CTL_GAIN] = 1,
[MSM89XX_CDC_CORE_TX4_VOL_CTL_GAIN] = 1,
[MSM89XX_CDC_CORE_TX1_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX2_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX3_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX4_VOL_CTL_CFG] = 1,
[MSM89XX_CDC_CORE_TX1_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX2_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX3_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX4_MUX_CTL] = 1,
[MSM89XX_CDC_CORE_TX1_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX2_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX3_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX4_CLK_FS_CTL] = 1,
[MSM89XX_CDC_CORE_TX1_DMIC_CTL] = 1,
[MSM89XX_CDC_CORE_TX2_DMIC_CTL] = 1,
[MSM89XX_CDC_CORE_TX3_DMIC_CTL] = 1,
[MSM89XX_CDC_CORE_TX4_DMIC_CTL] = 1,
};
bool msm89xx_cdc_core_readable_reg(struct device *dev, unsigned int reg)
{
return msm89xx_cdc_core_reg_readable[reg];
}
bool msm89xx_cdc_core_writeable_reg(struct device *dev, unsigned int reg)
{
return msm89xx_cdc_core_reg_writeable[reg];
}
bool msm89xx_cdc_core_volatile_reg(struct device *dev, unsigned int reg)
{
switch (reg) {
case MSM89XX_CDC_CORE_RX1_B1_CTL:
case MSM89XX_CDC_CORE_RX2_B1_CTL:
case MSM89XX_CDC_CORE_RX3_B1_CTL:
case MSM89XX_CDC_CORE_RX1_B6_CTL:
case MSM89XX_CDC_CORE_RX2_B6_CTL:
case MSM89XX_CDC_CORE_RX3_B6_CTL:
case MSM89XX_CDC_CORE_TX1_VOL_CTL_CFG:
case MSM89XX_CDC_CORE_TX2_VOL_CTL_CFG:
case MSM89XX_CDC_CORE_TX3_VOL_CTL_CFG:
case MSM89XX_CDC_CORE_TX4_VOL_CTL_CFG:
case MSM89XX_CDC_CORE_IIR1_COEF_B1_CTL:
case MSM89XX_CDC_CORE_IIR2_COEF_B1_CTL:
case MSM89XX_CDC_CORE_CLK_MCLK_CTL:
case MSM89XX_CDC_CORE_CLK_PDM_CTL:
return true;
default:
return false;
}
}
File diff suppressed because it is too large. Load diff
+47 -4
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2016-2017, 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2017, 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#ifndef MSM_DIGITAL_CDC_H #ifndef MSM_DIGITAL_CDC_H
#define MSM_DIGITAL_CDC_H #define MSM_DIGITAL_CDC_H
@@ -8,7 +8,7 @@
#define HPHL_PA_DISABLE (0x01 << 1) #define HPHL_PA_DISABLE (0x01 << 1)
#define HPHR_PA_DISABLE (0x01 << 2) #define HPHR_PA_DISABLE (0x01 << 2)
#define SPKR_PA_DISABLE (0x01 << 3) #define SPKR_PA_DISABLE (0x01 << 3)
#define MAX_REGULATOR 7
#define NUM_DECIMATORS 5 #define NUM_DECIMATORS 5
/* Codec supports 1 compander */ /* Codec supports 1 compander */
enum { enum {
@@ -25,30 +25,62 @@ enum {
MSM89XX_RX_MAX, MSM89XX_RX_MAX,
}; };
enum {
ON_DEMAND_DIGITAL = 0,
ON_DEMAND_DIG_SUPPLIES_MAX,
};
struct on_demand_dig_supply {
struct regulator *supply;
atomic_t ref;
int min_uv;
int max_uv;
int optimum_ua;
};
struct dig_cdc_regulator {
const char *name;
int min_uv;
int max_uv;
int optimum_ua;
struct regulator *regulator;
};
struct tx_mute_work { struct tx_mute_work {
struct msm_dig_priv *dig_cdc; struct msm_dig_priv *dig_cdc;
u32 decimator; u32 decimator;
struct delayed_work dwork; struct delayed_work dwork;
}; };
struct msm_cap_mode {
u8 micbias1_cap_mode;
u8 micbias2_cap_mode;
};
struct msm_dig_priv { struct msm_dig_priv {
struct snd_soc_component *component; struct snd_soc_component *component;
struct device *dev;
u32 comp_enabled[MSM89XX_RX_MAX]; u32 comp_enabled[MSM89XX_RX_MAX];
int (*codec_hph_comp_gpio)(bool enable, int (*codec_hph_comp_gpio)(bool enable,
struct snd_soc_component *component); struct snd_soc_component *component);
s32 dmic_1_2_clk_cnt; s32 dmic_1_2_clk_cnt;
s32 dmic_3_4_clk_cnt; s32 dmic_3_4_clk_cnt;
bool dec_active[NUM_DECIMATORS]; bool dec_active[NUM_DECIMATORS];
int version; int version;
/* cal info for codec */
struct fw_info *fw_data;
bool no_analog_codec;
/* Entry for version info */ /* Entry for version info */
struct snd_info_entry *entry; struct snd_info_entry *entry;
struct snd_info_entry *version_entry; struct snd_info_entry *version_entry;
char __iomem *dig_base; char __iomem *dig_base;
struct regmap *regmap; struct regmap *regmap;
struct notifier_block nblock; struct notifier_block nblock;
struct notifier_block service_nb;
u32 mute_mask; u32 mute_mask;
int dapm_bias_off; int dapm_bias_off;
void *handle; void *handle;
struct on_demand_dig_supply on_demand_list[ON_DEMAND_DIG_SUPPLIES_MAX];
void (*set_compander_mode)(void *handle, int val); void (*set_compander_mode)(void *handle, int val);
void (*update_clkdiv)(void *handle, int val); void (*update_clkdiv)(void *handle, int val);
int (*get_cdc_version)(void *handle); int (*get_cdc_version)(void *handle);
@@ -56,6 +88,9 @@ struct msm_dig_priv {
struct notifier_block *nblock, struct notifier_block *nblock,
bool enable); bool enable);
struct tx_mute_work tx_mute_dwork[NUM_DECIMATORS]; struct tx_mute_work tx_mute_dwork[NUM_DECIMATORS];
u32 num_of_supplies;
struct regulator_bulk_data *supplies;
struct dig_cdc_regulator regulator[MAX_REGULATOR];
}; };
struct dig_ctrl_platform_data { struct dig_ctrl_platform_data {
@@ -85,13 +120,16 @@ enum {
BAND_MAX, BAND_MAX,
}; };
#if IS_ENABLED(CONFIG_SND_SOC_DIGITAL_CDC) #if (IS_ENABLED(CONFIG_SND_SOC_DIGITAL_CDC) || \
IS_ENABLED(CONFIG_SND_SOC_DIGITAL_CDC_LEGACY))
extern void msm_dig_cdc_hph_comp_cb( extern void msm_dig_cdc_hph_comp_cb(
int (*codec_hph_comp_gpio)( int (*codec_hph_comp_gpio)(
bool enable, struct snd_soc_component *component), bool enable, struct snd_soc_component *component),
struct snd_soc_component *component); struct snd_soc_component *component);
int msm_dig_codec_info_create_codec_entry(struct snd_info_entry *codec_root, int msm_dig_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
struct snd_soc_component *component); struct snd_soc_component *component);
extern int msm_digcdc_mclk_enable(struct snd_soc_component *component,
int mclk_enable, bool dapm);
#else /* CONFIG_SND_SOC_DIGITAL_CDC */ #else /* CONFIG_SND_SOC_DIGITAL_CDC */
static inline void msm_dig_cdc_hph_comp_cb( static inline void msm_dig_cdc_hph_comp_cb(
int (*codec_hph_comp_gpio)( int (*codec_hph_comp_gpio)(
@@ -106,5 +144,10 @@ static inline int msm_dig_codec_info_create_codec_entry(
{ {
return 0; return 0;
} }
static inline int msm_digcdc_mclk_enable(struct snd_soc_component *component,
int mclk_enable, bool dapm)
{
return 0;
}
#endif /* CONFIG_SND_SOC_DIGITAL_CDC */ #endif /* CONFIG_SND_SOC_DIGITAL_CDC */
#endif #endif
+2 -2
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2019, 2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/module.h> #include <linux/module.h>
@@ -18,7 +18,7 @@
#include <soc/qcom/pm.h> #include <soc/qcom/pm.h>
#include <dsp/audio_cal_utils.h> #include <dsp/audio_cal_utils.h>
#include <asoc/core.h> #include <asoc/core.h>
#include "cpe_core.h" #include <asoc/cpe_core.h>
#include "cpe_err.h" #include "cpe_err.h"
#include "cpe_cmi.h" #include "cpe_cmi.h"
#include "wcd_cpe_core.h" #include "wcd_cpe_core.h"
+7 -6
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2018, 2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/module.h> #include <linux/module.h>
@@ -283,7 +283,7 @@ static enum cpe_svc_result cpe_is_command_valid(
static int cpe_register_read(u32 reg, u8 *val) static int cpe_register_read(u32 reg, u8 *val)
{ {
*(val) = snd_soc_read(cpe_d.cdc_priv, reg); *(val) = snd_soc_component_read32(cpe_d.cdc_priv, reg);
return 0; return 0;
} }
@@ -292,7 +292,7 @@ static enum cpe_svc_result cpe_update_bits(u32 reg,
{ {
int ret = 0; int ret = 0;
ret = snd_soc_update_bits(cpe_d.cdc_priv, reg, ret = snd_soc_component_update_bits(cpe_d.cdc_priv, reg,
mask, value); mask, value);
if (ret < 0) if (ret < 0)
return CPE_SVC_FAILED; return CPE_SVC_FAILED;
@@ -308,7 +308,7 @@ static int cpe_register_write(u32 reg, u32 val)
pr_debug("%s: reg = 0x%x, value = 0x%x\n", pr_debug("%s: reg = 0x%x, value = 0x%x\n",
__func__, reg, val); __func__, reg, val);
ret = snd_soc_write(cpe_d.cdc_priv, reg, val); ret = snd_soc_component_write(cpe_d.cdc_priv, reg, val);
if (ret < 0) if (ret < 0)
return CPE_SVC_FAILED; return CPE_SVC_FAILED;
@@ -317,8 +317,9 @@ static int cpe_register_write(u32 reg, u32 val)
static int cpe_register_write_repeat(u32 reg, u8 *ptr, u32 to_write) static int cpe_register_write_repeat(u32 reg, u8 *ptr, u32 to_write)
{ {
struct snd_soc_codec *codec = cpe_d.cdc_priv; struct snd_soc_component *component = cpe_d.cdc_priv;
struct wcd9xxx *wcd9xxx = dev_get_drvdata(codec->dev->parent); struct wcd9xxx *wcd9xxx =
snd_soc_component_get_drvdata(component);
int ret = 0; int ret = 0;
ret = wcd9xxx_slim_write_repeat(wcd9xxx, reg, to_write, ptr); ret = wcd9xxx_slim_write_repeat(wcd9xxx, reg, to_write, ptr);
+10 -12
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2013-2019, 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2019, 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/init.h> #include <linux/init.h>
@@ -14,6 +14,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/signal.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/lsm_params.h> #include <sound/lsm_params.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@@ -129,7 +130,7 @@ struct cpe_lsm_lab {
struct cpe_priv { struct cpe_priv {
void *core_handle; void *core_handle;
struct snd_soc_codec *codec; struct snd_soc_component *component;
struct wcd_cpe_lsm_ops lsm_ops; struct wcd_cpe_lsm_ops lsm_ops;
struct wcd_cpe_afe_ops afe_ops; struct wcd_cpe_afe_ops afe_ops;
bool afe_mad_ctl; bool afe_mad_ctl;
@@ -196,14 +197,14 @@ static struct cpe_priv *cpe_get_private_data(
rtd = substream->private_data; rtd = substream->private_data;
if (!rtd || !rtd->platform) { if (!rtd) {
pr_err("%s: %s is invalid\n", pr_err("%s: %s is invalid\n",
__func__, __func__,
(!rtd) ? "runtime" : "platform"); (!rtd) ? "runtime" : "platform");
goto err_ret; goto err_ret;
} }
return snd_soc_platform_get_drvdata(rtd->platform); return snd_soc_card_get_drvdata(rtd->card);
err_ret: err_ret:
return NULL; return NULL;
@@ -756,7 +757,7 @@ static int msm_cpe_lsm_open(struct snd_pcm_substream *substream)
struct wcd_cpe_lsm_ops *lsm_ops; struct wcd_cpe_lsm_ops *lsm_ops;
int rc = 0; int rc = 0;
if (!cpe || !cpe->codec) { if (!cpe || !cpe->component) {
dev_err(rtd->dev, dev_err(rtd->dev,
"%s: Invalid private data\n", "%s: Invalid private data\n",
__func__); __func__);
@@ -792,11 +793,11 @@ static int msm_cpe_lsm_open(struct snd_pcm_substream *substream)
return -EINVAL; return -EINVAL;
} }
cpe->core_handle = wcd_cpe_get_core_handle(cpe->codec); cpe->core_handle = wcd_cpe_get_core_handle(cpe->component);
if (!cpe->core_handle) { if (!cpe->core_handle) {
dev_err(rtd->dev, dev_err(rtd->dev,
"%s: Invalid handle to codec core\n", "%s: Invalid handle to component core\n",
__func__); __func__);
return -EINVAL; return -EINVAL;
} }
@@ -3215,7 +3216,6 @@ static int msm_asoc_cpe_lsm_probe(struct snd_soc_component *component)
{ {
struct snd_soc_card *card; struct snd_soc_card *card;
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
struct snd_soc_codec *codec;
struct cpe_priv *cpe_priv; struct cpe_priv *cpe_priv;
struct snd_soc_component *component_rtd = NULL; struct snd_soc_component *component_rtd = NULL;
const struct snd_kcontrol_new *kcontrol; const struct snd_kcontrol_new *kcontrol;
@@ -3259,14 +3259,12 @@ static int msm_asoc_cpe_lsm_probe(struct snd_soc_component *component)
port_id = 1; port_id = 1;
} }
codec = rtd->codec;
cpe_priv = kzalloc(sizeof(struct cpe_priv), cpe_priv = kzalloc(sizeof(struct cpe_priv),
GFP_KERNEL); GFP_KERNEL);
if (!cpe_priv) if (!cpe_priv)
return -ENOMEM; return -ENOMEM;
cpe_priv->codec = codec; cpe_priv->component = component;
cpe_priv->input_port_id = port_id; cpe_priv->input_port_id = port_id;
wcd_cpe_get_lsm_ops(&cpe_priv->lsm_ops); wcd_cpe_get_lsm_ops(&cpe_priv->lsm_ops);
wcd_cpe_get_afe_ops(&cpe_priv->afe_ops); wcd_cpe_get_afe_ops(&cpe_priv->afe_ops);
@@ -3317,7 +3315,7 @@ static int msm_cpe_lsm_probe(struct platform_device *pdev)
*/ */
static int msm_cpe_lsm_remove(struct platform_device *pdev) static int msm_cpe_lsm_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_commponent(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+111
View File
@@ -0,0 +1,111 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2015-2018, 2021, The Linux Foundation. All rights reserved.
*/
#ifndef __MSM8952_SLIMBUS_AUDIO
#define __MSM8952_SLIMBUS_AUDIO
#include <dsp/apr_audio-v2.h>
struct ext_intf_cfg {
atomic_t quat_mi2s_clk_ref;
atomic_t quin_mi2s_clk_ref;
atomic_t auxpcm_mi2s_clk_ref;
};
enum {
PRIM_MI2S = 0,
SEC_MI2S,
TERT_MI2S,
QUAT_MI2S,
QUIN_MI2S,
MI2S_MAX,
};
struct msm8952_codec {
void* (*get_afe_config_fn)(struct snd_soc_component *component,
enum afe_config_type config_type);
};
struct msm8952_asoc_mach_data {
int ext_pa;
int us_euro_gpio;
struct delayed_work hs_detect_dwork;
struct snd_soc_codec *codec;
struct msm8952_codec msm8952_codec_fn;
struct ext_intf_cfg clk_ref;
struct snd_info_entry *codec_root;
void __iomem *vaddr_gpio_mux_spkr_ctl;
void __iomem *vaddr_gpio_mux_mic_ctl;
void __iomem *vaddr_gpio_mux_pcm_ctl;
void __iomem *vaddr_gpio_mux_quin_ctl;
void __iomem *vaddr_gpio_mux_qui_pcm_sec_mode_ctl;
void __iomem *vaddr_gpio_mux_mic_ext_clk_ctl;
void __iomem *vaddr_gpio_mux_sec_tlmm_ctl;
struct device_node *us_euro_gpio_p;
struct device_node *mi2s_gpio_p[MI2S_MAX];
};
int msm_slim_0_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_0_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_1_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_2_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_4_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_5_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_6_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_slim_5_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_snd_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
int msm8952_slimbus_2_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_quin_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_btsco_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_proxy_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_proxy_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_tdm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_audrx_init(struct snd_soc_pcm_runtime *rtd);
int msm_mi2s_snd_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
int msm_snd_cpe_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
int msm_tdm_snd_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
int msm_quat_mi2s_snd_startup(struct snd_pcm_substream *substream);
void msm_quat_mi2s_snd_shutdown(struct snd_pcm_substream *substream);
int msm_quin_mi2s_snd_startup(struct snd_pcm_substream *substream);
void msm_quin_mi2s_snd_shutdown(struct snd_pcm_substream *substream);
int msm_auxpcm_be_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm_prim_auxpcm_startup(struct snd_pcm_substream *substream);
void msm_prim_auxpcm_shutdown(struct snd_pcm_substream *substream);
int msm_tdm_startup(struct snd_pcm_substream *substream);
void msm_tdm_shutdown(struct snd_pcm_substream *substream);
struct snd_soc_card *populate_snd_card_dailinks(struct device *dev);
int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int msm895x_wsa881x_init(struct snd_soc_component *component);
int msm8952_init_wsa_dev(struct platform_device *pdev,
struct snd_soc_card *card);
void msm895x_free_auxdev_mem(struct platform_device *pdev);
#endif
+3630
View File
File diff suppressed because it is too large. Load diff
+94
View File
@@ -0,0 +1,94 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2018-2019, 2021, The Linux Foundation. All rights reserved.
*/
#ifndef __MSM8953_H
#define __MSM8953_H
#include <sound/soc.h>
#include <dsp/q6afe-v2.h>
#include <asoc/wcd-mbhc-v2.h>
#include "codecs/sdm660_cdc/msm-analog-cdc.h"
#include "codecs/sdm660_cdc/msm-digital-cdc.h"
#include "codecs/wsa881x-analog.h"
#include <linux/regulator/consumer.h>
#include <linux/regulator/driver.h>
#define BTSCO_RATE_8KHZ 8000
#define BTSCO_RATE_16KHZ 16000
#define SAMPLING_RATE_48KHZ 48000
#define SAMPLING_RATE_96KHZ 96000
#define SAMPLING_RATE_192KHZ 192000
#define PRI_MI2S_ID (1 << 0)
#define SEC_MI2S_ID (1 << 1)
#define TER_MI2S_ID (1 << 2)
#define QUAT_MI2S_ID (1 << 3)
#define QUIN_MI2S_ID (1 << 4)
#define DEFAULT_MCLK_RATE 9600000
#define WCD_MBHC_DEF_RLOADS 5
#define MAX_WSA_CODEC_NAME_LENGTH 80
#define MSM_DT_MAX_PROP_SIZE 80
enum {
DIG_CDC,
ANA_CDC,
CODECS_MAX,
};
enum {
PRIM_MI2S = 0,
SEC_MI2S,
TERT_MI2S,
QUAT_MI2S,
QUIN_MI2S,
MI2S_MAX,
};
enum {
INT_SND_CARD,
INT_DIG_SND_CARD,
INT_MAX_SND_CARD = INT_DIG_SND_CARD,
EXT_SND_CARD_TASHA,
EXT_SND_CARD_TAVIL,
};
struct msm_asoc_mach_data {
int codec_type;
int ext_pa;
int us_euro_gpio;
int spk_ext_pa_gpio;
int mclk_freq;
bool native_clk_set;
int lb_mode;
int afe_clk_ver;
int snd_card_val;
u8 micbias1_cap_mode;
u8 micbias2_cap_mode;
atomic_t int_mclk0_rsc_ref;
atomic_t int_mclk0_enabled;
atomic_t wsa_int_mclk0_rsc_ref;
struct mutex cdc_int_mclk0_mutex;
struct mutex wsa_mclk_mutex;
struct delayed_work disable_int_mclk0_work;
struct afe_digital_clk_cfg digital_cdc_clk;
struct afe_clk_set digital_cdc_core_clk;
void __iomem *vaddr_gpio_mux_spkr_ctl;
void __iomem *vaddr_gpio_mux_mic_ctl;
void __iomem *vaddr_gpio_mux_quin_ctl;
void __iomem *vaddr_gpio_mux_pcm_ctl;
struct on_demand_supply wsa_switch_supply;
struct device_node *spk_ext_pa_gpio_p;
struct device_node *us_euro_gpio_p;
struct device_node *comp_gpio_p;
struct device_node *mi2s_gpio_p[MI2S_MAX];
struct device_node *dmic_gpio_p; /* used by pinctrl API */
struct snd_soc_codec *codec;
struct snd_info_entry *codec_root;
};
#endif/*__MSM8953_H*/
+40
View File
@@ -0,0 +1,40 @@
CONFIG_PINCTRL_WCD=m
CONFIG_AUDIO_EXT_CLK=m
CONFIG_SND_SOC_WCD9XXX_V2=m
CONFIG_SND_SOC_WCD_MBHC=m
CONFIG_SND_SOC_WCD_CPE=m
CONFIG_SND_SOC_CPE=m
CONFIG_SND_SOC_WSA881X=m
CONFIG_SND_SOC_WSA881X_ANALOG=m
CONFIG_SND_SOC_WCD9335=m
CONFIG_MSM_QDSP6V2_CODECS=m
CONFIG_MSM_ULTRASOUND=m
CONFIG_MSM_QDSP6_APRV2_RPMSG=m
CONFIG_MSM_ADSP_LOADER=m
CONFIG_REGMAP_SWR=m
CONFIG_MSM_QDSP6_SSR=m
CONFIG_MSM_QDSP6_NOTIFIER=m
CONFIG_SND_SOC_MSM_HOSTLESS_PCM=m
CONFIG_SND_SOC_MSM_QDSP6V2_INTF=m
CONFIG_SND_SOC_SDM450=m
CONFIG_SND_SOC_EXT_CODEC_SDM450=m
CONFIG_SOUNDWIRE=m
CONFIG_SOUNDWIRE_WCD_CTRL=m
CONFIG_SND_SOC_QDSP6V2=m
CONFIG_SND_SOC_MSM_QDSP6V2_INTF=m
CONFIG_WCD9XXX_CODEC_CORE=m
CONFIG_MSM_CDC_PINCTRL=m
CONFIG_SND_SOC_WCD_MBHC_LEGACY=m
CONFIG_QTI_PP=m
CONFIG_QTI_PP_AUDIOSPHERE=m
CONFIG_SND_HWDEP_ROUTING=m
CONFIG_DTS_EAGLE=m
CONFIG_DOLBY_DS2=m
CONFIG_DOLBY_LICENSE=m
CONFIG_DTS_SRS_TM=m
CONFIG_SND_SOC_MSM_STUB=m
CONFIG_SND_SOC_SDM660_CDC=m
CONFIG_SND_SOC_ANALOG_CDC=m
CONFIG_SND_SOC_DIGITAL_CDC_LEGACY=m
CONFIG_SND_SOC_MSM_HDMI_CODEC_RX=m
CONFIG_WCD_DSP_GLINK=m
+46
View File
@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2018, 2020-2021, The Linux Foundation. All rights reserved.
*/
#define CONFIG_PINCTRL_WCD 1
#define CONFIG_AUDIO_EXT_CLK 1
#define CONFIG_SND_SOC_WCD9XXX_V2 1
#define CONFIG_SND_SOC_WCD_CPE 1
#define CONFIG_SND_SOC_CPE 1
#define CONFIG_SND_SOC_WCD_MBHC 1
#define CONFIG_SND_SOC_WSA881X 1
#define CONFIG_SND_SOC_WSA881X_ANALOG 1
#define CONFIG_SND_SOC_WCD9335 1
#define CONFIG_MSM_QDSP6V2_CODECS 1
#define CONFIG_MSM_ULTRASOUND 1
#define CONFIG_MSM_QDSP6_APRV2_RPMSG 1
#define CONFIG_MSM_ADSP_LOADER 1
#define CONFIG_REGMAP_SWR 1
#define CONFIG_MSM_QDSP6_SSR 1
#define CONFIG_MSM_QDSP6_NOTIFIER 1
#define CONFIG_SND_SOC_MSM_HOSTLESS_PCM 1
#define CONFIG_SND_SOC_MSM_QDSP6V2_INTF 1
#define CONFIG_SND_SOC_SDM450 1
#define CONFIG_SND_SOC_EXT_CODEC_SDM450 1
#define CONFIG_SOUNDWIRE 1
#define CONFIG_SOUNDWIRE_WCD_CTRL 1
#define CONFIG_SND_SOC_WCD_MBHC_LEGACY 1
#define CONFIG_SND_SOC_QDSP6V2 1
#define CONFIG_QTI_PP 1
#define CONFIG_QTI_PP_AUDIOSPHERE 1
#define CONFIG_SND_HWDEP_ROUTING 1
#define CONFIG_DTS_EAGLE 1
#define CONFIG_DOLBY_DS2 1
#define CONFIG_DOLBY_LICENSE 1
#define CONFIG_DTS_SRS_TM 1
#define CONFIG_WCD9XXX_CODEC_CORE 1
#define CONFIG_MSM_CDC_PINCTRL 1
#define CONFIG_SND_SOC_MSM_STUB 1
#define CONFIG_SND_SOC_EXT_CODEC 1
#define CONFIG_SND_SOC_INT_CODEC 1
#define CONFIG_SND_SOC_SDM660_CDC 1
#define CONFIG_SND_SOC_ANALOG_CDC 1
#define CONFIG_SND_SOC_DIGITAL_CDC_LEGACY 1
#define CONFIG_SND_SOC_MSM_HDMI_CODEC_RX 1
#define CONFIG_COMMON_CLK 1
#define CONFIG_WCD_DSP_GLINK 1
+5 -1
View File
@@ -35,9 +35,13 @@ ifeq ($(call is-board-platform,sdm660),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m
endif endif
ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM450=m
endif
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
+15
View File
@@ -81,6 +81,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
+2 -2
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2017, 2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/module.h> #include <linux/module.h>
@@ -629,7 +629,7 @@ static int __init audio_notifier_init(void)
static int __init audio_notifier_init(void) static int __init audio_notifier_init(void)
{ {
audio_notifier_subsys_init(); audio_notifier_subsys_init();
audio_notifier_disable_service(AUDIO_NOTIFIER_PDR_SERVICE); audio_notifer_disable_service(AUDIO_NOTIFIER_PDR_SERVICE);
audio_notifier_late_init(); audio_notifier_late_init();
+5 -1
View File
@@ -27,9 +27,13 @@ ifeq ($(call is-board-platform,sdm660),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m
endif endif
ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM450=m
endif
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
+15
View File
@@ -63,6 +63,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows:
+3 -1
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2015-2019, 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2019, 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#ifndef __MSM_COMMON #ifndef __MSM_COMMON
@@ -86,6 +86,8 @@ struct sdm660_codec {
enum { enum {
INT_SND_CARD, INT_SND_CARD,
INT_DIG_SND_CARD,
INT_MAX_SND_CARD = INT_DIG_SND_CARD,
EXT_SND_CARD_TASHA, EXT_SND_CARD_TASHA,
EXT_SND_CARD_TAVIL, EXT_SND_CARD_TAVIL,
}; };
+5 -1
View File
@@ -35,9 +35,13 @@ ifeq ($(call is-board-platform,sdm660),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m
endif endif
ifeq ($(call is-board-platform-in-list, msm8953 msm8937),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM450=m
endif
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
+15
View File
@@ -82,6 +82,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows:
+6 -2
View File
@@ -35,9 +35,13 @@ ifeq ($(call is-board-platform,sdm660),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m
endif endif
ifeq ($(call is-board-platform-in-list,msm8953 msm8937),true)
AUDIO_SELECT := CONFIG_SND_SOC_SDM450=m
endif
AUDIO_CHIPSET := audio AUDIO_CHIPSET := audio
# Build/Package only in case of supported target # Build/Package only in case of supported target
ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660),true) ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike sdm660 msm8953 msm8937),true)
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
@@ -76,7 +80,7 @@ include $(DLKM_DIR)/AndroidKernelModule.mk
endif endif
endif endif
########################################################### ###########################################################
ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) kona sdm660), true) ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) kona sdm660 msm8953 msm8937), true)
ifneq ($(TARGET_BOARD_AUTO),true) ifneq ($(TARGET_BOARD_AUTO),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_wcd.ko LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_wcd.ko
+15
View File
@@ -81,6 +81,21 @@ ifeq ($(KERNEL_BUILD), 0)
export export
INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
endif endif
ifeq ($(CONFIG_ARCH_SDM450), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM439), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
ifeq ($(CONFIG_ARCH_MSM8917), y)
include $(AUDIO_ROOT)/config/sdm450auto.conf
export
INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
endif
endif endif
# As per target team, build is done as follows: # As per target team, build is done as follows: