浏览代码

Merge 17be5c5a10d3f8dfdc7dc3566abd4800b1c79b9c on remote branch

Change-Id: I8e2e38559d7919dd0b89c18a4294e3a487ec7acb
Linux Build Service Account 2 年之前
父节点
当前提交
0ec1e09757

+ 11 - 1
Android.mk

@@ -356,8 +356,18 @@ LOCAL_MODULE_TAGS         := optional
 LOCAL_MODULE_DEBUG_ENABLE := true
 LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
 include $(DLKM_DIR)/Build_external_kernelmodule.mk
-endif
 ###########################################################
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES           := $(AUDIO_SRC_FILES)
+LOCAL_MODULE              := hdmi_dlkm.ko
+LOCAL_MODULE_KBUILD_NAME  := asoc/codecs/hdmi_dlkm.ko
+LOCAL_MODULE_TAGS         := optional
+LOCAL_MODULE_DEBUG_ENABLE := true
+LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
+LOCAL_REQUIRED_MODULES    := msm-ext-disp-module-symvers
+LOCAL_ADDITIONAL_DEPENDENCIES := $(call intermediates-dir-for,DLKM,msm-ext-disp-module-symvers)/Module.symvers
+include $(DLKM_DIR)/Build_external_kernelmodule.mk
+endif
 
 ifeq ($(call is-board-platform-in-list, bengal),true)
 ###########################################################

+ 7 - 0
asoc/codecs/Kbuild

@@ -209,6 +209,10 @@ ifdef CONFIG_SND_SOC_WCD_MBHC_LEGACY
 	MBHC_OBJS += wcd-mbhc-legacy.o
 endif
 
+ifdef CONFIG_SND_SOC_MSM_HDMI_CODEC_RX
+	HDMICODEC_OBJS += msm_hdmi_codec_rx.o
+endif
+
 ifdef CONFIG_SND_SOC_WCD_IRQ
 	CORE_OBJS += wcd-irq.o
 endif
@@ -294,6 +298,9 @@ wcd_spi_dlkm-y := $(SPI_OBJS)
 obj-$(CONFIG_SND_SOC_WCD_MBHC) += mbhc_dlkm.o
 mbhc_dlkm-y := $(MBHC_OBJS)
 
+obj-$(CONFIG_SND_SOC_MSM_HDMI_CODEC_RX) += hdmi_dlkm.o
+hdmi_dlkm-y := $(HDMICODEC_OBJS)
+
 obj-$(CONFIG_SND_SWR_HAPTICS) += swr_haptics_dlkm.o
 swr_haptics_dlkm-y := $(SWR_HAP_OBJS)
 

+ 1 - 8
asoc/codecs/lpass-cdc/lpass-cdc-va-macro.c

@@ -450,14 +450,7 @@ static int lpass_cdc_va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
 					 &va_priv, __func__))
 		return -EINVAL;
 
-	if (!va_priv->use_lpi_mixer_control)
-		return 0;
-
-	dev_dbg(va_dev, "%s: event = %d, lpi_enable = %d\n",
-		__func__, event, va_priv->lpi_enable);
-
-	if (!va_priv->lpi_enable)
-		return ret;
+	dev_dbg(va_dev, "%s: event = %d\n",__func__, event);
 
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:

+ 15 - 0
asoc/codecs/msm_hdmi_codec_rx.c

@@ -59,6 +59,17 @@ static const char *const ext_disp_audio_type_text[] = {"None", "HDMI", "DP"};
 static const char *const ext_disp_audio_ack_text[] = {"Disconnect",  "Connect",
 						      "Ack_Enable"};
 
+static const struct snd_pcm_hardware dummy_dma_hardware = {
+	/* Random values to keep userspace happy when checking constraints */
+	.info               = SNDRV_PCM_INFO_INTERLEAVED |
+					SNDRV_PCM_INFO_BLOCK_TRANSFER,
+	.buffer_bytes_max   = 128*1024,
+	.period_bytes_min   = PAGE_SIZE,
+	.period_bytes_max   = PAGE_SIZE*2,
+	.periods_min        = 2,
+	.periods_max        = 128,
+};
+
 SOC_EXT_DISP_AUDIO_TYPE(1);
 SOC_EXT_DISP_AUDIO_ACK_STATE(1);
 SOC_EXT_DISP_AUDIO_TYPE(2);
