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

Commit d43448c9 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 7743f757 on remote branch

Change-Id: I243f3f1960800fe5e97d69463c5d23f25afbbadb
parents baaf1e5b 7743f757
Loading
Loading
Loading
Loading

Makefile.am

100644 → 100755
+2 −2
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ obj-m += asoc/codecs/bolero/
obj-m += asoc/codecs/wcd937x/
endif

ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa6155 sa8195 qtiquingvm qtiquingvm8295 sa8295))
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/
@@ -56,7 +56,7 @@ 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))
+43 −12
Original line number Diff line number Diff line
@@ -557,6 +557,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
@@ -4260,25 +4261,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);
@@ -4333,6 +4328,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);
@@ -4356,6 +4374,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),
@@ -5392,6 +5422,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_aux_codec_init,
	},
	{
		.name = LPASS_BE_RX_CDC_DMA_RX_1,
@@ -5469,12 +5500,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,
+4 −0
Original line number Diff line number Diff line
@@ -704,6 +704,10 @@ static int va_macro_tx_va_mclk_enable(struct va_macro_priv *va_priv,
							   TX_CORE_CLK,
							   false);
			if (ret < 0) {
				if (va_priv->swr_clk_users == 0) {
					msm_cdc_pinctrl_select_sleep_state(
							va_priv->va_swr_gpio_p);
				}
				dev_err_ratelimited(va_priv->dev,
					"%s: swr request clk failed\n",
					__func__);
+3 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2011-2014, 2017-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
 */
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -18,7 +19,7 @@ static struct snd_soc_dai_driver msm_stub_dais[] = {
		.playback = { /* Support maximum range */
			.stream_name = "Playback",
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 32,
			.rates = SNDRV_PCM_RATE_8000_48000,
			.formats = SNDRV_PCM_FMTBIT_S16_LE,
		},
@@ -28,7 +29,7 @@ static struct snd_soc_dai_driver msm_stub_dais[] = {
		.capture = { /* Support maximum range */
			.stream_name = "Record",
			.channels_min = 1,
			.channels_max = 8,
			.channels_max = 32,
			.rates = SNDRV_PCM_RATE_8000_48000,
			.formats = (SNDRV_PCM_FMTBIT_S16_LE |
				    SNDRV_PCM_FMTBIT_S24_LE),

asoc/gvm_auto_spf_dummy.c

100644 → 100755
+274 −75
Original line number Diff line number Diff line
@@ -258,6 +258,170 @@ static struct snd_soc_dai_link msm_common_dai_links[] = {
		.ignore_pmdown_time = 1,
		SND_SOC_DAILINK_REG(lpass_be_auxpcm_tx_dummy),
	},
	{
		.name = "QUAT_TDM_RX_0_DUMMY",
		.stream_name = "TDM-LPAIF-RX-QUATERNARY",
		.dpcm_playback = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
					SND_SOC_DPCM_TRIGGER_POST},
		.ignore_suspend = 1,
		.ignore_pmdown_time = 1,
		SND_SOC_DAILINK_REG(quat_tdm_rx_0_dummy),
	},
	{
		.name = "QUAT_TDM_TX_0_DUMMY",
		.stream_name = "TDM-LPAIF-TX-QUATERNARY",
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
					SND_SOC_DPCM_TRIGGER_POST},
		.ignore_suspend = 1,
		.ignore_pmdown_time = 1,
		SND_SOC_DAILINK_REG(quat_tdm_tx_0_dummy),
	},
};

static struct snd_soc_dai_link msm_gvm8295_dai_links[] = {
	/* BackEnd DAI Links */
	{
	.name = "PRI_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-PRIMARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(primary_tdm_rx_0_dummy),
	},
	{
	.name = "PRI_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-PRIMARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(primary_tdm_tx_0_dummy),
	},
	{
	.name = "SEC_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-SECONDARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(secondary_tdm_rx_0_dummy),
	},
	{
	.name = "SEC_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-SECONDARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(secondary_tdm_tx_0_dummy),
	},
	{
	.name = "TERT_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-TERTIARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(tert_tdm_rx_0_dummy),
	},
	{
	.name = "TERT_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-TERTIARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(tert_tdm_tx_0_dummy),
	},
	{
	.name = "QUAT_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-QUATERNARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(quat_tdm_rx_0_dummy),
	},
	{
	.name = "QUAT_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-QUATERNARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(quat_tdm_tx_0_dummy),
	},
	{
	.name = "QUIN_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-QUINARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(quin_tdm_rx_0_dummy),
	},
	{
	.name = "QUIN_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-QUINARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(quin_tdm_tx_0_dummy),
	},
	{
	.name = "SEN_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-SENARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(sen_tdm_rx_0_dummy),
	},
	{
	.name = "SEN_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-SENARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(sen_tdm_tx_0_dummy),
	},
	{
	.name = "SEP_TDM_RX_0_DUMMY",
	.stream_name = "TDM-LPAIF-RX-SEPTENARY",
	.dpcm_playback = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(sep_tdm_rx_0_dummy),
	},
	{
	.name = "SEP_TDM_TX_0_DUMMY",
	.stream_name = "TDM-LPAIF-TX-SEPTENARY",
	.dpcm_capture = 1,
	.trigger = {SND_SOC_DPCM_TRIGGER_POST,
				SND_SOC_DPCM_TRIGGER_POST},
	.ignore_suspend = 1,
	.ignore_pmdown_time = 1,
	SND_SOC_DAILINK_REG(sep_tdm_tx_0_dummy),
	},
};

static struct snd_soc_dai_link msm_talos_dai_links[] = {
@@ -302,6 +466,26 @@ static struct snd_soc_dai_link msm_talos_dai_links[] = {
		.ignore_pmdown_time = 1,
		SND_SOC_DAILINK_REG(lpass_be_auxpcm_tx_dummy),
	},
	{
		.name = "QUAT_TDM_RX_0_DUMMY",
		.stream_name = "TDM-LPAIF-RX-QUATERNARY",
		.dpcm_playback = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
					SND_SOC_DPCM_TRIGGER_POST},
		.ignore_suspend = 1,
		.ignore_pmdown_time = 1,
		SND_SOC_DAILINK_REG(quat_tdm_rx_0_dummy),
	},
	{
		.name = "QUAT_TDM_TX_0_DUMMY",
		.stream_name = "TDM-LPAIF-TX-QUATERNARY",
		.dpcm_capture = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST,
					SND_SOC_DPCM_TRIGGER_POST},
		.ignore_suspend = 1,
		.ignore_pmdown_time = 1,
		SND_SOC_DAILINK_REG(quat_tdm_tx_0_dummy),
	},
};

