Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 83c68122 authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'LA.UM.9.14.r1-19500-LAHAINA.QSSI12.0' of...

Merge tag 'LA.UM.9.14.r1-19500-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel into android12-5.4-lahaina

"LA.UM.9.14.r1-19500-LAHAINA.QSSI12.0"

* tag 'LA.UM.9.14.r1-19500-LAHAINA.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/opensource/audio-kernel:
  ASoC: optimize automotive routing drivers
  ASOC: automotive routing drivers base version
  Revert "ASOC: Disable Temperature sensor of WSA881x for bengal"
  asoc: add afe limiter disable kcontrol and fix ULLPP index mismatch
  asoc: codec: Fix error  makefile: Fix error and add version information
  ASOC: talos: update dai-link port-config for talos
  ASoC: wcd937x: Update QCRG sequence for wcd937x
  dsp: lower the log lever of ADSP_EALREADY
  dsp: Remove error log when there is no AFE cal data
  asoc: reduce HS TDM widget connection when it's disabled
  soc: remove tdm slot mask invalid err log in multi lane case
  asoc: Add VI feedback dai_link for bengal
  asoc: msm: Add VI feedback mixer
  asoc: wsa881x: Add mixer for speaker protection
  ASOC: update sm6150 machine driver
  asoc: wcd937x: update mic bias registers for new fab
  ASOC: talos: update dai-link port-config for talos
  asoc: codec: Fix CFI error caused by missing members
  ASOC: update wcd934x codec driver
  ASOC: update sm6150 machine driver
  ASoC: wcd-spi: Fix dma alloc compilation errors
  makefile: add config support for audio techpack for QCS610
  ASoC: codecs: wsa881x: add codec dai for each wsa881x
  soc: swr-mstr-ctrl: Fix SWR cmd FIFO overflow error
  ASOC: ext-clk: Fix hw init issue caused by CLK upgrade
  asoc: Set clock index correctly in mi2s slave mode
  asoc:msm-lsm-client: potential deadlock fix
  ASoC: msm: support multi group matrix mixer configure for SSMD mode
  msm-audio: adding mixer control for soft step volume params
  dsp: support ADM output map for less then 2 channels
  asoc: Enable all LPAIF interface
  asoc: afe: Add afe dyn mclk kcontrol
  ASOC: Disable Temperature sensor of WSA881x for bengal
  asoc: refine dummy machine driver for gen3
  ASoC: msm: extend app type cfg mixer command with copp mode
  ASoC: bitra: Add support for VI sense backend
  asoc: copyright fix
  ASoC : add support for MultiMedia17
  dsp: Update adsp packet timeout in voice drv
  ASoC: Unmap lab buffer during listen session close
  audio-kernel: change the maxnum for stream in QACT
  asoc: set default value for port_id of logging kcontrol
  ASoc: bolero: update logic to disable VA_MCLK
  ASoC: bolero: Disable va_swr gpio on clk failure
  dsp: add new boot cmd for early audio
  ARM: dts: msm: Change default state to sleep
  audio-kernel: lvgvm 8295 related file modify
  asoc: bengal: fix dailink init error
  asoc: msm_stub: increase the max ch to 32
  asoc: QUAT TDM support for dummy machine driver
  dsp: Make synchronous call to unmap afe cal data
  dsp:q6afe: Fix avcs load module failure for aptx
  ASoC: msm: Fix ASRC port type mismatch
  soc: add snd_event_init func for mark audio KPI
  ASoC: wcd937x: Update EAR PA CnP FSM sequence
  asoc: fix error for VA_CDC_DMA_TX_0 for bengal
  asoc: codec: enable use_single_read for wsa and wcd regmap
  config: sa8155/sa6155/gvmq: remove unused config vars
  asoc: fix compile warning of format-extra-args
  soc: swr-mstr-ctrl: Move to CPU-1 FIFO for swr register read/write
  ipc: apr_vm: change the priority of apr_vm_cb_threa
  asoc: get and put for TERT_TDM_TX_0 ADM channels
  dsp: Reslove audiodlkm code warning
  asoc: Reslove audiodlkm error & warn & issues
  asoc: add drift support for mi2s interface
  ASoC: add LXC audio config for auto sa8295 platform
  asoc: enable mclk1 for audio bring up
  ASoC: wsa883x: Enable all WSA interrupts
  asoc: wsa883x: add slave_irq for wsa883x
  asoc: wsa883x: update irq_drv_data per wsa device
  ASoC: mbhc-adc: Prevent lineout from being reported two times
  ASoC: Lahaina: correction to CPS payload
  ASoC: wcd937x: Add change for LDOL VOUT accuracy calibration
  ASoC: wcd937x: Update register value for new fab id for tanggu
  ASoC: wcd937x: Add change to micbias reg for new tanggu fab id
  Revert "ASoC: wsa883x: Add check before enable/disable PDM WD irq"
  ASoC: Add proper routing for vi ch and cdc dma format widgets
  asoc: set min period size of capture/playback to 120
  dsp: bugfix for memory leak in error handling path
  config: fix compile issue
  asoc: Update the dai link IDs for MI2S dai links
  ASoC: msm-dai-q6-v2: Add separate cpu dais for mi2s rx and tx

