diff options
author | Mark Brown <broonie@kernel.org> | 2018-12-13 09:36:46 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-12-13 09:36:46 -0500 |
commit | 8fe8915b6c0b5298fa547be21957b3860c39c46e (patch) | |
tree | f16772eef6506fa40fe43f53b416cd4cd4eccf6b /sound | |
parent | 1b46ed96961db1a826b3e5cadac18c7c4857f054 (diff) | |
parent | a01b8d1d24451bfc00d3a975d107f9b1590bf826 (diff) |
Merge branch 'for-4.20' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-4.21 intel dep
Diffstat (limited to 'sound')
27 files changed, 395 insertions, 272 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index fac397326515..db709eeb019c 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c | |||
@@ -2230,11 +2230,6 @@ static int hdac_hdmi_runtime_suspend(struct device *dev) | |||
2230 | */ | 2230 | */ |
2231 | snd_hdac_codec_read(hdev, hdev->afg, 0, AC_VERB_SET_POWER_STATE, | 2231 | snd_hdac_codec_read(hdev, hdev->afg, 0, AC_VERB_SET_POWER_STATE, |
2232 | AC_PWRST_D3); | 2232 | AC_PWRST_D3); |
2233 | err = snd_hdac_display_power(bus, false); | ||
2234 | if (err < 0) { | ||
2235 | dev_err(dev, "Cannot turn on display power on i915\n"); | ||
2236 | return err; | ||
2237 | } | ||
2238 | 2233 | ||
2239 | hlink = snd_hdac_ext_bus_get_link(bus, dev_name(dev)); | 2234 | hlink = snd_hdac_ext_bus_get_link(bus, dev_name(dev)); |
2240 | if (!hlink) { | 2235 | if (!hlink) { |
@@ -2244,7 +2239,11 @@ static int hdac_hdmi_runtime_suspend(struct device *dev) | |||
2244 | 2239 | ||
2245 | snd_hdac_ext_bus_link_put(bus, hlink); | 2240 | snd_hdac_ext_bus_link_put(bus, hlink); |
2246 | 2241 | ||
2247 | return 0; | 2242 | err = snd_hdac_display_power(bus, false); |
2243 | if (err < 0) | ||
2244 | dev_err(dev, "Cannot turn off display power on i915\n"); | ||
2245 | |||
2246 | return err; | ||
2248 | } | 2247 | } |
2249 | 2248 | ||
2250 | static int hdac_hdmi_runtime_resume(struct device *dev) | 2249 | static int hdac_hdmi_runtime_resume(struct device *dev) |
diff --git a/sound/soc/codecs/pcm186x.h b/sound/soc/codecs/pcm186x.h index 2c6ba55bf394..bb3f0c42a1cd 100644 --- a/sound/soc/codecs/pcm186x.h +++ b/sound/soc/codecs/pcm186x.h | |||
@@ -139,7 +139,7 @@ enum pcm186x_type { | |||
139 | #define PCM186X_MAX_REGISTER PCM186X_CURR_TRIM_CTRL | 139 | #define PCM186X_MAX_REGISTER PCM186X_CURR_TRIM_CTRL |
140 | 140 | ||
141 | /* PCM186X_PAGE */ | 141 | /* PCM186X_PAGE */ |
142 | #define PCM186X_RESET 0xff | 142 | #define PCM186X_RESET 0xfe |
143 | 143 | ||
144 | /* PCM186X_ADCX_INPUT_SEL_X */ | 144 | /* PCM186X_ADCX_INPUT_SEL_X */ |
145 | #define PCM186X_ADC_INPUT_SEL_POL BIT(7) | 145 | #define PCM186X_ADC_INPUT_SEL_POL BIT(7) |
diff --git a/sound/soc/codecs/pcm3060.c b/sound/soc/codecs/pcm3060.c index 5f479aa61097..1dd851a7b43b 100644 --- a/sound/soc/codecs/pcm3060.c +++ b/sound/soc/codecs/pcm3060.c | |||
@@ -198,20 +198,16 @@ static const struct snd_kcontrol_new pcm3060_dapm_controls[] = { | |||
198 | }; | 198 | }; |
199 | 199 | ||
200 | static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = { | 200 | static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = { |
201 | SND_SOC_DAPM_OUTPUT("OUTL+"), | 201 | SND_SOC_DAPM_OUTPUT("OUTL"), |
202 | SND_SOC_DAPM_OUTPUT("OUTR+"), | 202 | SND_SOC_DAPM_OUTPUT("OUTR"), |
203 | SND_SOC_DAPM_OUTPUT("OUTL-"), | ||
204 | SND_SOC_DAPM_OUTPUT("OUTR-"), | ||
205 | 203 | ||
206 | SND_SOC_DAPM_INPUT("INL"), | 204 | SND_SOC_DAPM_INPUT("INL"), |
207 | SND_SOC_DAPM_INPUT("INR"), | 205 | SND_SOC_DAPM_INPUT("INR"), |
208 | }; | 206 | }; |
209 | 207 | ||
210 | static const struct snd_soc_dapm_route pcm3060_dapm_map[] = { | 208 | static const struct snd_soc_dapm_route pcm3060_dapm_map[] = { |
211 | { "OUTL+", NULL, "Playback" }, | 209 | { "OUTL", NULL, "Playback" }, |
212 | { "OUTR+", NULL, "Playback" }, | 210 | { "OUTR", NULL, "Playback" }, |
213 | { "OUTL-", NULL, "Playback" }, | ||
214 | { "OUTR-", NULL, "Playback" }, | ||
215 | 211 | ||
216 | { "Capture", NULL, "INL" }, | 212 | { "Capture", NULL, "INL" }, |
217 | { "Capture", NULL, "INR" }, | 213 | { "Capture", NULL, "INR" }, |
diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c index 115f21658222..08d3fe192e65 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c | |||
@@ -758,15 +758,22 @@ err_clk: | |||
758 | } | 758 | } |
759 | EXPORT_SYMBOL_GPL(pcm3168a_probe); | 759 | EXPORT_SYMBOL_GPL(pcm3168a_probe); |
760 | 760 | ||
761 | void pcm3168a_remove(struct device *dev) | 761 | static void pcm3168a_disable(struct device *dev) |
762 | { | 762 | { |
763 | struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev); | 763 | struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev); |
764 | 764 | ||
765 | pm_runtime_disable(dev); | ||
766 | regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies), | 765 | regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies), |
767 | pcm3168a->supplies); | 766 | pcm3168a->supplies); |
768 | clk_disable_unprepare(pcm3168a->scki); | 767 | clk_disable_unprepare(pcm3168a->scki); |
769 | } | 768 | } |
769 | |||
770 | void pcm3168a_remove(struct device *dev) | ||
771 | { | ||
772 | pm_runtime_disable(dev); | ||
773 | #ifndef CONFIG_PM | ||
774 | pcm3168a_disable(dev); | ||
775 | #endif | ||
776 | } | ||
770 | EXPORT_SYMBOL_GPL(pcm3168a_remove); | 777 | EXPORT_SYMBOL_GPL(pcm3168a_remove); |
771 | 778 | ||
772 | #ifdef CONFIG_PM | 779 | #ifdef CONFIG_PM |
@@ -821,10 +828,7 @@ static int pcm3168a_rt_suspend(struct device *dev) | |||
821 | 828 | ||
822 | regcache_cache_only(pcm3168a->regmap, true); | 829 | regcache_cache_only(pcm3168a->regmap, true); |
823 | 830 | ||
824 | regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies), | 831 | pcm3168a_disable(dev); |
825 | pcm3168a->supplies); | ||
826 | |||
827 | clk_disable_unprepare(pcm3168a->scki); | ||
828 | 832 | ||
829 | return 0; | 833 | return 0; |
830 | } | 834 | } |
diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c index 27f7445b2432..e74b2e8cd423 100644 --- a/sound/soc/codecs/rt5660.c +++ b/sound/soc/codecs/rt5660.c | |||
@@ -1246,6 +1246,7 @@ MODULE_DEVICE_TABLE(of, rt5660_of_match); | |||
1246 | 1246 | ||
1247 | static const struct acpi_device_id rt5660_acpi_match[] = { | 1247 | static const struct acpi_device_id rt5660_acpi_match[] = { |
1248 | { "10EC5660", 0 }, | 1248 | { "10EC5660", 0 }, |
1249 | { "10EC3277", 0 }, | ||
1249 | { }, | 1250 | { }, |
1250 | }; | 1251 | }; |
1251 | MODULE_DEVICE_TABLE(acpi, rt5660_acpi_match); | 1252 | MODULE_DEVICE_TABLE(acpi, rt5660_acpi_match); |
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 0ed44e5c58f7..1dd291cebe67 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
@@ -765,38 +765,41 @@ static unsigned int wm_adsp_region_to_reg(struct wm_adsp_region const *mem, | |||
765 | 765 | ||
766 | static void wm_adsp2_show_fw_status(struct wm_adsp *dsp) | 766 | static void wm_adsp2_show_fw_status(struct wm_adsp *dsp) |
767 | { | 767 | { |
768 | u16 scratch[4]; | 768 | unsigned int scratch[4]; |
769 | unsigned int addr = dsp->base + ADSP2_SCRATCH0; | ||
770 | unsigned int i; | ||
769 | int ret; | 771 | int ret; |
770 | 772 | ||
771 | ret = regmap_raw_read(dsp->regmap, dsp->base + ADSP2_SCRATCH0, | 773 | for (i = 0; i < ARRAY_SIZE(scratch); ++i) { |
772 | scratch, sizeof(scratch)); | 774 | ret = regmap_read(dsp->regmap, addr + i, &scratch[i]); |
773 | if (ret) { | 775 | if (ret) { |
774 | adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret); | 776 | adsp_err(dsp, "Failed to read SCRATCH%u: %d\n", i, ret); |
775 | return; | 777 | return; |
778 | } | ||
776 | } | 779 | } |
777 | 780 | ||
778 | adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n", | 781 | adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n", |
779 | be16_to_cpu(scratch[0]), | 782 | scratch[0], scratch[1], scratch[2], scratch[3]); |
780 | be16_to_cpu(scratch[1]), | ||
781 | be16_to_cpu(scratch[2]), | ||
782 | be16_to_cpu(scratch[3])); | ||
783 | } | 783 | } |
784 | 784 | ||
785 | static void wm_adsp2v2_show_fw_status(struct wm_adsp *dsp) | 785 | static void wm_adsp2v2_show_fw_status(struct wm_adsp *dsp) |
786 | { | 786 | { |
787 | u32 scratch[2]; | 787 | unsigned int scratch[2]; |
788 | int ret; | 788 | int ret; |
789 | 789 | ||
790 | ret = regmap_raw_read(dsp->regmap, dsp->base + ADSP2V2_SCRATCH0_1, | 790 | ret = regmap_read(dsp->regmap, dsp->base + ADSP2V2_SCRATCH0_1, |
791 | scratch, sizeof(scratch)); | 791 | &scratch[0]); |
792 | |||
793 | if (ret) { | 792 | if (ret) { |
794 | adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret); | 793 | adsp_err(dsp, "Failed to read SCRATCH0_1: %d\n", ret); |
795 | return; | 794 | return; |
796 | } | 795 | } |
797 | 796 | ||
798 | scratch[0] = be32_to_cpu(scratch[0]); | 797 | ret = regmap_read(dsp->regmap, dsp->base + ADSP2V2_SCRATCH2_3, |
799 | scratch[1] = be32_to_cpu(scratch[1]); | 798 | &scratch[1]); |
799 | if (ret) { | ||
800 | adsp_err(dsp, "Failed to read SCRATCH2_3: %d\n", ret); | ||
801 | return; | ||
802 | } | ||
800 | 803 | ||
801 | adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n", | 804 | adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n", |
802 | scratch[0] & 0xFFFF, | 805 | scratch[0] & 0xFFFF, |
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index 0caa1f4eb94d..18e717703685 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig | |||
@@ -101,22 +101,42 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI | |||
101 | codec, then enable this option by saying Y or m. This is a | 101 | codec, then enable this option by saying Y or m. This is a |
102 | recommended option | 102 | recommended option |
103 | 103 | ||
104 | config SND_SOC_INTEL_SKYLAKE_SSP_CLK | ||
105 | tristate | ||
106 | |||
107 | config SND_SOC_INTEL_SKYLAKE | 104 | config SND_SOC_INTEL_SKYLAKE |
108 | tristate "SKL/BXT/KBL/GLK/CNL... Platforms" | 105 | tristate "SKL/BXT/KBL/GLK/CNL... Platforms" |
109 | depends on PCI && ACPI | 106 | depends on PCI && ACPI |
107 | select SND_SOC_INTEL_SKYLAKE_COMMON | ||
108 | help | ||
109 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ | ||
110 | GeminiLake or CannonLake platform with the DSP enabled in the BIOS | ||
111 | then enable this option by saying Y or m. | ||
112 | |||
113 | if SND_SOC_INTEL_SKYLAKE | ||
114 | |||
115 | config SND_SOC_INTEL_SKYLAKE_SSP_CLK | ||
116 | tristate | ||
117 | |||
118 | config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
119 | bool "HDAudio codec support" | ||
120 | help | ||
121 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ | ||
122 | GeminiLake or CannonLake platform with an HDaudio codec | ||
123 | then enable this option by saying Y | ||
124 | |||
125 | config SND_SOC_INTEL_SKYLAKE_COMMON | ||
126 | tristate | ||
110 | select SND_HDA_EXT_CORE | 127 | select SND_HDA_EXT_CORE |
111 | select SND_HDA_DSP_LOADER | 128 | select SND_HDA_DSP_LOADER |
112 | select SND_SOC_TOPOLOGY | 129 | select SND_SOC_TOPOLOGY |
113 | select SND_SOC_INTEL_SST | 130 | select SND_SOC_INTEL_SST |
131 | select SND_SOC_HDAC_HDA if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
114 | select SND_SOC_ACPI_INTEL_MATCH | 132 | select SND_SOC_ACPI_INTEL_MATCH |
115 | help | 133 | help |
116 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ | 134 | If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ |
117 | GeminiLake or CannonLake platform with the DSP enabled in the BIOS | 135 | GeminiLake or CannonLake platform with the DSP enabled in the BIOS |
118 | then enable this option by saying Y or m. | 136 | then enable this option by saying Y or m. |
119 | 137 | ||
138 | endif ## SND_SOC_INTEL_SKYLAKE | ||
139 | |||
120 | config SND_SOC_ACPI_INTEL_MATCH | 140 | config SND_SOC_ACPI_INTEL_MATCH |
121 | tristate | 141 | tristate |
122 | select SND_SOC_ACPI if ACPI | 142 | select SND_SOC_ACPI if ACPI |
diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 73ca1350aa31..b177db2a0dbb 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig | |||
@@ -293,16 +293,6 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH | |||
293 | Say Y if you have such a device. | 293 | Say Y if you have such a device. |
294 | If unsure select "N". | 294 | If unsure select "N". |
295 | 295 | ||
296 | config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH | ||
297 | tristate "SKL/KBL/BXT/APL with HDA Codecs" | ||
298 | select SND_SOC_HDAC_HDMI | ||
299 | select SND_SOC_HDAC_HDA | ||
300 | help | ||
301 | This adds support for ASoC machine driver for Intel platforms | ||
302 | SKL/KBL/BXT/APL with iDisp, HDA audio codecs. | ||
303 | Say Y or m if you have such a device. This is a recommended option. | ||
304 | If unsure select "N". | ||
305 | |||
306 | config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH | 296 | config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH |
307 | tristate "GLK with RT5682 and MAX98357A in I2S Mode" | 297 | tristate "GLK with RT5682 and MAX98357A in I2S Mode" |
308 | depends on MFD_INTEL_LPSS && I2C && ACPI | 298 | depends on MFD_INTEL_LPSS && I2C && ACPI |
@@ -319,4 +309,18 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH | |||
319 | 309 | ||
320 | endif ## SND_SOC_INTEL_SKYLAKE | 310 | endif ## SND_SOC_INTEL_SKYLAKE |
321 | 311 | ||
312 | if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
313 | |||
314 | config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH | ||
315 | tristate "SKL/KBL/BXT/APL with HDA Codecs" | ||
316 | select SND_SOC_HDAC_HDMI | ||
317 | # SND_SOC_HDAC_HDA is already selected | ||
318 | help | ||
319 | This adds support for ASoC machine driver for Intel platforms | ||
320 | SKL/KBL/BXT/APL with iDisp, HDA audio codecs. | ||
321 | Say Y or m if you have such a device. This is a recommended option. | ||
322 | If unsure select "N". | ||
323 | |||
324 | endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC | ||
325 | |||
322 | endif ## SND_SOC_INTEL_MACH | 326 | endif ## SND_SOC_INTEL_MACH |
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index db6976f4ddaa..08a5152e635a 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 19 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/dmi.h> | ||
22 | #include <linux/module.h> | 23 | #include <linux/module.h> |
23 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
24 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
@@ -35,6 +36,8 @@ | |||
35 | #define CHT_PLAT_CLK_3_HZ 19200000 | 36 | #define CHT_PLAT_CLK_3_HZ 19200000 |
36 | #define CHT_CODEC_DAI "HiFi" | 37 | #define CHT_CODEC_DAI "HiFi" |
37 | 38 | ||
39 | #define QUIRK_PMC_PLT_CLK_0 0x01 | ||
40 | |||
38 | struct cht_mc_private { | 41 | struct cht_mc_private { |
39 | struct clk *mclk; | 42 | struct clk *mclk; |
40 | struct snd_soc_jack jack; | 43 | struct snd_soc_jack jack; |
@@ -385,11 +388,43 @@ static struct snd_soc_card snd_soc_card_cht = { | |||
385 | .num_controls = ARRAY_SIZE(cht_mc_controls), | 388 | .num_controls = ARRAY_SIZE(cht_mc_controls), |
386 | }; | 389 | }; |
387 | 390 | ||
391 | static const struct dmi_system_id cht_max98090_quirk_table[] = { | ||
392 | { | ||
393 | /* Clapper model Chromebook */ | ||
394 | .matches = { | ||
395 | DMI_MATCH(DMI_PRODUCT_NAME, "Clapper"), | ||
396 | }, | ||
397 | .driver_data = (void *)QUIRK_PMC_PLT_CLK_0, | ||
398 | }, | ||
399 | { | ||
400 | /* Gnawty model Chromebook (Acer Chromebook CB3-111) */ | ||
401 | .matches = { | ||
402 | DMI_MATCH(DMI_PRODUCT_NAME, "Gnawty"), | ||
403 | }, | ||
404 | .driver_data = (void *)QUIRK_PMC_PLT_CLK_0, | ||
405 | }, | ||
406 | { | ||
407 | /* Swanky model Chromebook (Toshiba Chromebook 2) */ | ||
408 | .matches = { | ||
409 | DMI_MATCH(DMI_PRODUCT_NAME, "Swanky"), | ||
410 | }, | ||
411 | .driver_data = (void *)QUIRK_PMC_PLT_CLK_0, | ||
412 | }, | ||
413 | {} | ||
414 | }; | ||
415 | |||
388 | static int snd_cht_mc_probe(struct platform_device *pdev) | 416 | static int snd_cht_mc_probe(struct platform_device *pdev) |
389 | { | 417 | { |
418 | const struct dmi_system_id *dmi_id; | ||
390 | struct device *dev = &pdev->dev; | 419 | struct device *dev = &pdev->dev; |
391 | int ret_val = 0; | 420 | int ret_val = 0; |
392 | struct cht_mc_private *drv; | 421 | struct cht_mc_private *drv; |
422 | const char *mclk_name; | ||
423 | int quirks = 0; | ||
424 | |||
425 | dmi_id = dmi_first_match(cht_max98090_quirk_table); | ||
426 | if (dmi_id) | ||
427 | quirks = (unsigned long)dmi_id->driver_data; | ||
393 | 428 | ||
394 | drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); | 429 | drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); |
395 | if (!drv) | 430 | if (!drv) |
@@ -411,11 +446,16 @@ static int snd_cht_mc_probe(struct platform_device *pdev) | |||
411 | snd_soc_card_cht.dev = &pdev->dev; | 446 | snd_soc_card_cht.dev = &pdev->dev; |
412 | snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); | 447 | snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); |
413 | 448 | ||
414 | drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3"); | 449 | if (quirks & QUIRK_PMC_PLT_CLK_0) |
450 | mclk_name = "pmc_plt_clk_0"; | ||
451 | else | ||
452 | mclk_name = "pmc_plt_clk_3"; | ||
453 | |||
454 | drv->mclk = devm_clk_get(&pdev->dev, mclk_name); | ||
415 | if (IS_ERR(drv->mclk)) { | 455 | if (IS_ERR(drv->mclk)) { |
416 | dev_err(&pdev->dev, | 456 | dev_err(&pdev->dev, |
417 | "Failed to get MCLK from pmc_plt_clk_3: %ld\n", | 457 | "Failed to get MCLK from %s: %ld\n", |
418 | PTR_ERR(drv->mclk)); | 458 | mclk_name, PTR_ERR(drv->mclk)); |
419 | return PTR_ERR(drv->mclk); | 459 | return PTR_ERR(drv->mclk); |
420 | } | 460 | } |
421 | 461 | ||
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index f81e7996aa0c..3f0ac1312982 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -37,7 +37,9 @@ | |||
37 | #include "skl.h" | 37 | #include "skl.h" |
38 | #include "skl-sst-dsp.h" | 38 | #include "skl-sst-dsp.h" |
39 | #include "skl-sst-ipc.h" | 39 | #include "skl-sst-ipc.h" |
40 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
40 | #include "../../../soc/codecs/hdac_hda.h" | 41 | #include "../../../soc/codecs/hdac_hda.h" |
42 | #endif | ||
41 | 43 | ||
42 | /* | 44 | /* |
43 | * initialize the PCI registers | 45 | * initialize the PCI registers |
@@ -661,6 +663,8 @@ static void skl_clock_device_unregister(struct skl *skl) | |||
661 | platform_device_unregister(skl->clk_dev); | 663 | platform_device_unregister(skl->clk_dev); |
662 | } | 664 | } |
663 | 665 | ||
666 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
667 | |||
664 | #define IDISP_INTEL_VENDOR_ID 0x80860000 | 668 | #define IDISP_INTEL_VENDOR_ID 0x80860000 |
665 | 669 | ||
666 | /* | 670 | /* |
@@ -679,6 +683,8 @@ static void load_codec_module(struct hda_codec *codec) | |||
679 | #endif | 683 | #endif |
680 | } | 684 | } |
681 | 685 | ||
686 | #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ | ||
687 | |||
682 | /* | 688 | /* |
683 | * Probe the given codec address | 689 | * Probe the given codec address |
684 | */ | 690 | */ |
@@ -688,9 +694,11 @@ static int probe_codec(struct hdac_bus *bus, int addr) | |||
688 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; | 694 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; |
689 | unsigned int res = -1; | 695 | unsigned int res = -1; |
690 | struct skl *skl = bus_to_skl(bus); | 696 | struct skl *skl = bus_to_skl(bus); |
697 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
691 | struct hdac_hda_priv *hda_codec; | 698 | struct hdac_hda_priv *hda_codec; |
692 | struct hdac_device *hdev; | ||
693 | int err; | 699 | int err; |
700 | #endif | ||
701 | struct hdac_device *hdev; | ||
694 | 702 | ||
695 | mutex_lock(&bus->cmd_mutex); | 703 | mutex_lock(&bus->cmd_mutex); |
696 | snd_hdac_bus_send_cmd(bus, cmd); | 704 | snd_hdac_bus_send_cmd(bus, cmd); |
@@ -700,6 +708,7 @@ static int probe_codec(struct hdac_bus *bus, int addr) | |||
700 | return -EIO; | 708 | return -EIO; |
701 | dev_dbg(bus->dev, "codec #%d probed OK: %x\n", addr, res); | 709 | dev_dbg(bus->dev, "codec #%d probed OK: %x\n", addr, res); |
702 | 710 | ||
711 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) | ||
703 | hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec), | 712 | hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec), |
704 | GFP_KERNEL); | 713 | GFP_KERNEL); |
705 | if (!hda_codec) | 714 | if (!hda_codec) |
@@ -718,6 +727,13 @@ static int probe_codec(struct hdac_bus *bus, int addr) | |||
718 | load_codec_module(&hda_codec->codec); | 727 | load_codec_module(&hda_codec->codec); |
719 | } | 728 | } |
720 | return 0; | 729 | return 0; |
730 | #else | ||
731 | hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL); | ||
732 | if (!hdev) | ||
733 | return -ENOMEM; | ||
734 | |||
735 | return snd_hdac_ext_bus_device_init(bus, addr, hdev); | ||
736 | #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ | ||
721 | } | 737 | } |
722 | 738 | ||
723 | /* Codec initialization */ | 739 | /* Codec initialization */ |
@@ -818,6 +834,12 @@ static void skl_probe_work(struct work_struct *work) | |||
818 | } | 834 | } |
819 | } | 835 | } |
820 | 836 | ||
837 | /* | ||
838 | * we are done probing so decrement link counts | ||
839 | */ | ||
840 | list_for_each_entry(hlink, &bus->hlink_list, list) | ||
841 | snd_hdac_ext_bus_link_put(bus, hlink); | ||
842 | |||
821 | if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) { | 843 | if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) { |
822 | err = snd_hdac_display_power(bus, false); | 844 | err = snd_hdac_display_power(bus, false); |
823 | if (err < 0) { | 845 | if (err < 0) { |
@@ -827,12 +849,6 @@ static void skl_probe_work(struct work_struct *work) | |||
827 | } | 849 | } |
828 | } | 850 | } |
829 | 851 | ||
830 | /* | ||
831 | * we are done probing so decrement link counts | ||
832 | */ | ||
833 | list_for_each_entry(hlink, &bus->hlink_list, list) | ||
834 | snd_hdac_ext_bus_link_put(bus, hlink); | ||
835 | |||
836 | /* configure PM */ | 852 | /* configure PM */ |
837 | pm_runtime_put_noidle(bus->dev); | 853 | pm_runtime_put_noidle(bus->dev); |
838 | pm_runtime_allow(bus->dev); | 854 | pm_runtime_allow(bus->dev); |
@@ -873,7 +889,7 @@ static int skl_create(struct pci_dev *pci, | |||
873 | hbus = skl_to_hbus(skl); | 889 | hbus = skl_to_hbus(skl); |
874 | bus = skl_to_bus(skl); | 890 | bus = skl_to_bus(skl); |
875 | 891 | ||
876 | #if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA) | 892 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) |
877 | ext_ops = snd_soc_hdac_hda_get_ops(); | 893 | ext_ops = snd_soc_hdac_hda_get_ops(); |
878 | #endif | 894 | #endif |
879 | snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, ext_ops); | 895 | snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, ext_ops); |
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index d5ae9eb8c756..fed45b41f9d3 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c | |||
@@ -36,6 +36,8 @@ | |||
36 | #include "../codecs/twl6040.h" | 36 | #include "../codecs/twl6040.h" |
37 | 37 | ||
38 | struct abe_twl6040 { | 38 | struct abe_twl6040 { |
39 | struct snd_soc_card card; | ||
40 | struct snd_soc_dai_link dai_links[2]; | ||
39 | int jack_detection; /* board can detect jack events */ | 41 | int jack_detection; /* board can detect jack events */ |
40 | int mclk_freq; /* MCLK frequency speed for twl6040 */ | 42 | int mclk_freq; /* MCLK frequency speed for twl6040 */ |
41 | }; | 43 | }; |
@@ -208,40 +210,10 @@ static int omap_abe_dmic_init(struct snd_soc_pcm_runtime *rtd) | |||
208 | ARRAY_SIZE(dmic_audio_map)); | 210 | ARRAY_SIZE(dmic_audio_map)); |
209 | } | 211 | } |
210 | 212 | ||
211 | /* Digital audio interface glue - connects codec <--> CPU */ | ||
212 | static struct snd_soc_dai_link abe_twl6040_dai_links[] = { | ||
213 | { | ||
214 | .name = "TWL6040", | ||
215 | .stream_name = "TWL6040", | ||
216 | .codec_dai_name = "twl6040-legacy", | ||
217 | .codec_name = "twl6040-codec", | ||
218 | .init = omap_abe_twl6040_init, | ||
219 | .ops = &omap_abe_ops, | ||
220 | }, | ||
221 | { | ||
222 | .name = "DMIC", | ||
223 | .stream_name = "DMIC Capture", | ||
224 | .codec_dai_name = "dmic-hifi", | ||
225 | .codec_name = "dmic-codec", | ||
226 | .init = omap_abe_dmic_init, | ||
227 | .ops = &omap_abe_dmic_ops, | ||
228 | }, | ||
229 | }; | ||
230 | |||
231 | /* Audio machine driver */ | ||
232 | static struct snd_soc_card omap_abe_card = { | ||
233 | .owner = THIS_MODULE, | ||
234 | |||
235 | .dapm_widgets = twl6040_dapm_widgets, | ||
236 | .num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets), | ||
237 | .dapm_routes = audio_map, | ||
238 | .num_dapm_routes = ARRAY_SIZE(audio_map), | ||
239 | }; | ||
240 | |||
241 | static int omap_abe_probe(struct platform_device *pdev) | 213 | static int omap_abe_probe(struct platform_device *pdev) |
242 | { | 214 | { |
243 | struct device_node *node = pdev->dev.of_node; | 215 | struct device_node *node = pdev->dev.of_node; |
244 | struct snd_soc_card *card = &omap_abe_card; | 216 | struct snd_soc_card *card; |
245 | struct device_node *dai_node; | 217 | struct device_node *dai_node; |
246 | struct abe_twl6040 *priv; | 218 | struct abe_twl6040 *priv; |
247 | int num_links = 0; | 219 | int num_links = 0; |
@@ -252,12 +224,18 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
252 | return -ENODEV; | 224 | return -ENODEV; |
253 | } | 225 | } |
254 | 226 | ||
255 | card->dev = &pdev->dev; | ||
256 | |||
257 | priv = devm_kzalloc(&pdev->dev, sizeof(struct abe_twl6040), GFP_KERNEL); | 227 | priv = devm_kzalloc(&pdev->dev, sizeof(struct abe_twl6040), GFP_KERNEL); |
258 | if (priv == NULL) | 228 | if (priv == NULL) |
259 | return -ENOMEM; | 229 | return -ENOMEM; |
260 | 230 | ||
231 | card = &priv->card; | ||
232 | card->dev = &pdev->dev; | ||
233 | card->owner = THIS_MODULE; | ||
234 | card->dapm_widgets = twl6040_dapm_widgets; | ||
235 | card->num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets); | ||
236 | card->dapm_routes = audio_map; | ||
237 | card->num_dapm_routes = ARRAY_SIZE(audio_map); | ||
238 | |||
261 | if (snd_soc_of_parse_card_name(card, "ti,model")) { | 239 | if (snd_soc_of_parse_card_name(card, "ti,model")) { |
262 | dev_err(&pdev->dev, "Card name is not provided\n"); | 240 | dev_err(&pdev->dev, "Card name is not provided\n"); |
263 | return -ENODEV; | 241 | return -ENODEV; |
@@ -274,14 +252,27 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
274 | dev_err(&pdev->dev, "McPDM node is not provided\n"); | 252 | dev_err(&pdev->dev, "McPDM node is not provided\n"); |
275 | return -EINVAL; | 253 | return -EINVAL; |
276 | } | 254 | } |
277 | abe_twl6040_dai_links[0].cpu_of_node = dai_node; | 255 | |
278 | abe_twl6040_dai_links[0].platform_of_node = dai_node; | 256 | priv->dai_links[0].name = "DMIC"; |
257 | priv->dai_links[0].stream_name = "TWL6040"; | ||
258 | priv->dai_links[0].cpu_of_node = dai_node; | ||
259 | priv->dai_links[0].platform_of_node = dai_node; | ||
260 | priv->dai_links[0].codec_dai_name = "twl6040-legacy"; | ||
261 | priv->dai_links[0].codec_name = "twl6040-codec"; | ||
262 | priv->dai_links[0].init = omap_abe_twl6040_init; | ||
263 | priv->dai_links[0].ops = &omap_abe_ops; | ||
279 | 264 | ||
280 | dai_node = of_parse_phandle(node, "ti,dmic", 0); | 265 | dai_node = of_parse_phandle(node, "ti,dmic", 0); |
281 | if (dai_node) { | 266 | if (dai_node) { |
282 | num_links = 2; | 267 | num_links = 2; |
283 | abe_twl6040_dai_links[1].cpu_of_node = dai_node; | 268 | priv->dai_links[1].name = "TWL6040"; |
284 | abe_twl6040_dai_links[1].platform_of_node = dai_node; | 269 | priv->dai_links[1].stream_name = "DMIC Capture"; |
270 | priv->dai_links[1].cpu_of_node = dai_node; | ||
271 | priv->dai_links[1].platform_of_node = dai_node; | ||
272 | priv->dai_links[1].codec_dai_name = "dmic-hifi"; | ||
273 | priv->dai_links[1].codec_name = "dmic-codec"; | ||
274 | priv->dai_links[1].init = omap_abe_dmic_init; | ||
275 | priv->dai_links[1].ops = &omap_abe_dmic_ops; | ||
285 | } else { | 276 | } else { |
286 | num_links = 1; | 277 | num_links = 1; |
287 | } | 278 | } |
@@ -300,7 +291,7 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
300 | return -ENODEV; | 291 | return -ENODEV; |
301 | } | 292 | } |
302 | 293 | ||
303 | card->dai_link = abe_twl6040_dai_links; | 294 | card->dai_link = priv->dai_links; |
304 | card->num_links = num_links; | 295 | card->num_links = num_links; |
305 | 296 | ||
306 | snd_soc_card_set_drvdata(card, priv); | 297 | snd_soc_card_set_drvdata(card, priv); |
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index fe966272bd0c..cba9645b6487 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c | |||
@@ -48,6 +48,8 @@ struct omap_dmic { | |||
48 | struct device *dev; | 48 | struct device *dev; |
49 | void __iomem *io_base; | 49 | void __iomem *io_base; |
50 | struct clk *fclk; | 50 | struct clk *fclk; |
51 | struct pm_qos_request pm_qos_req; | ||
52 | int latency; | ||
51 | int fclk_freq; | 53 | int fclk_freq; |
52 | int out_freq; | 54 | int out_freq; |
53 | int clk_div; | 55 | int clk_div; |
@@ -124,6 +126,8 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream, | |||
124 | 126 | ||
125 | mutex_lock(&dmic->mutex); | 127 | mutex_lock(&dmic->mutex); |
126 | 128 | ||
129 | pm_qos_remove_request(&dmic->pm_qos_req); | ||
130 | |||
127 | if (!dai->active) | 131 | if (!dai->active) |
128 | dmic->active = 0; | 132 | dmic->active = 0; |
129 | 133 | ||
@@ -228,6 +232,8 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_substream *substream, | |||
228 | /* packet size is threshold * channels */ | 232 | /* packet size is threshold * channels */ |
229 | dma_data = snd_soc_dai_get_dma_data(dai, substream); | 233 | dma_data = snd_soc_dai_get_dma_data(dai, substream); |
230 | dma_data->maxburst = dmic->threshold * channels; | 234 | dma_data->maxburst = dmic->threshold * channels; |
235 | dmic->latency = (OMAP_DMIC_THRES_MAX - dmic->threshold) * USEC_PER_SEC / | ||
236 | params_rate(params); | ||
231 | 237 | ||
232 | return 0; | 238 | return 0; |
233 | } | 239 | } |
@@ -238,6 +244,9 @@ static int omap_dmic_dai_prepare(struct snd_pcm_substream *substream, | |||
238 | struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai); | 244 | struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai); |
239 | u32 ctrl; | 245 | u32 ctrl; |
240 | 246 | ||
247 | if (pm_qos_request_active(&dmic->pm_qos_req)) | ||
248 | pm_qos_update_request(&dmic->pm_qos_req, dmic->latency); | ||
249 | |||
241 | /* Configure uplink threshold */ | 250 | /* Configure uplink threshold */ |
242 | omap_dmic_write(dmic, OMAP_DMIC_FIFO_CTRL_REG, dmic->threshold); | 251 | omap_dmic_write(dmic, OMAP_DMIC_FIFO_CTRL_REG, dmic->threshold); |
243 | 252 | ||
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index e0ef4774c710..a395598f1f20 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -999,9 +999,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, | |||
999 | pkt_size = channels; | 999 | pkt_size = channels; |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | latency = ((((buffer_size - pkt_size) / channels) * 1000) | 1002 | latency = (buffer_size - pkt_size) / channels; |
1003 | / (params->rate_num / params->rate_den)); | 1003 | latency = latency * USEC_PER_SEC / |
1004 | 1004 | (params->rate_num / params->rate_den); | |
1005 | mcbsp->latency[substream->stream] = latency; | 1005 | mcbsp->latency[substream->stream] = latency; |
1006 | 1006 | ||
1007 | omap_mcbsp_set_threshold(substream, pkt_size); | 1007 | omap_mcbsp_set_threshold(substream, pkt_size); |
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index 4c1be36c2207..7d5bdc5a2890 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c | |||
@@ -54,6 +54,8 @@ struct omap_mcpdm { | |||
54 | unsigned long phys_base; | 54 | unsigned long phys_base; |
55 | void __iomem *io_base; | 55 | void __iomem *io_base; |
56 | int irq; | 56 | int irq; |
57 | struct pm_qos_request pm_qos_req; | ||
58 | int latency[2]; | ||
57 | 59 | ||
58 | struct mutex mutex; | 60 | struct mutex mutex; |
59 | 61 | ||
@@ -277,6 +279,9 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, | |||
277 | struct snd_soc_dai *dai) | 279 | struct snd_soc_dai *dai) |
278 | { | 280 | { |
279 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); | 281 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); |
282 | int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); | ||
283 | int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; | ||
284 | int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; | ||
280 | 285 | ||
281 | mutex_lock(&mcpdm->mutex); | 286 | mutex_lock(&mcpdm->mutex); |
282 | 287 | ||
@@ -289,6 +294,14 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, | |||
289 | } | 294 | } |
290 | } | 295 | } |
291 | 296 | ||
297 | if (mcpdm->latency[stream2]) | ||
298 | pm_qos_update_request(&mcpdm->pm_qos_req, | ||
299 | mcpdm->latency[stream2]); | ||
300 | else if (mcpdm->latency[stream1]) | ||
301 | pm_qos_remove_request(&mcpdm->pm_qos_req); | ||
302 | |||
303 | mcpdm->latency[stream1] = 0; | ||
304 | |||
292 | mutex_unlock(&mcpdm->mutex); | 305 | mutex_unlock(&mcpdm->mutex); |
293 | } | 306 | } |
294 | 307 | ||
@@ -300,7 +313,7 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, | |||
300 | int stream = substream->stream; | 313 | int stream = substream->stream; |
301 | struct snd_dmaengine_dai_dma_data *dma_data; | 314 | struct snd_dmaengine_dai_dma_data *dma_data; |
302 | u32 threshold; | 315 | u32 threshold; |
303 | int channels; | 316 | int channels, latency; |
304 | int link_mask = 0; | 317 | int link_mask = 0; |
305 | 318 | ||
306 | channels = params_channels(params); | 319 | channels = params_channels(params); |
@@ -344,14 +357,25 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, | |||
344 | 357 | ||
345 | dma_data->maxburst = | 358 | dma_data->maxburst = |
346 | (MCPDM_DN_THRES_MAX - threshold) * channels; | 359 | (MCPDM_DN_THRES_MAX - threshold) * channels; |
360 | latency = threshold; | ||
347 | } else { | 361 | } else { |
348 | /* If playback is not running assume a stereo stream to come */ | 362 | /* If playback is not running assume a stereo stream to come */ |
349 | if (!mcpdm->config[!stream].link_mask) | 363 | if (!mcpdm->config[!stream].link_mask) |
350 | mcpdm->config[!stream].link_mask = (0x3 << 3); | 364 | mcpdm->config[!stream].link_mask = (0x3 << 3); |
351 | 365 | ||
352 | dma_data->maxburst = threshold * channels; | 366 | dma_data->maxburst = threshold * channels; |
367 | latency = (MCPDM_DN_THRES_MAX - threshold); | ||
353 | } | 368 | } |
354 | 369 | ||
370 | /* | ||
371 | * The DMA must act to a DMA request within latency time (usec) to avoid | ||
372 | * under/overflow | ||
373 | */ | ||
374 | mcpdm->latency[stream] = latency * USEC_PER_SEC / params_rate(params); | ||
375 | |||
376 | if (!mcpdm->latency[stream]) | ||
377 | mcpdm->latency[stream] = 10; | ||
378 | |||
355 | /* Check if we need to restart McPDM with this stream */ | 379 | /* Check if we need to restart McPDM with this stream */ |
356 | if (mcpdm->config[stream].link_mask && | 380 | if (mcpdm->config[stream].link_mask && |
357 | mcpdm->config[stream].link_mask != link_mask) | 381 | mcpdm->config[stream].link_mask != link_mask) |
@@ -366,6 +390,20 @@ static int omap_mcpdm_prepare(struct snd_pcm_substream *substream, | |||
366 | struct snd_soc_dai *dai) | 390 | struct snd_soc_dai *dai) |
367 | { | 391 | { |
368 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); | 392 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); |
393 | struct pm_qos_request *pm_qos_req = &mcpdm->pm_qos_req; | ||
394 | int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); | ||
395 | int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; | ||
396 | int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; | ||
397 | int latency = mcpdm->latency[stream2]; | ||
398 | |||
399 | /* Prevent omap hardware from hitting off between FIFO fills */ | ||
400 | if (!latency || mcpdm->latency[stream1] < latency) | ||
401 | latency = mcpdm->latency[stream1]; | ||
402 | |||
403 | if (pm_qos_request_active(pm_qos_req)) | ||
404 | pm_qos_update_request(pm_qos_req, latency); | ||
405 | else if (latency) | ||
406 | pm_qos_add_request(pm_qos_req, PM_QOS_CPU_DMA_LATENCY, latency); | ||
369 | 407 | ||
370 | if (!omap_mcpdm_active(mcpdm)) { | 408 | if (!omap_mcpdm_active(mcpdm)) { |
371 | omap_mcpdm_start(mcpdm); | 409 | omap_mcpdm_start(mcpdm); |
@@ -427,6 +465,9 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai) | |||
427 | free_irq(mcpdm->irq, (void *)mcpdm); | 465 | free_irq(mcpdm->irq, (void *)mcpdm); |
428 | pm_runtime_disable(mcpdm->dev); | 466 | pm_runtime_disable(mcpdm->dev); |
429 | 467 | ||
468 | if (pm_qos_request_active(&mcpdm->pm_qos_req)) | ||
469 | pm_qos_remove_request(&mcpdm->pm_qos_req); | ||
470 | |||
430 | return 0; | 471 | return 0; |
431 | } | 472 | } |
432 | 473 | ||
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index eb1b9da05dd4..4715527054e5 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c | |||
@@ -13,6 +13,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card) | |||
13 | struct device_node *cpu = NULL; | 13 | struct device_node *cpu = NULL; |
14 | struct device *dev = card->dev; | 14 | struct device *dev = card->dev; |
15 | struct snd_soc_dai_link *link; | 15 | struct snd_soc_dai_link *link; |
16 | struct of_phandle_args args; | ||
16 | int ret, num_links; | 17 | int ret, num_links; |
17 | 18 | ||
18 | ret = snd_soc_of_parse_card_name(card, "model"); | 19 | ret = snd_soc_of_parse_card_name(card, "model"); |
@@ -47,12 +48,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card) | |||
47 | goto err; | 48 | goto err; |
48 | } | 49 | } |
49 | 50 | ||
50 | link->cpu_of_node = of_parse_phandle(cpu, "sound-dai", 0); | 51 | ret = of_parse_phandle_with_args(cpu, "sound-dai", |
51 | if (!link->cpu_of_node) { | 52 | "#sound-dai-cells", 0, &args); |
53 | if (ret) { | ||
52 | dev_err(card->dev, "error getting cpu phandle\n"); | 54 | dev_err(card->dev, "error getting cpu phandle\n"); |
53 | ret = -EINVAL; | ||
54 | goto err; | 55 | goto err; |
55 | } | 56 | } |
57 | link->cpu_of_node = args.np; | ||
58 | link->id = args.args[0]; | ||
56 | 59 | ||
57 | ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name); | 60 | ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name); |
58 | if (ret) { | 61 | if (ret) { |
diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index a07a4538d5cf..bfc3bbf1d4de 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c | |||
@@ -1112,204 +1112,204 @@ static int q6afe_of_xlate_dai_name(struct snd_soc_component *component, | |||
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | static const struct snd_soc_dapm_widget q6afe_dai_widgets[] = { | 1114 | static const struct snd_soc_dapm_widget q6afe_dai_widgets[] = { |
1115 | SND_SOC_DAPM_AIF_OUT("HDMI_RX", "HDMI Playback", 0, 0, 0, 0), | 1115 | SND_SOC_DAPM_AIF_IN("HDMI_RX", NULL, 0, 0, 0, 0), |
1116 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_0_RX", "Slimbus Playback", 0, 0, 0, 0), | 1116 | SND_SOC_DAPM_AIF_IN("SLIMBUS_0_RX", NULL, 0, 0, 0, 0), |
1117 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_1_RX", "Slimbus1 Playback", 0, 0, 0, 0), | 1117 | SND_SOC_DAPM_AIF_IN("SLIMBUS_1_RX", NULL, 0, 0, 0, 0), |
1118 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_2_RX", "Slimbus2 Playback", 0, 0, 0, 0), | 1118 | SND_SOC_DAPM_AIF_IN("SLIMBUS_2_RX", NULL, 0, 0, 0, 0), |
1119 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_3_RX", "Slimbus3 Playback", 0, 0, 0, 0), | 1119 | SND_SOC_DAPM_AIF_IN("SLIMBUS_3_RX", NULL, 0, 0, 0, 0), |
1120 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_RX", "Slimbus4 Playback", 0, 0, 0, 0), | 1120 | SND_SOC_DAPM_AIF_IN("SLIMBUS_4_RX", NULL, 0, 0, 0, 0), |
1121 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_5_RX", "Slimbus5 Playback", 0, 0, 0, 0), | 1121 | SND_SOC_DAPM_AIF_IN("SLIMBUS_5_RX", NULL, 0, 0, 0, 0), |
1122 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_6_RX", "Slimbus6 Playback", 0, 0, 0, 0), | 1122 | SND_SOC_DAPM_AIF_IN("SLIMBUS_6_RX", NULL, 0, 0, 0, 0), |
1123 | SND_SOC_DAPM_AIF_IN("SLIMBUS_0_TX", "Slimbus Capture", 0, 0, 0, 0), | 1123 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_0_TX", NULL, 0, 0, 0, 0), |
1124 | SND_SOC_DAPM_AIF_IN("SLIMBUS_1_TX", "Slimbus1 Capture", 0, 0, 0, 0), | 1124 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_1_TX", NULL, 0, 0, 0, 0), |
1125 | SND_SOC_DAPM_AIF_IN("SLIMBUS_2_TX", "Slimbus2 Capture", 0, 0, 0, 0), | 1125 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_2_TX", NULL, 0, 0, 0, 0), |
1126 | SND_SOC_DAPM_AIF_IN("SLIMBUS_3_TX", "Slimbus3 Capture", 0, 0, 0, 0), | 1126 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_3_TX", NULL, 0, 0, 0, 0), |
1127 | SND_SOC_DAPM_AIF_IN("SLIMBUS_4_TX", "Slimbus4 Capture", 0, 0, 0, 0), | 1127 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_TX", NULL, 0, 0, 0, 0), |
1128 | SND_SOC_DAPM_AIF_IN("SLIMBUS_5_TX", "Slimbus5 Capture", 0, 0, 0, 0), | 1128 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_5_TX", NULL, 0, 0, 0, 0), |
1129 | SND_SOC_DAPM_AIF_IN("SLIMBUS_6_TX", "Slimbus6 Capture", 0, 0, 0, 0), | 1129 | SND_SOC_DAPM_AIF_OUT("SLIMBUS_6_TX", NULL, 0, 0, 0, 0), |
1130 | SND_SOC_DAPM_AIF_OUT("QUAT_MI2S_RX", "Quaternary MI2S Playback", | 1130 | SND_SOC_DAPM_AIF_IN("QUAT_MI2S_RX", NULL, |
1131 | 0, 0, 0, 0), | 1131 | 0, 0, 0, 0), |
1132 | SND_SOC_DAPM_AIF_IN("QUAT_MI2S_TX", "Quaternary MI2S Capture", | 1132 | SND_SOC_DAPM_AIF_OUT("QUAT_MI2S_TX", NULL, |
1133 | 0, 0, 0, 0), | 1133 | 0, 0, 0, 0), |
1134 | SND_SOC_DAPM_AIF_OUT("TERT_MI2S_RX", "Tertiary MI2S Playback", | 1134 | SND_SOC_DAPM_AIF_IN("TERT_MI2S_RX", NULL, |
1135 | 0, 0, 0, 0), | 1135 | 0, 0, 0, 0), |
1136 | SND_SOC_DAPM_AIF_IN("TERT_MI2S_TX", "Tertiary MI2S Capture", | 1136 | SND_SOC_DAPM_AIF_OUT("TERT_MI2S_TX", NULL, |
1137 | 0, 0, 0, 0), | 1137 | 0, 0, 0, 0), |
1138 | SND_SOC_DAPM_AIF_OUT("SEC_MI2S_RX", "Secondary MI2S Playback", | 1138 | SND_SOC_DAPM_AIF_IN("SEC_MI2S_RX", NULL, |
1139 | 0, 0, 0, 0), | 1139 | 0, 0, 0, 0), |
1140 | SND_SOC_DAPM_AIF_IN("SEC_MI2S_TX", "Secondary MI2S Capture", | 1140 | SND_SOC_DAPM_AIF_OUT("SEC_MI2S_TX", NULL, |
1141 | 0, 0, 0, 0), | 1141 | 0, 0, 0, 0), |
1142 | SND_SOC_DAPM_AIF_OUT("SEC_MI2S_RX_SD1", | 1142 | SND_SOC_DAPM_AIF_IN("SEC_MI2S_RX_SD1", |
1143 | "Secondary MI2S Playback SD1", | 1143 | "Secondary MI2S Playback SD1", |
1144 | 0, 0, 0, 0), | 1144 | 0, 0, 0, 0), |
1145 | SND_SOC_DAPM_AIF_OUT("PRI_MI2S_RX", "Primary MI2S Playback", | 1145 | SND_SOC_DAPM_AIF_IN("PRI_MI2S_RX", NULL, |
1146 | 0, 0, 0, 0), | 1146 | 0, 0, 0, 0), |
1147 | SND_SOC_DAPM_AIF_IN("PRI_MI2S_TX", "Primary MI2S Capture", | 1147 | SND_SOC_DAPM_AIF_OUT("PRI_MI2S_TX", NULL, |
1148 | 0, 0, 0, 0), | 1148 | 0, 0, 0, 0), |
1149 | 1149 | ||
1150 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_0", "Primary TDM0 Playback", | 1150 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_0", NULL, |
1151 | 0, 0, 0, 0), | 1151 | 0, 0, 0, 0), |
1152 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_1", "Primary TDM1 Playback", | 1152 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_1", NULL, |
1153 | 0, 0, 0, 0), | 1153 | 0, 0, 0, 0), |
1154 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_2", "Primary TDM2 Playback", | 1154 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_2", NULL, |
1155 | 0, 0, 0, 0), | 1155 | 0, 0, 0, 0), |
1156 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_3", "Primary TDM3 Playback", | 1156 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_3", NULL, |
1157 | 0, 0, 0, 0), | 1157 | 0, 0, 0, 0), |
1158 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_4", "Primary TDM4 Playback", | 1158 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_4", NULL, |
1159 | 0, 0, 0, 0), | 1159 | 0, 0, 0, 0), |
1160 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_5", "Primary TDM5 Playback", | 1160 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_5", NULL, |
1161 | 0, 0, 0, 0), | 1161 | 0, 0, 0, 0), |
1162 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_6", "Primary TDM6 Playback", | 1162 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_6", NULL, |
1163 | 0, 0, 0, 0), | 1163 | 0, 0, 0, 0), |
1164 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_RX_7", "Primary TDM7 Playback", | 1164 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_RX_7", NULL, |
1165 | 0, 0, 0, 0), | 1165 | 0, 0, 0, 0), |
1166 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_0", "Primary TDM0 Capture", | 1166 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_0", NULL, |
1167 | 0, 0, 0, 0), | 1167 | 0, 0, 0, 0), |
1168 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_1", "Primary TDM1 Capture", | 1168 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_1", NULL, |
1169 | 0, 0, 0, 0), | 1169 | 0, 0, 0, 0), |
1170 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_2", "Primary TDM2 Capture", | 1170 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_2", NULL, |
1171 | 0, 0, 0, 0), | 1171 | 0, 0, 0, 0), |
1172 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_3", "Primary TDM3 Capture", | 1172 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_3", NULL, |
1173 | 0, 0, 0, 0), | 1173 | 0, 0, 0, 0), |
1174 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_4", "Primary TDM4 Capture", | 1174 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_4", NULL, |
1175 | 0, 0, 0, 0), | 1175 | 0, 0, 0, 0), |
1176 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_5", "Primary TDM5 Capture", | 1176 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_5", NULL, |
1177 | 0, 0, 0, 0), | 1177 | 0, 0, 0, 0), |
1178 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_6", "Primary TDM6 Capture", | 1178 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_6", NULL, |
1179 | 0, 0, 0, 0), | 1179 | 0, 0, 0, 0), |
1180 | SND_SOC_DAPM_AIF_IN("PRIMARY_TDM_TX_7", "Primary TDM7 Capture", | 1180 | SND_SOC_DAPM_AIF_OUT("PRIMARY_TDM_TX_7", NULL, |
1181 | 0, 0, 0, 0), | 1181 | 0, 0, 0, 0), |
1182 | 1182 | ||
1183 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_0", "Secondary TDM0 Playback", | 1183 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_0", NULL, |
1184 | 0, 0, 0, 0), | 1184 | 0, 0, 0, 0), |
1185 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_1", "Secondary TDM1 Playback", | 1185 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_1", NULL, |
1186 | 0, 0, 0, 0), | 1186 | 0, 0, 0, 0), |
1187 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_2", "Secondary TDM2 Playback", | 1187 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_2", NULL, |
1188 | 0, 0, 0, 0), | 1188 | 0, 0, 0, 0), |
1189 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_3", "Secondary TDM3 Playback", | 1189 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_3", NULL, |
1190 | 0, 0, 0, 0), | 1190 | 0, 0, 0, 0), |
1191 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_4", "Secondary TDM4 Playback", | 1191 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_4", NULL, |
1192 | 0, 0, 0, 0), | 1192 | 0, 0, 0, 0), |
1193 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_5", "Secondary TDM5 Playback", | 1193 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_5", NULL, |
1194 | 0, 0, 0, 0), | 1194 | 0, 0, 0, 0), |
1195 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_6", "Secondary TDM6 Playback", | 1195 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_6", NULL, |
1196 | 0, 0, 0, 0), | 1196 | 0, 0, 0, 0), |
1197 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_RX_7", "Secondary TDM7 Playback", | 1197 | SND_SOC_DAPM_AIF_IN("SEC_TDM_RX_7", NULL, |
1198 | 0, 0, 0, 0), | 1198 | 0, 0, 0, 0), |
1199 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_0", "Secondary TDM0 Capture", | 1199 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_0", NULL, |
1200 | 0, 0, 0, 0), | 1200 | 0, 0, 0, 0), |
1201 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_1", "Secondary TDM1 Capture", | 1201 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_1", NULL, |
1202 | 0, 0, 0, 0), | 1202 | 0, 0, 0, 0), |
1203 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_2", "Secondary TDM2 Capture", | 1203 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_2", NULL, |
1204 | 0, 0, 0, 0), | 1204 | 0, 0, 0, 0), |
1205 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_3", "Secondary TDM3 Capture", | 1205 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_3", NULL, |
1206 | 0, 0, 0, 0), | 1206 | 0, 0, 0, 0), |
1207 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_4", "Secondary TDM4 Capture", | 1207 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_4", NULL, |
1208 | 0, 0, 0, 0), | 1208 | 0, 0, 0, 0), |
1209 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_5", "Secondary TDM5 Capture", | 1209 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_5", NULL, |
1210 | 0, 0, 0, 0), | 1210 | 0, 0, 0, 0), |
1211 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_6", "Secondary TDM6 Capture", | 1211 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_6", NULL, |
1212 | 0, 0, 0, 0), | 1212 | 0, 0, 0, 0), |
1213 | SND_SOC_DAPM_AIF_IN("SEC_TDM_TX_7", "Secondary TDM7 Capture", | 1213 | SND_SOC_DAPM_AIF_OUT("SEC_TDM_TX_7", NULL, |
1214 | 0, 0, 0, 0), | 1214 | 0, 0, 0, 0), |
1215 | 1215 | ||
1216 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_0", "Tertiary TDM0 Playback", | 1216 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_0", NULL, |
1217 | 0, 0, 0, 0), | 1217 | 0, 0, 0, 0), |
1218 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_1", "Tertiary TDM1 Playback", | 1218 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_1", NULL, |
1219 | 0, 0, 0, 0), | 1219 | 0, 0, 0, 0), |
1220 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_2", "Tertiary TDM2 Playback", | 1220 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_2", NULL, |
1221 | 0, 0, 0, 0), | 1221 | 0, 0, 0, 0), |
1222 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_3", "Tertiary TDM3 Playback", | 1222 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_3", NULL, |
1223 | 0, 0, 0, 0), | 1223 | 0, 0, 0, 0), |
1224 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_4", "Tertiary TDM4 Playback", | 1224 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_4", NULL, |
1225 | 0, 0, 0, 0), | 1225 | 0, 0, 0, 0), |
1226 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_5", "Tertiary TDM5 Playback", | 1226 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_5", NULL, |
1227 | 0, 0, 0, 0), | 1227 | 0, 0, 0, 0), |
1228 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_6", "Tertiary TDM6 Playback", | 1228 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_6", NULL, |
1229 | 0, 0, 0, 0), | 1229 | 0, 0, 0, 0), |
1230 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_RX_7", "Tertiary TDM7 Playback", | 1230 | SND_SOC_DAPM_AIF_IN("TERT_TDM_RX_7", NULL, |
1231 | 0, 0, 0, 0), | 1231 | 0, 0, 0, 0), |
1232 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_0", "Tertiary TDM0 Capture", | 1232 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_0", NULL, |
1233 | 0, 0, 0, 0), | 1233 | 0, 0, 0, 0), |
1234 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_1", "Tertiary TDM1 Capture", | 1234 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_1", NULL, |
1235 | 0, 0, 0, 0), | 1235 | 0, 0, 0, 0), |
1236 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_2", "Tertiary TDM2 Capture", | 1236 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_2", NULL, |
1237 | 0, 0, 0, 0), | 1237 | 0, 0, 0, 0), |
1238 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_3", "Tertiary TDM3 Capture", | 1238 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_3", NULL, |
1239 | 0, 0, 0, 0), | 1239 | 0, 0, 0, 0), |
1240 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_4", "Tertiary TDM4 Capture", | 1240 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_4", NULL, |
1241 | 0, 0, 0, 0), | 1241 | 0, 0, 0, 0), |
1242 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_5", "Tertiary TDM5 Capture", | 1242 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_5", NULL, |
1243 | 0, 0, 0, 0), | 1243 | 0, 0, 0, 0), |
1244 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_6", "Tertiary TDM6 Capture", | 1244 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_6", NULL, |
1245 | 0, 0, 0, 0), | 1245 | 0, 0, 0, 0), |
1246 | SND_SOC_DAPM_AIF_IN("TERT_TDM_TX_7", "Tertiary TDM7 Capture", | 1246 | SND_SOC_DAPM_AIF_OUT("TERT_TDM_TX_7", NULL, |
1247 | 0, 0, 0, 0), | 1247 | 0, 0, 0, 0), |
1248 | 1248 | ||
1249 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_0", "Quaternary TDM0 Playback", | 1249 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_0", NULL, |
1250 | 0, 0, 0, 0), | 1250 | 0, 0, 0, 0), |
1251 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_1", "Quaternary TDM1 Playback", | 1251 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_1", NULL, |
1252 | 0, 0, 0, 0), | 1252 | 0, 0, 0, 0), |
1253 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_2", "Quaternary TDM2 Playback", | 1253 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_2", NULL, |
1254 | 0, 0, 0, 0), | 1254 | 0, 0, 0, 0), |
1255 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_3", "Quaternary TDM3 Playback", | 1255 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_3", NULL, |
1256 | 0, 0, 0, 0), | 1256 | 0, 0, 0, 0), |
1257 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_4", "Quaternary TDM4 Playback", | 1257 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_4", NULL, |
1258 | 0, 0, 0, 0), | 1258 | 0, 0, 0, 0), |
1259 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_5", "Quaternary TDM5 Playback", | 1259 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_5", NULL, |
1260 | 0, 0, 0, 0), | 1260 | 0, 0, 0, 0), |
1261 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_6", "Quaternary TDM6 Playback", | 1261 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_6", NULL, |
1262 | 0, 0, 0, 0), | 1262 | 0, 0, 0, 0), |
1263 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_RX_7", "Quaternary TDM7 Playback", | 1263 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_RX_7", NULL, |
1264 | 0, 0, 0, 0), | 1264 | 0, 0, 0, 0), |
1265 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_0", "Quaternary TDM0 Capture", | 1265 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_0", NULL, |
1266 | 0, 0, 0, 0), | 1266 | 0, 0, 0, 0), |
1267 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_1", "Quaternary TDM1 Capture", | 1267 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_1", NULL, |
1268 | 0, 0, 0, 0), | 1268 | 0, 0, 0, 0), |
1269 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_2", "Quaternary TDM2 Capture", | 1269 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_2", NULL, |
1270 | 0, 0, 0, 0), | 1270 | 0, 0, 0, 0), |
1271 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_3", "Quaternary TDM3 Capture", | 1271 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_3", NULL, |
1272 | 0, 0, 0, 0), | 1272 | 0, 0, 0, 0), |
1273 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_4", "Quaternary TDM4 Capture", | 1273 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_4", NULL, |
1274 | 0, 0, 0, 0), | 1274 | 0, 0, 0, 0), |
1275 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_5", "Quaternary TDM5 Capture", | 1275 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_5", NULL, |
1276 | 0, 0, 0, 0), | 1276 | 0, 0, 0, 0), |
1277 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_6", "Quaternary TDM6 Capture", | 1277 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_6", NULL, |
1278 | 0, 0, 0, 0), | 1278 | 0, 0, 0, 0), |
1279 | SND_SOC_DAPM_AIF_IN("QUAT_TDM_TX_7", "Quaternary TDM7 Capture", | 1279 | SND_SOC_DAPM_AIF_OUT("QUAT_TDM_TX_7", NULL, |
1280 | 0, 0, 0, 0), | 1280 | 0, 0, 0, 0), |
1281 | 1281 | ||
1282 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_0", "Quinary TDM0 Playback", | 1282 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_0", NULL, |
1283 | 0, 0, 0, 0), | 1283 | 0, 0, 0, 0), |
1284 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_1", "Quinary TDM1 Playback", | 1284 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_1", NULL, |
1285 | 0, 0, 0, 0), | 1285 | 0, 0, 0, 0), |
1286 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_2", "Quinary TDM2 Playback", | 1286 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_2", NULL, |
1287 | 0, 0, 0, 0), | 1287 | 0, 0, 0, 0), |
1288 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_3", "Quinary TDM3 Playback", | 1288 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_3", NULL, |
1289 | 0, 0, 0, 0), | 1289 | 0, 0, 0, 0), |
1290 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_4", "Quinary TDM4 Playback", | 1290 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_4", NULL, |
1291 | 0, 0, 0, 0), | 1291 | 0, 0, 0, 0), |
1292 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_5", "Quinary TDM5 Playback", | 1292 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_5", NULL, |
1293 | 0, 0, 0, 0), | 1293 | 0, 0, 0, 0), |
1294 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_6", "Quinary TDM6 Playback", | 1294 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_6", NULL, |
1295 | 0, 0, 0, 0), | 1295 | 0, 0, 0, 0), |
1296 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_RX_7", "Quinary TDM7 Playback", | 1296 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_RX_7", NULL, |
1297 | 0, 0, 0, 0), | 1297 | 0, 0, 0, 0), |
1298 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_0", "Quinary TDM0 Capture", | 1298 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_0", NULL, |
1299 | 0, 0, 0, 0), | 1299 | 0, 0, 0, 0), |
1300 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_1", "Quinary TDM1 Capture", | 1300 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_1", NULL, |
1301 | 0, 0, 0, 0), | 1301 | 0, 0, 0, 0), |
1302 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_2", "Quinary TDM2 Capture", | 1302 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_2", NULL, |
1303 | 0, 0, 0, 0), | 1303 | 0, 0, 0, 0), |
1304 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_3", "Quinary TDM3 Capture", | 1304 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_3", NULL, |
1305 | 0, 0, 0, 0), | 1305 | 0, 0, 0, 0), |
1306 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_4", "Quinary TDM4 Capture", | 1306 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_4", NULL, |
1307 | 0, 0, 0, 0), | 1307 | 0, 0, 0, 0), |
1308 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_5", "Quinary TDM5 Capture", | 1308 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_5", NULL, |
1309 | 0, 0, 0, 0), | 1309 | 0, 0, 0, 0), |
1310 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_6", "Quinary TDM6 Capture", | 1310 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_6", NULL, |
1311 | 0, 0, 0, 0), | 1311 | 0, 0, 0, 0), |
1312 | SND_SOC_DAPM_AIF_IN("QUIN_TDM_TX_7", "Quinary TDM7 Capture", | 1312 | SND_SOC_DAPM_AIF_OUT("QUIN_TDM_TX_7", NULL, |
1313 | 0, 0, 0, 0), | 1313 | 0, 0, 0, 0), |
1314 | }; | 1314 | }; |
1315 | 1315 | ||
diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 000775b4bba8..829b5e987b2a 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c | |||
@@ -49,14 +49,14 @@ | |||
49 | #define AFE_PORT_I2S_SD1 0x2 | 49 | #define AFE_PORT_I2S_SD1 0x2 |
50 | #define AFE_PORT_I2S_SD2 0x3 | 50 | #define AFE_PORT_I2S_SD2 0x3 |
51 | #define AFE_PORT_I2S_SD3 0x4 | 51 | #define AFE_PORT_I2S_SD3 0x4 |
52 | #define AFE_PORT_I2S_SD0_MASK BIT(0x1) | 52 | #define AFE_PORT_I2S_SD0_MASK BIT(0x0) |
53 | #define AFE_PORT_I2S_SD1_MASK BIT(0x2) | 53 | #define AFE_PORT_I2S_SD1_MASK BIT(0x1) |
54 | #define AFE_PORT_I2S_SD2_MASK BIT(0x3) | 54 | #define AFE_PORT_I2S_SD2_MASK BIT(0x2) |
55 | #define AFE_PORT_I2S_SD3_MASK BIT(0x4) | 55 | #define AFE_PORT_I2S_SD3_MASK BIT(0x3) |
56 | #define AFE_PORT_I2S_SD0_1_MASK GENMASK(2, 1) | 56 | #define AFE_PORT_I2S_SD0_1_MASK GENMASK(1, 0) |
57 | #define AFE_PORT_I2S_SD2_3_MASK GENMASK(4, 3) | 57 | #define AFE_PORT_I2S_SD2_3_MASK GENMASK(3, 2) |
58 | #define AFE_PORT_I2S_SD0_1_2_MASK GENMASK(3, 1) | 58 | #define AFE_PORT_I2S_SD0_1_2_MASK GENMASK(2, 0) |
59 | #define AFE_PORT_I2S_SD0_1_2_3_MASK GENMASK(4, 1) | 59 | #define AFE_PORT_I2S_SD0_1_2_3_MASK GENMASK(3, 0) |
60 | #define AFE_PORT_I2S_QUAD01 0x5 | 60 | #define AFE_PORT_I2S_QUAD01 0x5 |
61 | #define AFE_PORT_I2S_QUAD23 0x6 | 61 | #define AFE_PORT_I2S_QUAD23 0x6 |
62 | #define AFE_PORT_I2S_6CHS 0x7 | 62 | #define AFE_PORT_I2S_6CHS 0x7 |
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index a16c71c03058..86115de5c1b2 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c | |||
@@ -122,7 +122,6 @@ static struct snd_pcm_hardware q6asm_dai_hardware_playback = { | |||
122 | .rate_max = 48000, \ | 122 | .rate_max = 48000, \ |
123 | }, \ | 123 | }, \ |
124 | .name = "MultiMedia"#num, \ | 124 | .name = "MultiMedia"#num, \ |
125 | .probe = fe_dai_probe, \ | ||
126 | .id = MSM_FRONTEND_DAI_MULTIMEDIA##num, \ | 125 | .id = MSM_FRONTEND_DAI_MULTIMEDIA##num, \ |
127 | } | 126 | } |
128 | 127 | ||
@@ -511,38 +510,6 @@ static void q6asm_dai_pcm_free(struct snd_pcm *pcm) | |||
511 | } | 510 | } |
512 | } | 511 | } |
513 | 512 | ||
514 | static const struct snd_soc_dapm_route afe_pcm_routes[] = { | ||
515 | {"MM_DL1", NULL, "MultiMedia1 Playback" }, | ||
516 | {"MM_DL2", NULL, "MultiMedia2 Playback" }, | ||
517 | {"MM_DL3", NULL, "MultiMedia3 Playback" }, | ||
518 | {"MM_DL4", NULL, "MultiMedia4 Playback" }, | ||
519 | {"MM_DL5", NULL, "MultiMedia5 Playback" }, | ||
520 | {"MM_DL6", NULL, "MultiMedia6 Playback" }, | ||
521 | {"MM_DL7", NULL, "MultiMedia7 Playback" }, | ||
522 | {"MM_DL7", NULL, "MultiMedia8 Playback" }, | ||
523 | {"MultiMedia1 Capture", NULL, "MM_UL1"}, | ||
524 | {"MultiMedia2 Capture", NULL, "MM_UL2"}, | ||
525 | {"MultiMedia3 Capture", NULL, "MM_UL3"}, | ||
526 | {"MultiMedia4 Capture", NULL, "MM_UL4"}, | ||
527 | {"MultiMedia5 Capture", NULL, "MM_UL5"}, | ||
528 | {"MultiMedia6 Capture", NULL, "MM_UL6"}, | ||
529 | {"MultiMedia7 Capture", NULL, "MM_UL7"}, | ||
530 | {"MultiMedia8 Capture", NULL, "MM_UL8"}, | ||
531 | |||
532 | }; | ||
533 | |||
534 | static int fe_dai_probe(struct snd_soc_dai *dai) | ||
535 | { | ||
536 | struct snd_soc_dapm_context *dapm; | ||
537 | |||
538 | dapm = snd_soc_component_get_dapm(dai->component); | ||
539 | snd_soc_dapm_add_routes(dapm, afe_pcm_routes, | ||
540 | ARRAY_SIZE(afe_pcm_routes)); | ||
541 | |||
542 | return 0; | ||
543 | } | ||
544 | |||
545 | |||
546 | static const struct snd_soc_component_driver q6asm_fe_dai_component = { | 513 | static const struct snd_soc_component_driver q6asm_fe_dai_component = { |
547 | .name = DRV_NAME, | 514 | .name = DRV_NAME, |
548 | .ops = &q6asm_dai_ops, | 515 | .ops = &q6asm_dai_ops, |
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index c6b51571be94..d61b8404f7da 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c | |||
@@ -909,6 +909,25 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
909 | {"MM_UL6", NULL, "MultiMedia6 Mixer"}, | 909 | {"MM_UL6", NULL, "MultiMedia6 Mixer"}, |
910 | {"MM_UL7", NULL, "MultiMedia7 Mixer"}, | 910 | {"MM_UL7", NULL, "MultiMedia7 Mixer"}, |
911 | {"MM_UL8", NULL, "MultiMedia8 Mixer"}, | 911 | {"MM_UL8", NULL, "MultiMedia8 Mixer"}, |
912 | |||
913 | {"MM_DL1", NULL, "MultiMedia1 Playback" }, | ||
914 | {"MM_DL2", NULL, "MultiMedia2 Playback" }, | ||
915 | {"MM_DL3", NULL, "MultiMedia3 Playback" }, | ||
916 | {"MM_DL4", NULL, "MultiMedia4 Playback" }, | ||
917 | {"MM_DL5", NULL, "MultiMedia5 Playback" }, | ||
918 | {"MM_DL6", NULL, "MultiMedia6 Playback" }, | ||
919 | {"MM_DL7", NULL, "MultiMedia7 Playback" }, | ||
920 | {"MM_DL8", NULL, "MultiMedia8 Playback" }, | ||
921 | |||
922 | {"MultiMedia1 Capture", NULL, "MM_UL1"}, | ||
923 | {"MultiMedia2 Capture", NULL, "MM_UL2"}, | ||
924 | {"MultiMedia3 Capture", NULL, "MM_UL3"}, | ||
925 | {"MultiMedia4 Capture", NULL, "MM_UL4"}, | ||
926 | {"MultiMedia5 Capture", NULL, "MM_UL5"}, | ||
927 | {"MultiMedia6 Capture", NULL, "MM_UL6"}, | ||
928 | {"MultiMedia7 Capture", NULL, "MM_UL7"}, | ||
929 | {"MultiMedia8 Capture", NULL, "MM_UL8"}, | ||
930 | |||
912 | }; | 931 | }; |
913 | 932 | ||
914 | static int routing_hw_params(struct snd_pcm_substream *substream, | 933 | static int routing_hw_params(struct snd_pcm_substream *substream, |
diff --git a/sound/soc/rockchip/rockchip_pcm.c b/sound/soc/rockchip/rockchip_pcm.c index 9e7b5fa4cf59..4ac78d7a4b2d 100644 --- a/sound/soc/rockchip/rockchip_pcm.c +++ b/sound/soc/rockchip/rockchip_pcm.c | |||
@@ -33,6 +33,7 @@ static const struct snd_pcm_hardware snd_rockchip_hardware = { | |||
33 | 33 | ||
34 | static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = { | 34 | static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = { |
35 | .pcm_hardware = &snd_rockchip_hardware, | 35 | .pcm_hardware = &snd_rockchip_hardware, |
36 | .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, | ||
36 | .prealloc_buffer_size = 32 * 1024, | 37 | .prealloc_buffer_size = 32 * 1024, |
37 | }; | 38 | }; |
38 | 39 | ||
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index ad6298330fdb..59e250cc2e9d 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -1525,6 +1525,18 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, | |||
1525 | }; | 1525 | }; |
1526 | int ret; | 1526 | int ret; |
1527 | 1527 | ||
1528 | /* | ||
1529 | * 1) Avoid duplicate register (ex. MIXer case) | ||
1530 | * 2) re-register if card was rebinded | ||
1531 | */ | ||
1532 | list_for_each_entry(kctrl, &card->controls, list) { | ||
1533 | struct rsnd_kctrl_cfg *c = kctrl->private_data; | ||
1534 | |||
1535 | if (strcmp(kctrl->id.name, name) == 0 && | ||
1536 | c->mod == mod) | ||
1537 | return 0; | ||
1538 | } | ||
1539 | |||
1528 | if (size > RSND_MAX_CHANNELS) | 1540 | if (size > RSND_MAX_CHANNELS) |
1529 | return -EINVAL; | 1541 | return -EINVAL; |
1530 | 1542 | ||
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 17eff3e60bbe..8d91c0eb0880 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c | |||
@@ -40,11 +40,8 @@ struct rsnd_dvc { | |||
40 | struct rsnd_kctrl_cfg_s ren; /* Ramp Enable */ | 40 | struct rsnd_kctrl_cfg_s ren; /* Ramp Enable */ |
41 | struct rsnd_kctrl_cfg_s rup; /* Ramp Rate Up */ | 41 | struct rsnd_kctrl_cfg_s rup; /* Ramp Rate Up */ |
42 | struct rsnd_kctrl_cfg_s rdown; /* Ramp Rate Down */ | 42 | struct rsnd_kctrl_cfg_s rdown; /* Ramp Rate Down */ |
43 | u32 flags; | ||
44 | }; | 43 | }; |
45 | 44 | ||
46 | #define KCTRL_INITIALIZED (1 << 0) | ||
47 | |||
48 | #define rsnd_dvc_get(priv, id) ((struct rsnd_dvc *)(priv->dvc) + id) | 45 | #define rsnd_dvc_get(priv, id) ((struct rsnd_dvc *)(priv->dvc) + id) |
49 | #define rsnd_dvc_nr(priv) ((priv)->dvc_nr) | 46 | #define rsnd_dvc_nr(priv) ((priv)->dvc_nr) |
50 | 47 | ||
@@ -221,9 +218,6 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
221 | int channels = rsnd_rdai_channels_get(rdai); | 218 | int channels = rsnd_rdai_channels_get(rdai); |
222 | int ret; | 219 | int ret; |
223 | 220 | ||
224 | if (rsnd_flags_has(dvc, KCTRL_INITIALIZED)) | ||
225 | return 0; | ||
226 | |||
227 | /* Volume */ | 221 | /* Volume */ |
228 | ret = rsnd_kctrl_new_m(mod, io, rtd, | 222 | ret = rsnd_kctrl_new_m(mod, io, rtd, |
229 | is_play ? | 223 | is_play ? |
@@ -279,8 +273,6 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, | |||
279 | if (ret < 0) | 273 | if (ret < 0) |
280 | return ret; | 274 | return ret; |
281 | 275 | ||
282 | rsnd_flags_set(dvc, KCTRL_INITIALIZED); | ||
283 | |||
284 | return 0; | 276 | return 0; |
285 | } | 277 | } |
286 | 278 | ||
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 1fdcc7c3fc7e..45ef295743ec 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c | |||
@@ -286,7 +286,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, | |||
286 | if (rsnd_ssi_is_multi_slave(mod, io)) | 286 | if (rsnd_ssi_is_multi_slave(mod, io)) |
287 | return 0; | 287 | return 0; |
288 | 288 | ||
289 | if (ssi->rate) { | 289 | if (ssi->usrcnt > 1) { |
290 | if (ssi->rate != rate) { | 290 | if (ssi->rate != rate) { |
291 | dev_err(dev, "SSI parent/child should use same rate\n"); | 291 | dev_err(dev, "SSI parent/child should use same rate\n"); |
292 | return -EINVAL; | 292 | return -EINVAL; |
diff --git a/sound/soc/soc-acpi.c b/sound/soc/soc-acpi.c index b8e72b52db30..4fb29f0e561e 100644 --- a/sound/soc/soc-acpi.c +++ b/sound/soc/soc-acpi.c | |||
@@ -10,11 +10,17 @@ struct snd_soc_acpi_mach * | |||
10 | snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) | 10 | snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) |
11 | { | 11 | { |
12 | struct snd_soc_acpi_mach *mach; | 12 | struct snd_soc_acpi_mach *mach; |
13 | struct snd_soc_acpi_mach *mach_alt; | ||
13 | 14 | ||
14 | for (mach = machines; mach->id[0]; mach++) { | 15 | for (mach = machines; mach->id[0]; mach++) { |
15 | if (acpi_dev_present(mach->id, NULL, -1)) { | 16 | if (acpi_dev_present(mach->id, NULL, -1)) { |
16 | if (mach->machine_quirk) | 17 | if (mach->machine_quirk) { |
17 | mach = mach->machine_quirk(mach); | 18 | mach_alt = mach->machine_quirk(mach); |
19 | if (!mach_alt) | ||
20 | continue; /* not full match, ignore */ | ||
21 | mach = mach_alt; | ||
22 | } | ||
23 | |||
18 | return mach; | 24 | return mach; |
19 | } | 25 | } |
20 | } | 26 | } |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 012000de4bf0..b0db59e6339d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -2131,6 +2131,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) | |||
2131 | } | 2131 | } |
2132 | 2132 | ||
2133 | card->instantiated = 1; | 2133 | card->instantiated = 1; |
2134 | dapm_mark_endpoints_dirty(card); | ||
2134 | snd_soc_dapm_sync(&card->dapm); | 2135 | snd_soc_dapm_sync(&card->dapm); |
2135 | mutex_unlock(&card->mutex); | 2136 | mutex_unlock(&card->mutex); |
2136 | mutex_unlock(&client_mutex); | 2137 | mutex_unlock(&client_mutex); |
diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig index 66aad0d3f9c7..8134c3c94229 100644 --- a/sound/soc/sunxi/Kconfig +++ b/sound/soc/sunxi/Kconfig | |||
@@ -31,7 +31,7 @@ config SND_SUN8I_CODEC_ANALOG | |||
31 | config SND_SUN50I_CODEC_ANALOG | 31 | config SND_SUN50I_CODEC_ANALOG |
32 | tristate "Allwinner sun50i Codec Analog Controls Support" | 32 | tristate "Allwinner sun50i Codec Analog Controls Support" |
33 | depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST | 33 | depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST |
34 | select SND_SUNXI_ADDA_PR_REGMAP | 34 | select SND_SUN8I_ADDA_PR_REGMAP |
35 | help | 35 | help |
36 | Say Y or M if you want to add support for the analog controls for | 36 | Say Y or M if you want to add support for the analog controls for |
37 | the codec embedded in Allwinner A64 SoC. | 37 | the codec embedded in Allwinner A64 SoC. |
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index 522a72fde78d..92c5de026c43 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c | |||
@@ -481,7 +481,11 @@ static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = { | |||
481 | { "Right Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch", | 481 | { "Right Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch", |
482 | "AIF1 Slot 0 Right"}, | 482 | "AIF1 Slot 0 Right"}, |
483 | 483 | ||
484 | /* ADC routes */ | 484 | /* ADC Routes */ |
485 | { "AIF1 Slot 0 Right ADC", NULL, "ADC" }, | ||
486 | { "AIF1 Slot 0 Left ADC", NULL, "ADC" }, | ||
487 | |||
488 | /* ADC Mixer Routes */ | ||
485 | { "Left Digital ADC Mixer", "AIF1 Data Digital ADC Capture Switch", | 489 | { "Left Digital ADC Mixer", "AIF1 Data Digital ADC Capture Switch", |
486 | "AIF1 Slot 0 Left ADC" }, | 490 | "AIF1 Slot 0 Left ADC" }, |
487 | { "Right Digital ADC Mixer", "AIF1 Data Digital ADC Capture Switch", | 491 | { "Right Digital ADC Mixer", "AIF1 Data Digital ADC Capture Switch", |
@@ -605,16 +609,10 @@ err_pm_disable: | |||
605 | 609 | ||
606 | static int sun8i_codec_remove(struct platform_device *pdev) | 610 | static int sun8i_codec_remove(struct platform_device *pdev) |
607 | { | 611 | { |
608 | struct snd_soc_card *card = platform_get_drvdata(pdev); | ||
609 | struct sun8i_codec *scodec = snd_soc_card_get_drvdata(card); | ||
610 | |||
611 | pm_runtime_disable(&pdev->dev); | 612 | pm_runtime_disable(&pdev->dev); |
612 | if (!pm_runtime_status_suspended(&pdev->dev)) | 613 | if (!pm_runtime_status_suspended(&pdev->dev)) |
613 | sun8i_codec_runtime_suspend(&pdev->dev); | 614 | sun8i_codec_runtime_suspend(&pdev->dev); |
614 | 615 | ||
615 | clk_disable_unprepare(scodec->clk_module); | ||
616 | clk_disable_unprepare(scodec->clk_bus); | ||
617 | |||
618 | return 0; | 616 | return 0; |
619 | } | 617 | } |
620 | 618 | ||