aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/hdmi-codec.c21
-rw-r--r--sound/soc/codecs/max98373.c1
-rw-r--r--sound/soc/codecs/rt5514.c8
-rw-r--r--sound/soc/codecs/wm8988.c4
-rw-r--r--sound/soc/codecs/wm_adsp.c10
-rw-r--r--sound/soc/qcom/qdsp6/q6afe-dai.c5
-rw-r--r--sound/soc/qcom/qdsp6/q6asm-dai.c4
-rw-r--r--sound/soc/qcom/qdsp6/q6routing.c2
-rw-r--r--sound/soc/soc-pcm.c8
-rw-r--r--sound/soc/soc-utils.c2
-rw-r--r--sound/soc/tegra/tegra30_i2s.h2
11 files changed, 48 insertions, 19 deletions
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 38e4a8515709..d00734d31e04 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -291,10 +291,6 @@ static const struct snd_soc_dapm_widget hdmi_widgets[] = {
291 SND_SOC_DAPM_OUTPUT("TX"), 291 SND_SOC_DAPM_OUTPUT("TX"),
292}; 292};
293 293
294static const struct snd_soc_dapm_route hdmi_routes[] = {
295 { "TX", NULL, "Playback" },
296};
297
298enum { 294enum {
299 DAI_ID_I2S = 0, 295 DAI_ID_I2S = 0,
300 DAI_ID_SPDIF, 296 DAI_ID_SPDIF,
@@ -689,9 +685,23 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
689 return snd_ctl_add(rtd->card->snd_card, kctl); 685 return snd_ctl_add(rtd->card->snd_card, kctl);
690} 686}
691 687
688static int hdmi_dai_probe(struct snd_soc_dai *dai)
689{
690 struct snd_soc_dapm_context *dapm;
691 struct snd_soc_dapm_route route = {
692 .sink = "TX",
693 .source = dai->driver->playback.stream_name,
694 };
695
696 dapm = snd_soc_component_get_dapm(dai->component);
697
698 return snd_soc_dapm_add_routes(dapm, &route, 1);
699}
700
692static const struct snd_soc_dai_driver hdmi_i2s_dai = { 701static const struct snd_soc_dai_driver hdmi_i2s_dai = {
693 .name = "i2s-hifi", 702 .name = "i2s-hifi",
694 .id = DAI_ID_I2S, 703 .id = DAI_ID_I2S,
704 .probe = hdmi_dai_probe,
695 .playback = { 705 .playback = {
696 .stream_name = "I2S Playback", 706 .stream_name = "I2S Playback",
697 .channels_min = 2, 707 .channels_min = 2,
@@ -707,6 +717,7 @@ static const struct snd_soc_dai_driver hdmi_i2s_dai = {
707static const struct snd_soc_dai_driver hdmi_spdif_dai = { 717static const struct snd_soc_dai_driver hdmi_spdif_dai = {
708 .name = "spdif-hifi", 718 .name = "spdif-hifi",
709 .id = DAI_ID_SPDIF, 719 .id = DAI_ID_SPDIF,
720 .probe = hdmi_dai_probe,
710 .playback = { 721 .playback = {
711 .stream_name = "SPDIF Playback", 722 .stream_name = "SPDIF Playback",
712 .channels_min = 2, 723 .channels_min = 2,
@@ -733,8 +744,6 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,
733static const struct snd_soc_component_driver hdmi_driver = { 744static const struct snd_soc_component_driver hdmi_driver = {
734 .dapm_widgets = hdmi_widgets, 745 .dapm_widgets = hdmi_widgets,
735 .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), 746 .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
736 .dapm_routes = hdmi_routes,
737 .num_dapm_routes = ARRAY_SIZE(hdmi_routes),
738 .of_xlate_dai_id = hdmi_of_xlate_dai_id, 747 .of_xlate_dai_id = hdmi_of_xlate_dai_id,
739 .idle_bias_on = 1, 748 .idle_bias_on = 1,
740 .use_pmdown_time = 1, 749 .use_pmdown_time = 1,
diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c
index a92586106932..92b7125ea169 100644
--- a/sound/soc/codecs/max98373.c
+++ b/sound/soc/codecs/max98373.c
@@ -488,6 +488,7 @@ static const DECLARE_TLV_DB_RANGE(max98373_bde_gain_tlv,
488static bool max98373_readable_register(struct device *dev, unsigned int reg) 488static bool max98373_readable_register(struct device *dev, unsigned int reg)
489{ 489{
490 switch (reg) { 490 switch (reg) {
491 case MAX98373_R2000_SW_RESET:
491 case MAX98373_R2001_INT_RAW1 ... MAX98373_R200C_INT_EN3: 492 case MAX98373_R2001_INT_RAW1 ... MAX98373_R200C_INT_EN3:
492 case MAX98373_R2010_IRQ_CTRL: 493 case MAX98373_R2010_IRQ_CTRL:
493 case MAX98373_R2014_THERM_WARN_THRESH 494 case MAX98373_R2014_THERM_WARN_THRESH
diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c
index 1570b91bf018..dca82dd6e3bf 100644
--- a/sound/soc/codecs/rt5514.c
+++ b/sound/soc/codecs/rt5514.c
@@ -64,8 +64,8 @@ static const struct reg_sequence rt5514_patch[] = {
64 {RT5514_ANA_CTRL_LDO10, 0x00028604}, 64 {RT5514_ANA_CTRL_LDO10, 0x00028604},
65 {RT5514_ANA_CTRL_ADCFED, 0x00000800}, 65 {RT5514_ANA_CTRL_ADCFED, 0x00000800},
66 {RT5514_ASRC_IN_CTRL1, 0x00000003}, 66 {RT5514_ASRC_IN_CTRL1, 0x00000003},
67 {RT5514_DOWNFILTER0_CTRL3, 0x10000362}, 67 {RT5514_DOWNFILTER0_CTRL3, 0x10000352},
68 {RT5514_DOWNFILTER1_CTRL3, 0x10000362}, 68 {RT5514_DOWNFILTER1_CTRL3, 0x10000352},
69}; 69};
70 70
71static const struct reg_default rt5514_reg[] = { 71static const struct reg_default rt5514_reg[] = {
@@ -92,10 +92,10 @@ static const struct reg_default rt5514_reg[] = {
92 {RT5514_ASRC_IN_CTRL1, 0x00000003}, 92 {RT5514_ASRC_IN_CTRL1, 0x00000003},
93 {RT5514_DOWNFILTER0_CTRL1, 0x00020c2f}, 93 {RT5514_DOWNFILTER0_CTRL1, 0x00020c2f},
94 {RT5514_DOWNFILTER0_CTRL2, 0x00020c2f}, 94 {RT5514_DOWNFILTER0_CTRL2, 0x00020c2f},
95 {RT5514_DOWNFILTER0_CTRL3, 0x10000362}, 95 {RT5514_DOWNFILTER0_CTRL3, 0x10000352},
96 {RT5514_DOWNFILTER1_CTRL1, 0x00020c2f}, 96 {RT5514_DOWNFILTER1_CTRL1, 0x00020c2f},
97 {RT5514_DOWNFILTER1_CTRL2, 0x00020c2f}, 97 {RT5514_DOWNFILTER1_CTRL2, 0x00020c2f},
98 {RT5514_DOWNFILTER1_CTRL3, 0x10000362}, 98 {RT5514_DOWNFILTER1_CTRL3, 0x10000352},
99 {RT5514_ANA_CTRL_LDO10, 0x00028604}, 99 {RT5514_ANA_CTRL_LDO10, 0x00028604},
100 {RT5514_ANA_CTRL_LDO18_16, 0x02000345}, 100 {RT5514_ANA_CTRL_LDO18_16, 0x02000345},
101 {RT5514_ANA_CTRL_ADC12, 0x0000a2a8}, 101 {RT5514_ANA_CTRL_ADC12, 0x0000a2a8},
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index 62200117444b..6e52c6a8bab3 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -522,7 +522,7 @@ static inline int get_coeff(int mclk, int rate)
522/* The set of rates we can generate from the above for each SYSCLK */ 522/* The set of rates we can generate from the above for each SYSCLK */
523 523
524static const unsigned int rates_12288[] = { 524static const unsigned int rates_12288[] = {
525 8000, 12000, 16000, 24000, 24000, 32000, 48000, 96000, 525 8000, 12000, 16000, 24000, 32000, 48000, 96000,
526}; 526};
527 527
528static const struct snd_pcm_hw_constraint_list constraints_12288 = { 528static const struct snd_pcm_hw_constraint_list constraints_12288 = {
@@ -540,7 +540,7 @@ static const struct snd_pcm_hw_constraint_list constraints_112896 = {
540}; 540};
541 541
542static const unsigned int rates_12[] = { 542static const unsigned int rates_12[] = {
543 8000, 11025, 12000, 16000, 22050, 2400, 32000, 41100, 48000, 543 8000, 11025, 12000, 16000, 22050, 24000, 32000, 41100, 48000,
544 48000, 88235, 96000, 544 48000, 88235, 96000,
545}; 545};
546 546
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index fbd0515c49d7..1c12c78dbcce 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -2650,7 +2650,10 @@ int wm_adsp2_preloader_get(struct snd_kcontrol *kcontrol,
2650 struct snd_ctl_elem_value *ucontrol) 2650 struct snd_ctl_elem_value *ucontrol)
2651{ 2651{
2652 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 2652 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
2653 struct wm_adsp *dsp = snd_soc_component_get_drvdata(component); 2653 struct wm_adsp *dsps = snd_soc_component_get_drvdata(component);
2654 struct soc_mixer_control *mc =
2655 (struct soc_mixer_control *)kcontrol->private_value;
2656 struct wm_adsp *dsp = &dsps[mc->shift - 1];
2654 2657
2655 ucontrol->value.integer.value[0] = dsp->preloaded; 2658 ucontrol->value.integer.value[0] = dsp->preloaded;
2656 2659
@@ -2662,10 +2665,11 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
2662 struct snd_ctl_elem_value *ucontrol) 2665 struct snd_ctl_elem_value *ucontrol)
2663{ 2666{
2664 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 2667 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
2665 struct wm_adsp *dsp = snd_soc_component_get_drvdata(component); 2668 struct wm_adsp *dsps = snd_soc_component_get_drvdata(component);
2666 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); 2669 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
2667 struct soc_mixer_control *mc = 2670 struct soc_mixer_control *mc =
2668 (struct soc_mixer_control *)kcontrol->private_value; 2671 (struct soc_mixer_control *)kcontrol->private_value;
2672 struct wm_adsp *dsp = &dsps[mc->shift - 1];
2669 char preload[32]; 2673 char preload[32];
2670 2674
2671 snprintf(preload, ARRAY_SIZE(preload), "DSP%u Preload", mc->shift); 2675 snprintf(preload, ARRAY_SIZE(preload), "DSP%u Preload", mc->shift);
@@ -2679,6 +2683,8 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
2679 2683
2680 snd_soc_dapm_sync(dapm); 2684 snd_soc_dapm_sync(dapm);
2681 2685
2686 flush_work(&dsp->boot_work);
2687
2682 return 0; 2688 return 0;
2683} 2689}
2684EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put); 2690EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);
diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c
index 139d24be3fb9..60ff4a2d3577 100644
--- a/sound/soc/qcom/qdsp6/q6afe-dai.c
+++ b/sound/soc/qcom/qdsp6/q6afe-dai.c
@@ -313,6 +313,9 @@ static void q6afe_dai_shutdown(struct snd_pcm_substream *substream,
313 struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); 313 struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev);
314 int rc; 314 int rc;
315 315
316 if (!dai_data->is_port_started[dai->id])
317 return;
318
316 rc = q6afe_port_stop(dai_data->port[dai->id]); 319 rc = q6afe_port_stop(dai_data->port[dai->id]);
317 if (rc < 0) 320 if (rc < 0)
318 dev_err(dai->dev, "fail to close AFE port (%d)\n", rc); 321 dev_err(dai->dev, "fail to close AFE port (%d)\n", rc);
@@ -1332,7 +1335,7 @@ static void of_q6afe_parse_dai_data(struct device *dev,
1332 int id, i, num_lines; 1335 int id, i, num_lines;
1333 1336
1334 ret = of_property_read_u32(node, "reg", &id); 1337 ret = of_property_read_u32(node, "reg", &id);
1335 if (ret || id > AFE_PORT_MAX) { 1338 if (ret || id < 0 || id >= AFE_PORT_MAX) {
1336 dev_err(dev, "valid dai id not found:%d\n", ret); 1339 dev_err(dev, "valid dai id not found:%d\n", ret);
1337 continue; 1340 continue;
1338 } 1341 }
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index acf96c6549fc..9db9a2944ef2 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -389,7 +389,9 @@ static int q6asm_dai_close(struct snd_pcm_substream *substream)
389 struct q6asm_dai_rtd *prtd = runtime->private_data; 389 struct q6asm_dai_rtd *prtd = runtime->private_data;
390 390
391 if (prtd->audio_client) { 391 if (prtd->audio_client) {
392 q6asm_cmd(prtd->audio_client, CMD_CLOSE); 392 if (prtd->state)
393 q6asm_cmd(prtd->audio_client, CMD_CLOSE);
394
393 q6asm_unmap_memory_regions(substream->stream, 395 q6asm_unmap_memory_regions(substream->stream,
394 prtd->audio_client); 396 prtd->audio_client);
395 q6asm_audio_client_free(prtd->audio_client); 397 q6asm_audio_client_free(prtd->audio_client);
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index 1d33b00e5b44..dc94c5c53788 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -926,7 +926,7 @@ static int routing_hw_params(struct snd_pcm_substream *substream,
926 else 926 else
927 path_type = ADM_PATH_LIVE_REC; 927 path_type = ADM_PATH_LIVE_REC;
928 928
929 if (be_id > AFE_MAX_PORTS) 929 if (be_id >= AFE_MAX_PORTS)
930 return -EINVAL; 930 return -EINVAL;
931 931
932 session = &data->port_data[be_id]; 932 session = &data->port_data[be_id];
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 9833e53754cb..e8b98bfd4cf1 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1712,6 +1712,14 @@ static void dpcm_runtime_merge_format(struct snd_pcm_substream *substream,
1712 int i; 1712 int i;
1713 1713
1714 for (i = 0; i < be->num_codecs; i++) { 1714 for (i = 0; i < be->num_codecs; i++) {
1715 /*
1716 * Skip CODECs which don't support the current stream
1717 * type. See soc_pcm_init_runtime_hw() for more details
1718 */
1719 if (!snd_soc_dai_stream_valid(be->codec_dais[i],
1720 stream))
1721 continue;
1722
1715 codec_dai_drv = be->codec_dais[i]->driver; 1723 codec_dai_drv = be->codec_dais[i]->driver;
1716 if (stream == SNDRV_PCM_STREAM_PLAYBACK) 1724 if (stream == SNDRV_PCM_STREAM_PLAYBACK)
1717 codec_stream = &codec_dai_drv->playback; 1725 codec_stream = &codec_dai_drv->playback;
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
index ea024236c643..e0c93496c0cd 100644
--- a/sound/soc/soc-utils.c
+++ b/sound/soc/soc-utils.c
@@ -375,6 +375,6 @@ int __init snd_soc_util_init(void)
375 375
376void __exit snd_soc_util_exit(void) 376void __exit snd_soc_util_exit(void)
377{ 377{
378 platform_device_unregister(soc_dummy_dev);
379 platform_driver_unregister(&soc_dummy_driver); 378 platform_driver_unregister(&soc_dummy_driver);
379 platform_device_unregister(soc_dummy_dev);
380} 380}
diff --git a/sound/soc/tegra/tegra30_i2s.h b/sound/soc/tegra/tegra30_i2s.h
index 774fc6ad2026..2e561e946de2 100644
--- a/sound/soc/tegra/tegra30_i2s.h
+++ b/sound/soc/tegra/tegra30_i2s.h
@@ -173,7 +173,7 @@
173/* Number of slots in frame, minus 1 */ 173/* Number of slots in frame, minus 1 */
174#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT 16 174#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT 16
175#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US 7 175#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US 7
176#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK (TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOT_MASK_US << TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOT_SHIFT) 176#define TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK (TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK_US << TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT)
177 177
178/* TDM mode slot enable bitmask */ 178/* TDM mode slot enable bitmask */
179#define TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT 8 179#define TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT 8