Change-Id: I0d9cf31f1ef60c754451ef86589cf91d29f8d682
parents 5840d3cb 41136341
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ endif
ifeq ($(CONFIG_ARCH_SA6155), y)
include $(srctree)/techpack/audio/config/sa6155auto.conf
endif
ifeq ($(CONFIG_ARCH_SM6150), y)
include $(srctree)/techpack/audio/config/sm6150auto.conf
endif
endif
# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE     += \
@@ -79,7 +82,10 @@ ifeq ($(CONFIG_ARCH_SA6155), y)
LINUXINCLUDE    += \
                -include $(srctree)/techpack/audio/config/sa6155autoconf.h
endif

ifeq ($(CONFIG_ARCH_SM6150), y)
LINUXINCLUDE    += \
                -include $(srctree)/techpack/audio/config/sm6150autoconf.h
endif
obj-y += soc/
obj-y += dsp/
obj-y += ipc/
+4 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ obj-m += asoc/
obj-m += asoc/codecs/
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdmsteppe))
obj-m += asoc/codecs/wcd934x/
KBUILD_CFLAGS += -Wno-error
endif
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x))
obj-m += asoc/codecs/bolero/
@@ -43,20 +44,20 @@ obj-m += asoc/codecs/bolero/
obj-m += asoc/codecs/wcd937x/
endif

ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa6155 sa8195 qtiquingvm qtiquingvm8295))
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa6155 sa8195 qtiquingvm qtiquingvm8295 sa8295 qtigvmi3))
KBUILD_OPTIONS += CONFIG_SND_SOC_AUTO=y
obj-m := ipc/
obj-m += dsp/
obj-m += asoc/
obj-m += asoc/codecs/
obj-m += soc/
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa8195))
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa8195 sa8295))
KBUILD_OPTIONS += CONFIG_SND_SOC_SA8155=m
endif
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa6155))
KBUILD_OPTIONS += CONFIG_SND_SOC_SA6155=m
endif
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qtiquingvm))
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qtiquingvm qtigvmi3))
KBUILD_OPTIONS += CONFIG_SND_SOC_GVM=m
endif
ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qtiquingvm8295))
+12 −5
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ endif
# for SM6150 sound card driver
ifdef CONFIG_SND_SOC_SM6150
	MACHINE_OBJS += sm6150.o
	MACHINE_OBJS += machine_615x_init.o
endif

# For sa6155 sound card driver
@@ -211,12 +210,20 @@ ifdef CONFIG_SND_SOC_QDSP6V2
	PLATFORM_OBJS += msm-pcm-loopback-v2.o
	PLATFORM_OBJS += msm-pcm-q6-noirq.o
	PLATFORM_OBJS += msm-pcm-q6-v2.o
	ifeq (y,$(findstring y,$(CONFIG_QTI_QUIN_GVM) $(CONFIG_PLATFORM_AUTO)))
		PLATFORM_OBJS += msm-pcm-routing-auto.o
	else
		PLATFORM_OBJS += msm-pcm-routing-v2.o
		PLATFORM_OBJS += msm-pcm-voice-v2.o
		PLATFORM_OBJS += msm-pcm-voip-v2.o
	endif
	PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
	ifeq (y,$(findstring y,$(CONFIG_QTI_QUIN_GVM) $(CONFIG_PLATFORM_AUTO)))
		PLATFORM_OBJS += platform_init_auto.o
	else
		PLATFORM_OBJS += platform_init.o
	endif
endif
ifdef CONFIG_WCD9XXX_CODEC_CORE
	PLATFORM_OBJS += msm-dai-slim.o