@@ -516,6 +527,7 @@ static int msm_ext_disp_audio_codec_rx_dai_startup(
 	struct msm_ext_disp_audio_codec_rx_data *codec_data =
 			dev_get_drvdata(dai->component->dev);
 	int type;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 
 	if (!codec_data) {
 		dev_err_ratelimited(dai->dev, "%s() codec_data is null\n",
@@ -523,6 +535,9 @@ static int msm_ext_disp_audio_codec_rx_dai_startup(
 		return -EINVAL;
 	}
 
+	if (!rtd->dai_link->no_pcm)
+		snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware);
+
 	dev_dbg(dai->component->dev, "%s: DP ctl id %d Stream id %d\n",
 		__func__,
 		codec_data->ctl[dai->id], codec_data->stream[dai->id]);

+ 11 - 0
asoc/codecs/wcd-mbhc-v2.c

@@ -1141,6 +1141,17 @@ static irqreturn_t wcd_mbhc_mech_plug_detect_irq(int irq, void *data)
 	struct wcd_mbhc *mbhc = data;
 
 	pr_debug("%s: enter\n", __func__);
+
+	/* WCD USB AATC did not required mech plug detection, will receive
+	 * insertion/removal events from UCSI layer
+	 */
+#if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C)
+	if (mbhc->mbhc_cfg->enable_usbc_analog) {
+		pr_debug("%s: leave, (irq_none)", __func__);
+		return IRQ_NONE;
+	}
+#endif
+
 	if (mbhc == NULL) {
 		pr_err("%s: NULL irq data\n", __func__);
 		return IRQ_NONE;

+ 2 - 2
asoc/msm_common.c

@@ -1157,8 +1157,8 @@ int msm_common_dai_link_init(struct snd_soc_pcm_runtime *rtd)
 			pdata->id = SLIM;
 		} else {
 			pdata->id = CODEC_DMA;
-			if (rtd->num_codecs <= MAX_CODEC_DAI) {
-				pdata->num_codec_dai = rtd->num_codecs;
+			if (rtd->dai_link->num_codecs <= MAX_CODEC_DAI) {
+				pdata->num_codec_dai = rtd->dai_link->num_codecs;
 				for_each_rtd_codec_dais(rtd, index, codec_dai) {
 					pdata->dai[index] = codec_dai;
 				}

+ 1 - 0
audio_kernel_modules.mk

@@ -33,6 +33,7 @@ AUDIO_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/q6_notifier_dlkm.ko\
 ifneq ($(call is-board-platform-in-list,bengal), true)
 AUDIO_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/swr_dmic_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/swr_haptics_dlkm.ko \
+	$(KERNEL_MODULES_OUT)/hdmi_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/lpass_cdc_wsa2_macro_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/lpass_cdc_wsa_macro_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/lpass_cdc_va_macro_dlkm.ko \

+ 1 - 0
audio_kernel_product_board.mk

@@ -20,6 +20,7 @@ PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/q6_notifier_dlkm.ko\
 ifneq ($(call is-board-platform-in-list,bengal), true)
 PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/swr_dmic_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/swr_haptics_dlkm.ko \
+	$(KERNEL_MODULES_OUT)/hdmi_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/lpass_cdc_wsa2_macro_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/lpass_cdc_wsa_macro_dlkm.ko \
 	$(KERNEL_MODULES_OUT)/lpass_cdc_va_macro_dlkm.ko \

+ 1 - 0
config/pineappleauto.conf

@@ -34,4 +34,5 @@ export CONFIG_SND_SOC_WCD_MBHC=m
 export CONFIG_SND_SOC_WCD_MBHC_ADC=m
 export CONFIG_SND_SWR_HAPTICS=m
 export CONFIG_SND_SOC_MSM_STUB=m
+export CONFIG_SND_SOC_MSM_HDMI_CODEC_RX=m
 export CONFIG_SND_SOC_SWR_DMIC=m

+ 1 - 0
config/pineappleautoconf.h

@@ -41,5 +41,6 @@
 #define CONFIG_SND_SOC_WCD_MBHC_ADC 1
 #define CONFIG_SND_SWR_HAPTICS 1
 #define CONFIG_SND_SOC_MSM_STUB 1
+#define CONFIG_SND_SOC_MSM_HDMI_CODEC_RX 1
 #define CONFIG_MSM_EXT_DISPLAY 1
 #define CONFIG_SND_SOC_SWR_DMIC 1

+ 14 - 1
dsp/spf-core.c

@@ -26,6 +26,7 @@
 
 #define APM_STATE_READY_TIMEOUT_MS    10000
 #define Q6_READY_TIMEOUT_MS 1000
+#define Q6_CLOSE_ALL_TIMEOUT_MS 5000
 #define APM_CMD_GET_SPF_STATE 0x01001021
 #define APM_CMD_CLOSE_ALL 0x01001013
 #define APM_CMD_RSP_GET_SPF_STATE 0x02001007
@@ -239,8 +240,20 @@ void spf_core_apm_close_all(void)
 		goto done;
 	}
 
+
+	/* While graph_open is processing by the SPF, apps receives
+	 * userspace(agm/pal) crash which will triggers spf_close_all
+	 * cmd from msm common drivers and immediately calls
+	 * msm_audio_ion_crash_handler() which will un-maps the memory. But
+	 * here SPF is still in processing the graph_open, recieved spf_close_all
+	 * cmd is queued in SPF. Due to un-mapping is done immediately in HLOS
+	 * will resulting in SMMU fault.
+	 * To avoid such scenarios, increased the spf_close_all cmd timeout,
+	 * because the AGM timeout for the graph_open is 4sec, so increase the timeout
+	 * for spf_close_all cmd response until graph open completes or timed out.
+	*/
 	rc = wait_event_timeout(core->wait, (core->resp_received),
-				msecs_to_jiffies(Q6_READY_TIMEOUT_MS));
+				msecs_to_jiffies(Q6_CLOSE_ALL_TIMEOUT_MS));
 	dev_info_ratelimited(spf_core_priv->dev, "%s: wait event unblocked \n", __func__);
 	if (rc > 0 && core->resp_received) {
 		if (core->status != 0)