summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2020-03-11 10:16:06 -0700
committerLinux Build Service Account <lnxbuild@localhost>2020-03-11 10:16:06 -0700
commitac42fe0d68e839d0240031ae0d91ff3975b9bc5c (patch)
treeffae85eabc479f0eac83c346f3fdf9d24a2474a5
parent995f67d4542421f849633d167fa33d2f9a47e232 (diff)
parentc3e6450573ff9503c76dce9e6272c12ab63a21f6 (diff)
downloadmsm-extra-ac42fe0d68e839d0240031ae0d91ff3975b9bc5c.tar.gz
Merge c3e6450573ff9503c76dce9e6272c12ab63a21f6 on remote branch
Change-Id: I52fd526ccb002fa369c1d9a6374042c5a1622ec3
-rw-r--r--asoc/msm-pcm-q6-v2.c4
-rw-r--r--asoc/msm-pcm-routing-v2.c28
-rw-r--r--asoc/msm-pcm-routing-v2.h4
-rw-r--r--asoc/sdm660-common.c23
-rw-r--r--asoc/sdm660-external.c6
-rw-r--r--asoc/sm8150.c98
-rw-r--r--dsp/audio_pdr.c4
7 files changed, 140 insertions, 27 deletions
diff --git a/asoc/msm-pcm-q6-v2.c b/asoc/msm-pcm-q6-v2.c
index c9a51c01..40acfe7e 100644
--- a/asoc/msm-pcm-q6-v2.c
+++ b/asoc/msm-pcm-q6-v2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1942,7 +1942,7 @@ static int msm_pcm_path_latency_ctl_get(struct snd_kcontrol *kcontrol,
if (rc) {
pr_err("%s: get_path_delay failed, ret=%d\n",
__func__, rc);
- mutex_lock(&pdata->lock);
+ mutex_unlock(&pdata->lock);
return -EINVAL;
}
ucontrol->value.integer.value[0] =
diff --git a/asoc/msm-pcm-routing-v2.c b/asoc/msm-pcm-routing-v2.c
index ce670a24..514bbf7d 100644
--- a/asoc/msm-pcm-routing-v2.c
+++ b/asoc/msm-pcm-routing-v2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -730,6 +730,12 @@ static struct msm_pcm_routing_fdai_data
/* MULTIMEDIA29 */
{{0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM},
{0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM} },
+ /* MULTIMEDIA30 */
+ {{0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM},
+ {0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM} },
+ /* MULTIMEDIA31 */
+ {{0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM},
+ {0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM} },
/* VOIP */
{{0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM},
{0, INVALID_SESSION, LEGACY_PCM_MODE, {NULL, NULL}, LEGACY_PCM} },
@@ -12324,6 +12330,10 @@ static const struct snd_kcontrol_new slimbus_rx_voice_mixer_controls[] = {
MSM_BACKEND_DAI_SLIMBUS_0_RX,
MSM_FRONTEND_DAI_VOICEMMODE2, 1, 0, msm_routing_get_voice_mixer,
msm_routing_put_voice_mixer),
+ SOC_DOUBLE_EXT("Voice Stub", SND_SOC_NOPM,
+ MSM_BACKEND_DAI_SLIMBUS_0_RX,
+ MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
+ msm_routing_put_voice_stub_mixer),
};
static const struct snd_kcontrol_new slimbus_6_rx_voice_mixer_controls[] = {
@@ -12347,6 +12357,10 @@ MSM_BACKEND_DAI_SLIMBUS_6_RX,
MSM_BACKEND_DAI_SLIMBUS_6_RX,
MSM_FRONTEND_DAI_VOICEMMODE2, 1, 0, msm_routing_get_voice_mixer,
msm_routing_put_voice_mixer),
+ SOC_DOUBLE_EXT("Voice Stub", SND_SOC_NOPM,
+ MSM_BACKEND_DAI_SLIMBUS_6_RX,
+ MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
+ msm_routing_put_voice_stub_mixer),
};
static const struct snd_kcontrol_new usb_audio_rx_voice_mixer_controls[] = {
@@ -12577,6 +12591,10 @@ static const struct snd_kcontrol_new quat_mi2s_rx_voice_mixer_controls[] = {
MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
MSM_FRONTEND_DAI_VOICEMMODE2, 1, 0, msm_routing_get_voice_mixer,
msm_routing_put_voice_mixer),
+ SOC_DOUBLE_EXT("Voice Stub", SND_SOC_NOPM,
+ MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
+ MSM_FRONTEND_DAI_VOICE_STUB, 1, 0, msm_routing_get_voice_stub_mixer,
+ msm_routing_put_voice_stub_mixer),
};
static const struct snd_kcontrol_new quin_mi2s_rx_voice_mixer_controls[] = {
@@ -14278,6 +14296,10 @@ static const struct snd_kcontrol_new quat_mi2s_rx_port_mixer_controls[] = {
MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
MSM_BACKEND_DAI_SLIMBUS_0_TX, 1, 0, msm_routing_get_port_mixer,
msm_routing_put_port_mixer),
+ SOC_DOUBLE_EXT("SLIM_1_TX", SND_SOC_NOPM,
+ MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
+ MSM_BACKEND_DAI_SLIMBUS_1_TX, 1, 0, msm_routing_get_port_mixer,
+ msm_routing_put_port_mixer),
SOC_DOUBLE_EXT("SEC_MI2S_TX", SND_SOC_NOPM,
MSM_BACKEND_DAI_QUATERNARY_MI2S_RX,
MSM_BACKEND_DAI_SECONDARY_MI2S_TX, 1, 0, msm_routing_get_port_mixer,
@@ -21595,6 +21617,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"SLIM_0_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
{"SLIM_0_RX_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
{"SLIM_0_RX_Voice Mixer", "VoiceMMode2", "VOICEMMODE2_DL"},
+ {"SLIM_0_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
{"SLIMBUS_0_RX", NULL, "SLIM_0_RX_Voice Mixer"},
{"SLIM_6_RX_Voice Mixer", "Voip", "VOIP_DL"},
@@ -21602,6 +21625,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"SLIM_6_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
{"SLIM_6_RX_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
{"SLIM_6_RX_Voice Mixer", "VoiceMMode2", "VOICEMMODE2_DL"},
+ {"SLIM_6_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
{"SLIMBUS_6_RX", NULL, "SLIM_6_RX_Voice Mixer"},
{"USB_AUDIO_RX_Voice Mixer", "Voip", "VOIP_DL"},
@@ -21721,6 +21745,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUAT_MI2S_RX_Voice Mixer", "QCHAT", "QCHAT_DL"},
{"QUAT_MI2S_RX_Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL"},
{"QUAT_MI2S_RX_Voice Mixer", "VoiceMMode2", "VOICEMMODE2_DL"},
+ {"QUAT_MI2S_RX_Voice Mixer", "Voice Stub", "VOICE_STUB_DL"},
{"QUAT_MI2S_RX", NULL, "QUAT_MI2S_RX_Voice Mixer"},
{"QUIN_MI2S_RX_Voice Mixer", "Voip", "VOIP_DL"},
@@ -22868,6 +22893,7 @@ static const struct snd_soc_dapm_route intercon[] = {
{"QUAT_MI2S_RX Port Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"},
{"QUAT_MI2S_RX Port Mixer", "QUIN_MI2S_TX", "QUIN_MI2S_TX"},
{"QUAT_MI2S_RX Port Mixer", "SLIM_0_TX", "SLIMBUS_0_TX"},
+ {"QUAT_MI2S_RX Port Mixer", "SLIM_1_TX", "SLIMBUS_1_TX"},
{"QUAT_MI2S_RX Port Mixer", "INTERNAL_FM_TX", "INT_FM_TX"},
{"QUAT_MI2S_RX Port Mixer", "AUX_PCM_UL_TX", "AUX_PCM_TX"},
{"QUAT_MI2S_RX Port Mixer", "SLIM_8_TX", "SLIMBUS_8_TX"},
diff --git a/asoc/msm-pcm-routing-v2.h b/asoc/msm-pcm-routing-v2.h
index fa5c8585..2c605bfb 100644
--- a/asoc/msm-pcm-routing-v2.h
+++ b/asoc/msm-pcm-routing-v2.h
@@ -272,8 +272,8 @@ enum {
MSM_FRONTEND_DAI_MAX,
};
-#define MSM_FRONTEND_DAI_MM_SIZE (MSM_FRONTEND_DAI_MULTIMEDIA31 + 1)
-#define MSM_FRONTEND_DAI_MM_MAX_ID MSM_FRONTEND_DAI_MULTIMEDIA31
+#define MSM_FRONTEND_DAI_MM_SIZE (MSM_FRONTEND_DAI_VOLTE_STUB + 1)
+#define MSM_FRONTEND_DAI_MM_MAX_ID MSM_FRONTEND_DAI_VOLTE_STUB
enum {
MSM_BACKEND_DAI_PRI_I2S_RX = 0,
diff --git a/asoc/sdm660-common.c b/asoc/sdm660-common.c
index b0edcea4..c3c9b5a7 100644
--- a/asoc/sdm660-common.c
+++ b/asoc/sdm660-common.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -45,6 +45,27 @@ enum {
bool codec_reg_done;
+enum {
+ STATUS_PORT_STARTED, /* track if AFE port has started */
+ /* track AFE Tx port status for bi-directional transfers */
+ STATUS_TX_PORT,
+ /* track AFE Rx port status for bi-directional transfers */
+ STATUS_RX_PORT,
+ STATUS_MAX
+};
+
+struct tdm_dai_data {
+ DECLARE_BITMAP(status_mask, STATUS_MAX);
+ u32 rate;
+ u32 channels;
+ u32 bitwidth;
+ u32 num_group_ports;
+ u32 is_island_dai;
+ struct afe_clk_set clk_set; /* hold LPASS clock config. */
+ union afe_port_group_config group_cfg; /* hold tdm group config */
+ struct afe_tdm_port_config port_cfg; /* hold tdm config */
+};
+
/* TDM default config */
static struct dev_config tdm_rx_cfg[TDM_INTERFACE_MAX][TDM_PORT_MAX] = {
{ /* PRI TDM */
diff --git a/asoc/sdm660-external.c b/asoc/sdm660-external.c
index fad90999..af54bcb8 100644
--- a/asoc/sdm660-external.c
+++ b/asoc/sdm660-external.c
@@ -96,12 +96,6 @@ enum {
SLIM_TX_MAX,
};
-struct dev_config {
- u32 sample_rate;
- u32 bit_format;
- u32 channels;
-};
-
/* Default configuration of slimbus channels */
static struct dev_config slim_rx_cfg[] = {
[SLIM_RX_0] = {SAMPLING_RATE_48KHZ, SNDRV_PCM_FORMAT_S16_LE, 1},
diff --git a/asoc/sm8150.c b/asoc/sm8150.c
index 71d1204c..b0d62ef8 100644
--- a/asoc/sm8150.c
+++ b/asoc/sm8150.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -174,6 +174,7 @@ struct msm_asoc_mach_data {
struct device_node *hph_en1_gpio_p; /* used by pinctrl API */
struct device_node *hph_en0_gpio_p; /* used by pinctrl API */
struct device_node *fsa_handle;
+ struct device_node *mi2s_gpio_p[MI2S_MAX]; /* used by pinctrl API */
struct snd_soc_codec *codec;
struct work_struct adsp_power_up_work;
};
@@ -5037,23 +5038,29 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
ret = msm_mi2s_set_sclk(substream, true);
if (ret < 0) {
dev_err(rtd->card->dev,
- "%s: afe lpass clock failed to enable MI2S clock, err:%d\n",
+ "%s: afe lpass clock failed ",
+ "to enable MI2S clock, err:%d\n",
__func__, ret);
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",
+ pr_err("%s: set fmt cpu dai failed for MI2S(%d) err:%d\n",
__func__, index, ret);
goto clk_off;
}
if (index == QUAT_MI2S) {
ret_pinctrl = msm_set_pinctrl(pinctrl_info,
- STATE_MI2S_ACTIVE);
- if (ret_pinctrl)
- pr_err("%s: MI2S TLMM pinctrl set failed with %d\n",
+ STATE_MI2S_ACTIVE);
+ if (ret_pinctrl) {
+ pr_err("%s: MI2S TLMM pinctrl set failed %d",
+ "switching to gpio\n",
__func__, ret_pinctrl);
+ if (pdata->mi2s_gpio_p[index])
+ msm_cdc_pinctrl_select_active_state(
+ pdata->mi2s_gpio_p[index]);
+ }
}
}
clk_off:
@@ -5088,14 +5095,19 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream)
if (--mi2s_intf_conf[index].ref_cnt == 0) {
ret = msm_mi2s_set_sclk(substream, false);
if (ret < 0)
- pr_err("%s:clock disable failed for MI2S (%d); ret=%d\n",
+ pr_err("%s:clock disable failed for MI2S(%d) ret=%d\n",
__func__, index, ret);
if (index == QUAT_MI2S) {
ret_pinctrl = msm_set_pinctrl(pinctrl_info,
- STATE_DISABLE);
- if (ret_pinctrl)
- pr_err("%s: MI2S TLMM pinctrl set failed with %d\n",
+ STATE_DISABLE);
+ if (ret_pinctrl) {
+ pr_err("%s: MI2S TLMM pinctrl set failed %d",
+ "switching to gpio\n",
__func__, ret_pinctrl);
+ if (pdata->mi2s_gpio_p[index])
+ msm_cdc_pinctrl_select_sleep_state(
+ pdata->mi2s_gpio_p[index]);
+ }
}
}
mutex_unlock(&mi2s_intf_conf[index].lock);
@@ -5867,6 +5879,54 @@ static struct snd_soc_dai_link msm_common_misc_fe_dai_links[] = {
.ignore_pmdown_time = 1,
.id = MSM_FRONTEND_DAI_MULTIMEDIA31,
},
+ {
+ .name = "Quaternary MI2S_RX Hostless Playback",
+ .stream_name = "Quaternary MI2S_RX Hostless Playback",
+ .cpu_dai_name = "QUAT_MI2S_RX_HOSTLESS",
+ .platform_name = "msm-pcm-hostless",
+ .dynamic = 1,
+ .dpcm_playback = 1,
+ .trigger = {SND_SOC_DPCM_TRIGGER_POST,
+ SND_SOC_DPCM_TRIGGER_POST},
+ .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
+ .ignore_suspend = 1,
+ .ignore_pmdown_time = 1,
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .codec_name = "snd-soc-dummy",
+ },
+ {
+ .name = "Quaternary MI2S_TX Hostless Capture",
+ .stream_name = "Quaternary MI2S_TX Hostless Capture",
+ .cpu_dai_name = "QUAT_MI2S_TX_HOSTLESS",
+ .platform_name = "msm-pcm-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,
+ .ignore_pmdown_time = 1,
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .codec_name = "snd-soc-dummy",
+ },
+/* Voice Stub */
+ {
+ .name = "Voice Stub",
+ .stream_name = "Voice Stub",
+ .cpu_dai_name = "VOICE_STUB",
+ .platform_name = "msm-pcm-hostless",
+ .dynamic = 1,
+ .dpcm_playback = 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,
+ /* this dainlink has playback support */
+ .ignore_pmdown_time = 1,
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .codec_name = "snd-soc-dummy",
+ },
};
static struct snd_soc_dai_link msm_common_be_dai_links[] = {
@@ -6935,6 +6995,11 @@ struct snd_soc_card snd_soc_card_tavil_msm = {
.late_probe = msm_snd_card_tavil_late_probe,
};
+struct snd_soc_card snd_soc_card_hanasdx_msm = {
+ .name = "sm8150-hana55-snd-card",
+ .late_probe = msm_snd_card_tavil_late_probe,
+};
+
static int msm_populate_dai_link_component_of_node(
struct snd_soc_card *card)
{
@@ -7147,6 +7212,8 @@ static const struct of_device_id sm8150_asoc_machine_of_match[] = {
.data = "tavil_codec"},
{ .compatible = "qcom,sm8150-asoc-snd-stub",
.data = "stub_codec"},
+ { .compatible = "qcom,sm8150-asoc-snd-hana55",
+ .data = "tavil_codec"},
{},
};
@@ -7231,7 +7298,10 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
dailink = msm_pahu_snd_card_dai_links;
} else if (!strcmp(match->data, "tavil_codec")) {
- card = &snd_soc_card_tavil_msm;
+ if (!strcmp(match->compatible, "qcom,sm8150-asoc-snd-hana55"))
+ card = &snd_soc_card_hanasdx_msm;
+ else
+ card = &snd_soc_card_tavil_msm;
len_1 = ARRAY_SIZE(msm_common_dai_links);
len_2 = len_1 + ARRAY_SIZE(msm_tavil_fe_dai_links);
len_3 = len_2 + ARRAY_SIZE(msm_common_misc_fe_dai_links);
@@ -7730,10 +7800,12 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
if (!ret) {
pr_debug("%s: pinctrl parsing successful\n", __func__);
} else {
- dev_dbg(&pdev->dev,
- "%s: Parsing pinctrl failed with %d. Cannot use Ports\n",
+ pr_err("%s: Parsing pinctrl failed %d. switching to gpio\n",
__func__, ret);
ret = 0;
+ pdata->mi2s_gpio_p[QUAT_MI2S] =
+ of_parse_phandle(pdev->dev.of_node,
+ "qcom,quat-mi2s-gpios", 0);
}
msm_i2s_auxpcm_init(pdev);
diff --git a/dsp/audio_pdr.c b/dsp/audio_pdr.c
index 75f3bbb5..9ef386ec 100644
--- a/dsp/audio_pdr.c
+++ b/dsp/audio_pdr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2017, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -39,7 +39,7 @@ static int audio_pdr_locator_callback(struct notifier_block *this,
memcpy(&audio_pdr_services, data,
sizeof(audio_pdr_services[AUDIO_PDR_DOMAIN_ADSP]));
- if (audio_pdr_services[AUDIO_PDR_DOMAIN_ADSP].total_domains == 1) {
+ if (audio_pdr_services[AUDIO_PDR_DOMAIN_ADSP].total_domains > 0 ) {
pr_debug("%s: Service %s, returned total domains %d, ",
__func__,
audio_pdr_services[AUDIO_PDR_DOMAIN_ADSP].service_name,