struct snd_soc_card snd_soc_card_auto_hana_dummy_msm = {
@@ -312,6 +496,10 @@ struct snd_soc_card snd_soc_card_auto_talos_dummy_msm = {
	.name = "gvmauto-6155-snd-card",
};

struct snd_soc_card snd_soc_card_auto_makena_dummy_msm = {
	.name = "gvmauto-8295-snd-card",
};

static int msm_populate_dai_link_component_of_node(
					struct snd_soc_card *card)
{
@@ -415,6 +603,8 @@ static const struct of_device_id gvm_asoc_machine_of_match[] = {
		.data = "adp_star_codec"},
	{ .compatible = "qcom,6155-spf-asoc-snd-adp-star",
		.data = "adp_star_codec"},
	{ .compatible = "qcom,gvm-auto-spf-asoc-snd-adp-star",
		.data = "adp_star_codec"},
	{},
};
static struct snd_soc_dai_link msm_auto_dai_links[
@@ -423,6 +613,9 @@ static struct snd_soc_dai_link msm_auto_dai_links[
static struct snd_soc_dai_link msm_auto_talos_dai_links[
			 ARRAY_SIZE(msm_talos_dai_links)];

static struct snd_soc_dai_link msm_auto_gvm8295_dai_links[
			 ARRAY_SIZE(msm_gvm8295_dai_links)];

static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
{
	struct snd_soc_card *card = NULL;
@@ -451,8 +644,14 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
		memcpy(msm_auto_talos_dai_links,
			msm_talos_dai_links,
			sizeof(msm_talos_dai_links));

		dailink = msm_auto_talos_dai_links;
	} else if (!strcmp(match->compatible, "qcom,gvm-auto-spf-asoc-snd-adp-star")) {
		card = &snd_soc_card_auto_makena_dummy_msm;
		total_links = ARRAY_SIZE(msm_gvm8295_dai_links);
		memcpy(msm_auto_gvm8295_dai_links,
			msm_gvm8295_dai_links,
			sizeof(msm_gvm8295_dai_links));
		dailink = msm_auto_gvm8295_dai_links;
	}

	if (card) {
Loading