endif

techpack/audio/asoc/bengal.c

100644 → 100755
+71 −28
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/clk.h>
@@ -557,6 +558,7 @@ static void *def_wcd_mbhc_cal(void);
static void *def_rouleur_mbhc_cal(void);

static int msm_int_audrx_init(struct snd_soc_pcm_runtime*);
static int msm_aux_codec_init(struct snd_soc_pcm_runtime*);

/*
 * Need to report LINEIN
@@ -930,8 +932,6 @@ static int usb_audio_tx_format_get(struct snd_kcontrol *kcontrol,
static int usb_audio_tx_format_put(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{
	int rc = 0;

	switch (ucontrol->value.integer.value[0]) {
	case 3:
		usb_tx_cfg.bit_format = SNDRV_PCM_FORMAT_S32_LE;
@@ -951,7 +951,7 @@ static int usb_audio_tx_format_put(struct snd_kcontrol *kcontrol,
		 __func__, usb_tx_cfg.bit_format,
		 ucontrol->value.integer.value[0]);

	return rc;
	return 0;
}

static int usb_audio_rx_ch_get(struct snd_kcontrol *kcontrol,
@@ -2098,7 +2098,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable)
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	int port_id = 0;
	int index = cpu_dai->id;
	/* Rx and Tx DAIs should use same clk index */
	int index = (cpu_dai->id) / 2;

	port_id = msm_get_port_id(rtd->dai_link->id);
	if (port_id < 0) {
@@ -3931,7 +3932,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
	int ret = 0;
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	int index = cpu_dai->id;
	/* Rx and Tx DAIs should use same clk index */
	int index = (cpu_dai->id) / 2;
	unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS;
	struct snd_soc_card *card = rtd->card;
	struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
@@ -3956,10 +3958,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
	mutex_lock(&mi2s_intf_conf[index].lock);
	if (++mi2s_intf_conf[index].ref_cnt == 1) {
		/* Check if msm needs to provide the clock to the interface */
		if (!mi2s_intf_conf[index].msm_is_mi2s_master) {
		if (!mi2s_intf_conf[index].msm_is_mi2s_master)
			mi2s_clk[index].clk_id = mi2s_ebit_clk[index];
			fmt = SND_SOC_DAIFMT_CBM_CFM;
		}
		ret = msm_mi2s_set_sclk(substream, true);
		if (ret < 0) {
			dev_err(rtd->card->dev,
@@ -3968,12 +3968,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
			goto clean_up;
		}

		ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
		if (ret < 0) {
			pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n",
				__func__, index, ret);
			goto clk_off;
		}
		if (pdata->mi2s_gpio_p[index]) {
			if (atomic_read(&(pdata->mi2s_gpio_ref_count[index]))
									== 0) {
@@ -3988,6 +3982,14 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
			atomic_inc(&(pdata->mi2s_gpio_ref_count[index]));
		}
	}
	if (!mi2s_intf_conf[index].msm_is_mi2s_master)
		fmt = SND_SOC_DAIFMT_CBM_CFM;
	ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
	if (ret < 0) {
		pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n",
			__func__, index, ret);
		goto clk_off;
	}
clk_off:
	if (ret < 0)
		msm_mi2s_set_sclk(substream, false);
@@ -4003,7 +4005,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream)
{
	int ret = 0;
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	int index = rtd->cpu_dai->id;
	/* Rx and Tx DAIs should use same clk index */
	int index = (rtd->cpu_dai->id) / 2;
	struct snd_soc_card *card = rtd->card;
	struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);

@@ -4259,25 +4262,19 @@ static void msm_add_auxpcm_snd_controls(struct snd_soc_component *component)

static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
{
	int ret = -EINVAL;
	struct snd_soc_component *component;
	struct snd_soc_component *bolero_component = NULL;
	struct snd_soc_dapm_context *dapm;
	struct snd_card *card;
	struct snd_info_entry *entry;
	struct platform_device *pdev = NULL;
	int i = 0;
	char *data = NULL;
	struct snd_soc_component *component = NULL;
	struct snd_soc_dapm_context *dapm = NULL;
	struct snd_card *card = NULL;
	struct snd_info_entry *entry = NULL;
	struct msm_asoc_mach_data *pdata =
				snd_soc_card_get_drvdata(rtd->card);
	int ret = -EINVAL;

	component = snd_soc_rtdcom_lookup(rtd, "bolero_codec");
	if (!component) {
		pr_err("%s: could not find component for bolero_codec\n",
			__func__);
		return ret;
	} else {
		bolero_component = component;
	}

	dapm = snd_soc_component_get_dapm(component);
@@ -4332,6 +4329,29 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
	bolero_info_create_codec_entry(pdata->codec_root, component);
	bolero_register_wake_irq(component, false);

err:
	return ret;
}

static int msm_aux_codec_init(struct snd_soc_pcm_runtime *rtd)
{
	int ret = -EINVAL;
	struct snd_soc_component *component = NULL;
	struct snd_soc_component *bolero_component = NULL;
	struct snd_soc_dapm_context *dapm = NULL;
	struct snd_card *card = NULL;
	struct snd_info_entry *entry;
	char *data = NULL;
	struct msm_asoc_mach_data *pdata =
				snd_soc_card_get_drvdata(rtd->card);

	bolero_component = snd_soc_rtdcom_lookup(rtd, "bolero_codec");
	if (!bolero_component) {
		pr_err("%s: could not find component for bolero_codec\n",
			__func__);
		return -EINVAL;
	}

	component = snd_soc_rtdcom_lookup(rtd, ROULEUR_DRV_NAME);
	if (!component)
		component = snd_soc_rtdcom_lookup(rtd, WCD937X_DRV_NAME);
@@ -4355,6 +4375,18 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
	snd_soc_dapm_ignore_suspend(dapm, "AMIC4");
	snd_soc_dapm_sync(dapm);

	if (!pdata->codec_root) {
		entry = msm_snd_info_create_subdir(card->module, "codecs",
						 card->proc_root);
		if (!entry) {
			dev_dbg(component->dev, "%s: Cannot create codecs module entry\n",
				 __func__);
			ret = 0;
			goto err;
		}
		pdata->codec_root = entry;
	}

	if (wcd_datalane_mismatch) {
		bolero_set_port_map(component,
				ARRAY_SIZE(sm_port_map_khaje),
@@ -4951,6 +4983,17 @@ static struct snd_soc_dai_link msm_common_misc_fe_dai_links[] = {
		.ops = &msm_cdc_dma_be_ops,
		SND_SOC_DAILINK_REG(tx_cdcdma5_tx),
	},
	{/* hw:x,39 */
		.name = "TX4_CDC_DMA Hostless",
		.stream_name = "TX4_CDC_DMA Hostless",
		.dynamic = 1,
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
			    SND_SOC_DPCM_TRIGGER_POST},
		.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
		.ignore_suspend = 1,
		SND_SOC_DAILINK_REG(tx4_cdcdma_hostless),
	},
};

static struct snd_soc_dai_link msm_common_be_dai_links[] = {
@@ -5391,7 +5434,7 @@ static struct snd_soc_dai_link msm_rx_tx_cdc_dma_be_dai_links[] = {
		.ignore_suspend = 1,
		.ops = &msm_cdc_dma_be_ops,
		SND_SOC_DAILINK_REG(rx_dma_rx0),
		.init = &msm_int_audrx_init,
		.init = &msm_aux_codec_init,
	},
	{
		.name = LPASS_BE_RX_CDC_DMA_RX_1,
@@ -5469,12 +5512,12 @@ static struct snd_soc_dai_link msm_va_cdc_dma_be_dai_links[] = {
		.stream_name = "VA CDC DMA0 Capture",
		.no_pcm = 1,
		.dpcm_capture = 1,
		.init = &msm_int_audrx_init,
		.id = MSM_BACKEND_DAI_VA_CDC_DMA_TX_0,
		.be_hw_params_fixup = msm_be_hw_params_fixup,
		.ignore_suspend = 1,
		.ops = &msm_cdc_dma_be_ops,
		SND_SOC_DAILINK_REG(va_dma_tx0),
		.init = &msm_int_audrx_init,
	},
	{
		.name = LPASS_BE_VA_CDC_DMA_TX_1,
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ ifdef CONFIG_WCD9XXX_CODEC_CORE
	WCD9XXX_OBJS += wcd9xxx-resmgr-v2.o
	WCD9XXX_OBJS += wcd-dsp-utils.o
	WCD9XXX_OBJS += wcd-dsp-mgr.o
	WCD9XXX_OBJS += wcd-clsh.o
else
	WCD9XXX_OBJS += wcd-clsh.o
endif
Loading