aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-02-09 02:09:48 -0500
committerMark Brown <broonie@kernel.org>2015-02-09 02:09:48 -0500
commitb34510b70d2a703fcc7fc018380af73e5f448f7f (patch)
tree21aa60960fcfde9aaa7a89fec0afd72303944a80 /sound/soc
parente36f014edff70fc02b3d3d79cead1d58f289332e (diff)
parent1b9f1ae8907cb13d3d2538d98385b2744c9490d5 (diff)
Merge tag 'asoc-v3.19-rc2' into asoc-linus
ASoC: Updates for v3.20 Nothing too exciting here yet, a small optimization for DAPM from Lars-Peter and a few small bits and pieces for drivers but nothing that really stands out. # gpg: Signature made Tue 30 Dec 2014 00:15:48 HKT using RSA key ID 5D5487D0 # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: key AF88CD16: no public key for trusted key - skipped # gpg: key AF88CD16 marked as ultimately trusted # gpg: key 5621E907: no public key for trusted key - skipped # gpg: key 5621E907 marked as ultimately trusted # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/pcm512x-i2c.c4
-rw-r--r--sound/soc/codecs/pcm512x-spi.c4
-rw-r--r--sound/soc/codecs/rt5670.c38
-rw-r--r--sound/soc/codecs/rt5677.c195
-rw-r--r--sound/soc/codecs/wm8750.c2
-rw-r--r--sound/soc/dwc/designware_i2s.c86
-rw-r--r--sound/soc/intel/Kconfig4
-rw-r--r--sound/soc/intel/bytcr_dpcm_rt5640.c1
-rw-r--r--sound/soc/intel/cht_bsw_rt5672.c1
-rw-r--r--sound/soc/intel/sst-firmware.c1
-rw-r--r--sound/soc/intel/sst/sst_acpi.c5
-rw-r--r--sound/soc/omap/omap-hdmi-audio.c1
-rw-r--r--sound/soc/pxa/spitz.c1
-rw-r--r--sound/soc/rockchip/rockchip_i2s.c4
-rw-r--r--sound/soc/samsung/arndale_rt5631.c1
-rw-r--r--sound/soc/soc-core.c3
-rw-r--r--sound/soc/soc-dapm.c105
-rw-r--r--sound/soc/soc-pcm.c7
18 files changed, 295 insertions, 168 deletions
diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c
index d0547fa275fc..dcdfac0ffeb1 100644
--- a/sound/soc/codecs/pcm512x-i2c.c
+++ b/sound/soc/codecs/pcm512x-i2c.c
@@ -46,6 +46,8 @@ static int pcm512x_i2c_remove(struct i2c_client *i2c)
46static const struct i2c_device_id pcm512x_i2c_id[] = { 46static const struct i2c_device_id pcm512x_i2c_id[] = {
47 { "pcm5121", }, 47 { "pcm5121", },
48 { "pcm5122", }, 48 { "pcm5122", },
49 { "pcm5141", },
50 { "pcm5142", },
49 { } 51 { }
50}; 52};
51MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id); 53MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id);
@@ -53,6 +55,8 @@ MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id);
53static const struct of_device_id pcm512x_of_match[] = { 55static const struct of_device_id pcm512x_of_match[] = {
54 { .compatible = "ti,pcm5121", }, 56 { .compatible = "ti,pcm5121", },
55 { .compatible = "ti,pcm5122", }, 57 { .compatible = "ti,pcm5122", },
58 { .compatible = "ti,pcm5141", },
59 { .compatible = "ti,pcm5142", },
56 { } 60 { }
57}; 61};
58MODULE_DEVICE_TABLE(of, pcm512x_of_match); 62MODULE_DEVICE_TABLE(of, pcm512x_of_match);
diff --git a/sound/soc/codecs/pcm512x-spi.c b/sound/soc/codecs/pcm512x-spi.c
index f297058c0038..7b64a9cef704 100644
--- a/sound/soc/codecs/pcm512x-spi.c
+++ b/sound/soc/codecs/pcm512x-spi.c
@@ -43,6 +43,8 @@ static int pcm512x_spi_remove(struct spi_device *spi)
43static const struct spi_device_id pcm512x_spi_id[] = { 43static const struct spi_device_id pcm512x_spi_id[] = {
44 { "pcm5121", }, 44 { "pcm5121", },
45 { "pcm5122", }, 45 { "pcm5122", },
46 { "pcm5141", },
47 { "pcm5142", },
46 { }, 48 { },
47}; 49};
48MODULE_DEVICE_TABLE(spi, pcm512x_spi_id); 50MODULE_DEVICE_TABLE(spi, pcm512x_spi_id);
@@ -50,6 +52,8 @@ MODULE_DEVICE_TABLE(spi, pcm512x_spi_id);
50static const struct of_device_id pcm512x_of_match[] = { 52static const struct of_device_id pcm512x_of_match[] = {
51 { .compatible = "ti,pcm5121", }, 53 { .compatible = "ti,pcm5121", },
52 { .compatible = "ti,pcm5122", }, 54 { .compatible = "ti,pcm5122", },
55 { .compatible = "ti,pcm5141", },
56 { .compatible = "ti,pcm5142", },
53 { } 57 { }
54}; 58};
55MODULE_DEVICE_TABLE(of, pcm512x_of_match); 59MODULE_DEVICE_TABLE(of, pcm512x_of_match);
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
index 8a0833de1665..0a027bc94399 100644
--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
@@ -14,10 +14,12 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/pm.h> 16#include <linux/pm.h>
17#include <linux/pm_runtime.h>
17#include <linux/i2c.h> 18#include <linux/i2c.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/acpi.h> 20#include <linux/acpi.h>
20#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22#include <linux/dmi.h>
21#include <sound/core.h> 23#include <sound/core.h>
22#include <sound/pcm.h> 24#include <sound/pcm.h>
23#include <sound/pcm_params.h> 25#include <sound/pcm_params.h>
@@ -2188,6 +2190,13 @@ static int rt5670_set_dai_sysclk(struct snd_soc_dai *dai,
2188 if (freq == rt5670->sysclk && clk_id == rt5670->sysclk_src) 2190 if (freq == rt5670->sysclk && clk_id == rt5670->sysclk_src)
2189 return 0; 2191 return 0;
2190 2192
2193 if (rt5670->pdata.jd_mode) {
2194 if (clk_id == RT5670_SCLK_S_PLL1)
2195 snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1");
2196 else
2197 snd_soc_dapm_disable_pin(&codec->dapm, "PLL1");
2198 snd_soc_dapm_sync(&codec->dapm);
2199 }
2191 switch (clk_id) { 2200 switch (clk_id) {
2192 case RT5670_SCLK_S_MCLK: 2201 case RT5670_SCLK_S_MCLK:
2193 reg_val |= RT5670_SCLK_SRC_MCLK; 2202 reg_val |= RT5670_SCLK_SRC_MCLK;
@@ -2549,6 +2558,17 @@ static struct acpi_device_id rt5670_acpi_match[] = {
2549MODULE_DEVICE_TABLE(acpi, rt5670_acpi_match); 2558MODULE_DEVICE_TABLE(acpi, rt5670_acpi_match);
2550#endif 2559#endif
2551 2560
2561static const struct dmi_system_id dmi_platform_intel_braswell[] = {
2562 {
2563 .ident = "Intel Braswell",
2564 .matches = {
2565 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
2566 DMI_MATCH(DMI_BOARD_NAME, "Braswell CRB"),
2567 },
2568 },
2569 {}
2570};
2571
2552static int rt5670_i2c_probe(struct i2c_client *i2c, 2572static int rt5670_i2c_probe(struct i2c_client *i2c,
2553 const struct i2c_device_id *id) 2573 const struct i2c_device_id *id)
2554{ 2574{
@@ -2568,6 +2588,12 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
2568 if (pdata) 2588 if (pdata)
2569 rt5670->pdata = *pdata; 2589 rt5670->pdata = *pdata;
2570 2590
2591 if (dmi_check_system(dmi_platform_intel_braswell)) {
2592 rt5670->pdata.dmic_en = true;
2593 rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_IN2P;
2594 rt5670->pdata.jd_mode = 1;
2595 }
2596
2571 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap); 2597 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);
2572 if (IS_ERR(rt5670->regmap)) { 2598 if (IS_ERR(rt5670->regmap)) {
2573 ret = PTR_ERR(rt5670->regmap); 2599 ret = PTR_ERR(rt5670->regmap);
@@ -2609,6 +2635,10 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
2609 } 2635 }
2610 2636
2611 if (rt5670->pdata.jd_mode) { 2637 if (rt5670->pdata.jd_mode) {
2638 regmap_update_bits(rt5670->regmap, RT5670_GLB_CLK,
2639 RT5670_SCLK_SRC_MASK, RT5670_SCLK_SRC_RCCLK);
2640 rt5670->sysclk = 0;
2641 rt5670->sysclk_src = RT5670_SCLK_S_RCCLK;
2612 regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG1, 2642 regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG1,
2613 RT5670_PWR_MB, RT5670_PWR_MB); 2643 RT5670_PWR_MB, RT5670_PWR_MB);
2614 regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG2, 2644 regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG2,
@@ -2716,18 +2746,26 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
2716 2746
2717 } 2747 }
2718 2748
2749 pm_runtime_enable(&i2c->dev);
2750 pm_request_idle(&i2c->dev);
2751
2719 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5670, 2752 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5670,
2720 rt5670_dai, ARRAY_SIZE(rt5670_dai)); 2753 rt5670_dai, ARRAY_SIZE(rt5670_dai));
2721 if (ret < 0) 2754 if (ret < 0)
2722 goto err; 2755 goto err;
2723 2756
2757 pm_runtime_put(&i2c->dev);
2758
2724 return 0; 2759 return 0;
2725err: 2760err:
2761 pm_runtime_disable(&i2c->dev);
2762
2726 return ret; 2763 return ret;
2727} 2764}
2728 2765
2729static int rt5670_i2c_remove(struct i2c_client *i2c) 2766static int rt5670_i2c_remove(struct i2c_client *i2c)
2730{ 2767{
2768 pm_runtime_disable(&i2c->dev);
2731 snd_soc_unregister_codec(&i2c->dev); 2769 snd_soc_unregister_codec(&i2c->dev);
2732 2770
2733 return 0; 2771 return 0;
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 918ada9738b0..d27630accf03 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -922,6 +922,97 @@ static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
922 return 0; 922 return 0;
923} 923}
924 924
925static int is_using_asrc(struct snd_soc_dapm_widget *source,
926 struct snd_soc_dapm_widget *sink)
927{
928 unsigned int reg, shift, val;
929
930 if (source->reg == RT5677_ASRC_1) {
931 switch (source->shift) {
932 case 12:
933 reg = RT5677_ASRC_4;
934 shift = 0;
935 break;
936 case 13:
937 reg = RT5677_ASRC_4;
938 shift = 4;
939 break;
940 case 14:
941 reg = RT5677_ASRC_4;
942 shift = 8;
943 break;
944 case 15:
945 reg = RT5677_ASRC_4;
946 shift = 12;
947 break;
948 default:
949 return 0;
950 }
951 } else {
952 switch (source->shift) {
953 case 0:
954 reg = RT5677_ASRC_6;
955 shift = 8;
956 break;
957 case 1:
958 reg = RT5677_ASRC_6;
959 shift = 12;
960 break;
961 case 2:
962 reg = RT5677_ASRC_5;
963 shift = 0;
964 break;
965 case 3:
966 reg = RT5677_ASRC_5;
967 shift = 4;
968 break;
969 case 4:
970 reg = RT5677_ASRC_5;
971 shift = 8;
972 break;
973 case 5:
974 reg = RT5677_ASRC_5;
975 shift = 12;
976 break;
977 case 12:
978 reg = RT5677_ASRC_3;
979 shift = 0;
980 break;
981 case 13:
982 reg = RT5677_ASRC_3;
983 shift = 4;
984 break;
985 case 14:
986 reg = RT5677_ASRC_3;
987 shift = 12;
988 break;
989 default:
990 return 0;
991 }
992 }
993
994 val = (snd_soc_read(source->codec, reg) >> shift) & 0xf;
995 switch (val) {
996 case 1 ... 6:
997 return 1;
998 default:
999 return 0;
1000 }
1001
1002}
1003
1004static int can_use_asrc(struct snd_soc_dapm_widget *source,
1005 struct snd_soc_dapm_widget *sink)
1006{
1007 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm);
1008 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
1009
1010 if (rt5677->sysclk > rt5677->lrck[RT5677_AIF1] * 384)
1011 return 1;
1012
1013 return 0;
1014}
1015
925/* Digital Mixer */ 1016/* Digital Mixer */
926static const struct snd_kcontrol_new rt5677_sto1_adc_l_mix[] = { 1017static const struct snd_kcontrol_new rt5677_sto1_adc_l_mix[] = {
927 SOC_DAPM_SINGLE("ADC1 Switch", RT5677_STO1_ADC_MIXER, 1018 SOC_DAPM_SINGLE("ADC1 Switch", RT5677_STO1_ADC_MIXER,
@@ -2226,6 +2317,45 @@ static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
2226 0, rt5677_set_pll2_event, SND_SOC_DAPM_PRE_PMU | 2317 0, rt5677_set_pll2_event, SND_SOC_DAPM_PRE_PMU |
2227 SND_SOC_DAPM_POST_PMU), 2318 SND_SOC_DAPM_POST_PMU),
2228 2319
2320 /* ASRC */
2321 SND_SOC_DAPM_SUPPLY_S("I2S1 ASRC", 1, RT5677_ASRC_1, 0, 0, NULL, 0),
2322 SND_SOC_DAPM_SUPPLY_S("I2S2 ASRC", 1, RT5677_ASRC_1, 1, 0, NULL, 0),
2323 SND_SOC_DAPM_SUPPLY_S("I2S3 ASRC", 1, RT5677_ASRC_1, 2, 0, NULL, 0),
2324 SND_SOC_DAPM_SUPPLY_S("I2S4 ASRC", 1, RT5677_ASRC_1, 3, 0, NULL, 0),
2325 SND_SOC_DAPM_SUPPLY_S("DAC STO ASRC", 1, RT5677_ASRC_2, 14, 0, NULL, 0),
2326 SND_SOC_DAPM_SUPPLY_S("DAC MONO2 L ASRC", 1, RT5677_ASRC_2, 13, 0, NULL,
2327 0),
2328 SND_SOC_DAPM_SUPPLY_S("DAC MONO2 R ASRC", 1, RT5677_ASRC_2, 12, 0, NULL,
2329 0),
2330 SND_SOC_DAPM_SUPPLY_S("DAC MONO3 L ASRC", 1, RT5677_ASRC_1, 15, 0, NULL,
2331 0),
2332 SND_SOC_DAPM_SUPPLY_S("DAC MONO3 R ASRC", 1, RT5677_ASRC_1, 14, 0, NULL,
2333 0),
2334 SND_SOC_DAPM_SUPPLY_S("DAC MONO4 L ASRC", 1, RT5677_ASRC_1, 13, 0, NULL,
2335 0),
2336 SND_SOC_DAPM_SUPPLY_S("DAC MONO4 R ASRC", 1, RT5677_ASRC_1, 12, 0, NULL,
2337 0),
2338 SND_SOC_DAPM_SUPPLY_S("DMIC STO1 ASRC", 1, RT5677_ASRC_2, 11, 0, NULL,
2339 0),
2340 SND_SOC_DAPM_SUPPLY_S("DMIC STO2 ASRC", 1, RT5677_ASRC_2, 10, 0, NULL,
2341 0),
2342 SND_SOC_DAPM_SUPPLY_S("DMIC STO3 ASRC", 1, RT5677_ASRC_2, 9, 0, NULL,
2343 0),
2344 SND_SOC_DAPM_SUPPLY_S("DMIC STO4 ASRC", 1, RT5677_ASRC_2, 8, 0, NULL,
2345 0),
2346 SND_SOC_DAPM_SUPPLY_S("DMIC MONO L ASRC", 1, RT5677_ASRC_2, 7, 0, NULL,
2347 0),
2348 SND_SOC_DAPM_SUPPLY_S("DMIC MONO R ASRC", 1, RT5677_ASRC_2, 6, 0, NULL,
2349 0),
2350 SND_SOC_DAPM_SUPPLY_S("ADC STO1 ASRC", 1, RT5677_ASRC_2, 5, 0, NULL, 0),
2351 SND_SOC_DAPM_SUPPLY_S("ADC STO2 ASRC", 1, RT5677_ASRC_2, 4, 0, NULL, 0),
2352 SND_SOC_DAPM_SUPPLY_S("ADC STO3 ASRC", 1, RT5677_ASRC_2, 3, 0, NULL, 0),
2353 SND_SOC_DAPM_SUPPLY_S("ADC STO4 ASRC", 1, RT5677_ASRC_2, 2, 0, NULL, 0),
2354 SND_SOC_DAPM_SUPPLY_S("ADC MONO L ASRC", 1, RT5677_ASRC_2, 1, 0, NULL,
2355 0),
2356 SND_SOC_DAPM_SUPPLY_S("ADC MONO R ASRC", 1, RT5677_ASRC_2, 0, 0, NULL,
2357 0),
2358
2229 /* Input Side */ 2359 /* Input Side */
2230 /* micbias */ 2360 /* micbias */
2231 SND_SOC_DAPM_SUPPLY("MICBIAS1", RT5677_PWR_ANLG2, RT5677_PWR_MB1_BIT, 2361 SND_SOC_DAPM_SUPPLY("MICBIAS1", RT5677_PWR_ANLG2, RT5677_PWR_MB1_BIT,
@@ -2656,10 +2786,18 @@ static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
2656 /* DAC Mixer */ 2786 /* DAC Mixer */
2657 SND_SOC_DAPM_SUPPLY("dac stereo1 filter", RT5677_PWR_DIG2, 2787 SND_SOC_DAPM_SUPPLY("dac stereo1 filter", RT5677_PWR_DIG2,
2658 RT5677_PWR_DAC_S1F_BIT, 0, NULL, 0), 2788 RT5677_PWR_DAC_S1F_BIT, 0, NULL, 0),
2659 SND_SOC_DAPM_SUPPLY("dac mono left filter", RT5677_PWR_DIG2, 2789 SND_SOC_DAPM_SUPPLY("dac mono2 left filter", RT5677_PWR_DIG2,
2660 RT5677_PWR_DAC_M2F_L_BIT, 0, NULL, 0), 2790 RT5677_PWR_DAC_M2F_L_BIT, 0, NULL, 0),
2661 SND_SOC_DAPM_SUPPLY("dac mono right filter", RT5677_PWR_DIG2, 2791 SND_SOC_DAPM_SUPPLY("dac mono2 right filter", RT5677_PWR_DIG2,
2662 RT5677_PWR_DAC_M2F_R_BIT, 0, NULL, 0), 2792 RT5677_PWR_DAC_M2F_R_BIT, 0, NULL, 0),
2793 SND_SOC_DAPM_SUPPLY("dac mono3 left filter", RT5677_PWR_DIG2,
2794 RT5677_PWR_DAC_M3F_L_BIT, 0, NULL, 0),
2795 SND_SOC_DAPM_SUPPLY("dac mono3 right filter", RT5677_PWR_DIG2,
2796 RT5677_PWR_DAC_M3F_R_BIT, 0, NULL, 0),
2797 SND_SOC_DAPM_SUPPLY("dac mono4 left filter", RT5677_PWR_DIG2,
2798 RT5677_PWR_DAC_M4F_L_BIT, 0, NULL, 0),
2799 SND_SOC_DAPM_SUPPLY("dac mono4 right filter", RT5677_PWR_DIG2,
2800 RT5677_PWR_DAC_M4F_R_BIT, 0, NULL, 0),
2663 2801
2664 SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0, 2802 SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0,
2665 rt5677_sto1_dac_l_mix, ARRAY_SIZE(rt5677_sto1_dac_l_mix)), 2803 rt5677_sto1_dac_l_mix, ARRAY_SIZE(rt5677_sto1_dac_l_mix)),
@@ -2732,6 +2870,31 @@ static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
2732}; 2870};
2733 2871
2734static const struct snd_soc_dapm_route rt5677_dapm_routes[] = { 2872static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
2873 { "Stereo1 DMIC Mux", NULL, "DMIC STO1 ASRC", can_use_asrc },
2874 { "Stereo2 DMIC Mux", NULL, "DMIC STO2 ASRC", can_use_asrc },
2875 { "Stereo3 DMIC Mux", NULL, "DMIC STO3 ASRC", can_use_asrc },
2876 { "Stereo4 DMIC Mux", NULL, "DMIC STO4 ASRC", can_use_asrc },
2877 { "Mono DMIC L Mux", NULL, "DMIC MONO L ASRC", can_use_asrc },
2878 { "Mono DMIC R Mux", NULL, "DMIC MONO R ASRC", can_use_asrc },
2879 { "I2S1", NULL, "I2S1 ASRC", can_use_asrc},
2880 { "I2S2", NULL, "I2S2 ASRC", can_use_asrc},
2881 { "I2S3", NULL, "I2S3 ASRC", can_use_asrc},
2882 { "I2S4", NULL, "I2S4 ASRC", can_use_asrc},
2883
2884 { "dac stereo1 filter", NULL, "DAC STO ASRC", is_using_asrc },
2885 { "dac mono2 left filter", NULL, "DAC MONO2 L ASRC", is_using_asrc },
2886 { "dac mono2 right filter", NULL, "DAC MONO2 R ASRC", is_using_asrc },
2887 { "dac mono3 left filter", NULL, "DAC MONO3 L ASRC", is_using_asrc },
2888 { "dac mono3 right filter", NULL, "DAC MONO3 R ASRC", is_using_asrc },
2889 { "dac mono4 left filter", NULL, "DAC MONO4 L ASRC", is_using_asrc },
2890 { "dac mono4 right filter", NULL, "DAC MONO4 R ASRC", is_using_asrc },
2891 { "adc stereo1 filter", NULL, "ADC STO1 ASRC", is_using_asrc },
2892 { "adc stereo2 filter", NULL, "ADC STO2 ASRC", is_using_asrc },
2893 { "adc stereo3 filter", NULL, "ADC STO3 ASRC", is_using_asrc },
2894 { "adc stereo4 filter", NULL, "ADC STO4 ASRC", is_using_asrc },
2895 { "adc mono left filter", NULL, "ADC MONO L ASRC", is_using_asrc },
2896 { "adc mono right filter", NULL, "ADC MONO R ASRC", is_using_asrc },
2897
2735 { "DMIC1", NULL, "DMIC L1" }, 2898 { "DMIC1", NULL, "DMIC L1" },
2736 { "DMIC1", NULL, "DMIC R1" }, 2899 { "DMIC1", NULL, "DMIC R1" },
2737 { "DMIC2", NULL, "DMIC L2" }, 2900 { "DMIC2", NULL, "DMIC L2" },
@@ -2862,8 +3025,6 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
2862 3025
2863 { "Stereo1 ADC MIXL", NULL, "Sto1 ADC MIXL" }, 3026 { "Stereo1 ADC MIXL", NULL, "Sto1 ADC MIXL" },
2864 { "Stereo1 ADC MIXL", NULL, "adc stereo1 filter" }, 3027 { "Stereo1 ADC MIXL", NULL, "adc stereo1 filter" },
2865 { "adc stereo1 filter", NULL, "PLL1", is_sys_clk_from_pll },
2866
2867 { "Stereo1 ADC MIXR", NULL, "Sto1 ADC MIXR" }, 3028 { "Stereo1 ADC MIXR", NULL, "Sto1 ADC MIXR" },
2868 { "Stereo1 ADC MIXR", NULL, "adc stereo1 filter" }, 3029 { "Stereo1 ADC MIXR", NULL, "adc stereo1 filter" },
2869 { "adc stereo1 filter", NULL, "PLL1", is_sys_clk_from_pll }, 3030 { "adc stereo1 filter", NULL, "PLL1", is_sys_clk_from_pll },
@@ -2884,8 +3045,6 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
2884 3045
2885 { "Stereo2 ADC MIXL", NULL, "Stereo2 ADC LR Mux" }, 3046 { "Stereo2 ADC MIXL", NULL, "Stereo2 ADC LR Mux" },
2886 { "Stereo2 ADC MIXL", NULL, "adc stereo2 filter" }, 3047 { "Stereo2 ADC MIXL", NULL, "adc stereo2 filter" },
2887 { "adc stereo2 filter", NULL, "PLL1", is_sys_clk_from_pll },
2888
2889 { "Stereo2 ADC MIXR", NULL, "Sto2 ADC MIXR" }, 3048 { "Stereo2 ADC MIXR", NULL, "Sto2 ADC MIXR" },
2890 { "Stereo2 ADC MIXR", NULL, "adc stereo2 filter" }, 3049 { "Stereo2 ADC MIXR", NULL, "adc stereo2 filter" },
2891 { "adc stereo2 filter", NULL, "PLL1", is_sys_clk_from_pll }, 3050 { "adc stereo2 filter", NULL, "PLL1", is_sys_clk_from_pll },
@@ -2900,8 +3059,6 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
2900 3059
2901 { "Stereo3 ADC MIXL", NULL, "Sto3 ADC MIXL" }, 3060 { "Stereo3 ADC MIXL", NULL, "Sto3 ADC MIXL" },
2902 { "Stereo3 ADC MIXL", NULL, "adc stereo3 filter" }, 3061 { "Stereo3 ADC MIXL", NULL, "adc stereo3 filter" },
2903 { "adc stereo3 filter", NULL, "PLL1", is_sys_clk_from_pll },
2904
2905 { "Stereo3 ADC MIXR", NULL, "Sto3 ADC MIXR" }, 3062 { "Stereo3 ADC MIXR", NULL, "Sto3 ADC MIXR" },
2906 { "Stereo3 ADC MIXR", NULL, "adc stereo3 filter" }, 3063 { "Stereo3 ADC MIXR", NULL, "adc stereo3 filter" },
2907 { "adc stereo3 filter", NULL, "PLL1", is_sys_clk_from_pll }, 3064 { "adc stereo3 filter", NULL, "PLL1", is_sys_clk_from_pll },
@@ -2916,8 +3073,6 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
2916 3073
2917 { "Stereo4 ADC MIXL", NULL, "Sto4 ADC MIXL" }, 3074 { "Stereo4 ADC MIXL", NULL, "Sto4 ADC MIXL" },
2918 { "Stereo4 ADC MIXL", NULL, "adc stereo4 filter" }, 3075 { "Stereo4 ADC MIXL", NULL, "adc stereo4 filter" },
2919 { "adc stereo4 filter", NULL, "PLL1", is_sys_clk_from_pll },
2920
2921 { "Stereo4 ADC MIXR", NULL, "Sto4 ADC MIXR" }, 3076 { "Stereo4 ADC MIXR", NULL, "Sto4 ADC MIXR" },
2922 { "Stereo4 ADC MIXR", NULL, "adc stereo4 filter" }, 3077 { "Stereo4 ADC MIXR", NULL, "adc stereo4 filter" },
2923 { "adc stereo4 filter", NULL, "PLL1", is_sys_clk_from_pll }, 3078 { "adc stereo4 filter", NULL, "PLL1", is_sys_clk_from_pll },
@@ -3466,10 +3621,8 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
3466 3621
3467 { "DAC1 MIXL", "Stereo ADC Switch", "ADDA1 Mux" }, 3622 { "DAC1 MIXL", "Stereo ADC Switch", "ADDA1 Mux" },
3468 { "DAC1 MIXL", "DAC1 Switch", "DAC1 Mux" }, 3623 { "DAC1 MIXL", "DAC1 Switch", "DAC1 Mux" },
3469 { "DAC1 MIXL", NULL, "dac stereo1 filter" },
3470 { "DAC1 MIXR", "Stereo ADC Switch", "ADDA1 Mux" }, 3624 { "DAC1 MIXR", "Stereo ADC Switch", "ADDA1 Mux" },
3471 { "DAC1 MIXR", "DAC1 Switch", "DAC1 Mux" }, 3625 { "DAC1 MIXR", "DAC1 Switch", "DAC1 Mux" },
3472 { "DAC1 MIXR", NULL, "dac stereo1 filter" },
3473 3626
3474 { "DAC1 FS", NULL, "DAC1 MIXL" }, 3627 { "DAC1 FS", NULL, "DAC1 MIXL" },
3475 { "DAC1 FS", NULL, "DAC1 MIXR" }, 3628 { "DAC1 FS", NULL, "DAC1 MIXR" },
@@ -3536,35 +3689,46 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
3536 { "Stereo DAC MIXR", "DAC2 R Switch", "DAC2 R Mux" }, 3689 { "Stereo DAC MIXR", "DAC2 R Switch", "DAC2 R Mux" },
3537 { "Stereo DAC MIXR", "DAC1 L Switch", "DAC1 MIXL" }, 3690 { "Stereo DAC MIXR", "DAC1 L Switch", "DAC1 MIXL" },
3538 { "Stereo DAC MIXR", NULL, "dac stereo1 filter" }, 3691 { "Stereo DAC MIXR", NULL, "dac stereo1 filter" },
3692 { "dac stereo1 filter", NULL, "PLL1", is_sys_clk_from_pll },
3539 3693
3540 { "Mono DAC MIXL", "ST L Switch", "Sidetone Mux" }, 3694 { "Mono DAC MIXL", "ST L Switch", "Sidetone Mux" },
3541 { "Mono DAC MIXL", "DAC1 L Switch", "DAC1 MIXL" }, 3695 { "Mono DAC MIXL", "DAC1 L Switch", "DAC1 MIXL" },
3542 { "Mono DAC MIXL", "DAC2 L Switch", "DAC2 L Mux" }, 3696 { "Mono DAC MIXL", "DAC2 L Switch", "DAC2 L Mux" },
3543 { "Mono DAC MIXL", "DAC2 R Switch", "DAC2 R Mux" }, 3697 { "Mono DAC MIXL", "DAC2 R Switch", "DAC2 R Mux" },
3544 { "Mono DAC MIXL", NULL, "dac mono left filter" }, 3698 { "Mono DAC MIXL", NULL, "dac mono2 left filter" },
3699 { "dac mono2 left filter", NULL, "PLL1", is_sys_clk_from_pll },
3545 { "Mono DAC MIXR", "ST R Switch", "Sidetone Mux" }, 3700 { "Mono DAC MIXR", "ST R Switch", "Sidetone Mux" },
3546 { "Mono DAC MIXR", "DAC1 R Switch", "DAC1 MIXR" }, 3701 { "Mono DAC MIXR", "DAC1 R Switch", "DAC1 MIXR" },
3547 { "Mono DAC MIXR", "DAC2 R Switch", "DAC2 R Mux" }, 3702 { "Mono DAC MIXR", "DAC2 R Switch", "DAC2 R Mux" },
3548 { "Mono DAC MIXR", "DAC2 L Switch", "DAC2 L Mux" }, 3703 { "Mono DAC MIXR", "DAC2 L Switch", "DAC2 L Mux" },
3549 { "Mono DAC MIXR", NULL, "dac mono right filter" }, 3704 { "Mono DAC MIXR", NULL, "dac mono2 right filter" },
3705 { "dac mono2 right filter", NULL, "PLL1", is_sys_clk_from_pll },
3550 3706
3551 { "DD1 MIXL", "Sto DAC Mix L Switch", "Stereo DAC MIXL" }, 3707 { "DD1 MIXL", "Sto DAC Mix L Switch", "Stereo DAC MIXL" },
3552 { "DD1 MIXL", "Mono DAC Mix L Switch", "Mono DAC MIXL" }, 3708 { "DD1 MIXL", "Mono DAC Mix L Switch", "Mono DAC MIXL" },
3553 { "DD1 MIXL", "DAC3 L Switch", "DAC3 L Mux" }, 3709 { "DD1 MIXL", "DAC3 L Switch", "DAC3 L Mux" },
3554 { "DD1 MIXL", "DAC3 R Switch", "DAC3 R Mux" }, 3710 { "DD1 MIXL", "DAC3 R Switch", "DAC3 R Mux" },
3711 { "DD1 MIXL", NULL, "dac mono3 left filter" },
3712 { "dac mono3 left filter", NULL, "PLL1", is_sys_clk_from_pll },
3555 { "DD1 MIXR", "Sto DAC Mix R Switch", "Stereo DAC MIXR" }, 3713 { "DD1 MIXR", "Sto DAC Mix R Switch", "Stereo DAC MIXR" },
3556 { "DD1 MIXR", "Mono DAC Mix R Switch", "Mono DAC MIXR" }, 3714 { "DD1 MIXR", "Mono DAC Mix R Switch", "Mono DAC MIXR" },
3557 { "DD1 MIXR", "DAC3 L Switch", "DAC3 L Mux" }, 3715 { "DD1 MIXR", "DAC3 L Switch", "DAC3 L Mux" },
3558 { "DD1 MIXR", "DAC3 R Switch", "DAC3 R Mux" }, 3716 { "DD1 MIXR", "DAC3 R Switch", "DAC3 R Mux" },
3717 { "DD1 MIXR", NULL, "dac mono3 right filter" },
3718 { "dac mono3 right filter", NULL, "PLL1", is_sys_clk_from_pll },
3559 3719
3560 { "DD2 MIXL", "Sto DAC Mix L Switch", "Stereo DAC MIXL" }, 3720 { "DD2 MIXL", "Sto DAC Mix L Switch", "Stereo DAC MIXL" },
3561 { "DD2 MIXL", "Mono DAC Mix L Switch", "Mono DAC MIXL" }, 3721 { "DD2 MIXL", "Mono DAC Mix L Switch", "Mono DAC MIXL" },
3562 { "DD2 MIXL", "DAC4 L Switch", "DAC4 L Mux" }, 3722 { "DD2 MIXL", "DAC4 L Switch", "DAC4 L Mux" },
3563 { "DD2 MIXL", "DAC4 R Switch", "DAC4 R Mux" }, 3723 { "DD2 MIXL", "DAC4 R Switch", "DAC4 R Mux" },
3724 { "DD2 MIXL", NULL, "dac mono4 left filter" },
3725 { "dac mono4 left filter", NULL, "PLL1", is_sys_clk_from_pll },
3564 { "DD2 MIXR", "Sto DAC Mix R Switch", "Stereo DAC MIXR" }, 3726 { "DD2 MIXR", "Sto DAC Mix R Switch", "Stereo DAC MIXR" },
3565 { "DD2 MIXR", "Mono DAC Mix R Switch", "Mono DAC MIXR" }, 3727 { "DD2 MIXR", "Mono DAC Mix R Switch", "Mono DAC MIXR" },
3566 { "DD2 MIXR", "DAC4 L Switch", "DAC4 L Mux" }, 3728 { "DD2 MIXR", "DAC4 L Switch", "DAC4 L Mux" },
3567 { "DD2 MIXR", "DAC4 R Switch", "DAC4 R Mux" }, 3729 { "DD2 MIXR", "DAC4 R Switch", "DAC4 R Mux" },
3730 { "DD2 MIXR", NULL, "dac mono4 right filter" },
3731 { "dac mono4 right filter", NULL, "PLL1", is_sys_clk_from_pll },
3568 3732
3569 { "Stereo DAC MIX", NULL, "Stereo DAC MIXL" }, 3733 { "Stereo DAC MIX", NULL, "Stereo DAC MIXL" },
3570 { "Stereo DAC MIX", NULL, "Stereo DAC MIXR" }, 3734 { "Stereo DAC MIX", NULL, "Stereo DAC MIXR" },
@@ -3586,11 +3750,8 @@ static const struct snd_soc_dapm_route rt5677_dapm_routes[] = {
3586 { "DAC3 SRC Mux", "DD MIX2L", "DD2 MIXL" }, 3750 { "DAC3 SRC Mux", "DD MIX2L", "DD2 MIXL" },
3587 3751
3588 { "DAC 1", NULL, "DAC12 SRC Mux" }, 3752 { "DAC 1", NULL, "DAC12 SRC Mux" },
3589 { "DAC 1", NULL, "PLL1", is_sys_clk_from_pll },
3590 { "DAC 2", NULL, "DAC12 SRC Mux" }, 3753 { "DAC 2", NULL, "DAC12 SRC Mux" },
3591 { "DAC 2", NULL, "PLL1", is_sys_clk_from_pll },
3592 { "DAC 3", NULL, "DAC3 SRC Mux" }, 3754 { "DAC 3", NULL, "DAC3 SRC Mux" },
3593 { "DAC 3", NULL, "PLL1", is_sys_clk_from_pll },
3594 3755
3595 { "PDM1 L Mux", "STO1 DAC MIX", "Stereo DAC MIXL" }, 3756 { "PDM1 L Mux", "STO1 DAC MIX", "Stereo DAC MIXL" },
3596 { "PDM1 L Mux", "MONO DAC MIX", "Mono DAC MIXL" }, 3757 { "PDM1 L Mux", "MONO DAC MIX", "Mono DAC MIXL" },
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index f6847fdd6ddd..eb0a1644ba11 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -323,7 +323,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
323 SND_SOC_DAPM_OUTPUT("ROUT2"), 323 SND_SOC_DAPM_OUTPUT("ROUT2"),
324 SND_SOC_DAPM_OUTPUT("MONO1"), 324 SND_SOC_DAPM_OUTPUT("MONO1"),
325 SND_SOC_DAPM_OUTPUT("OUT3"), 325 SND_SOC_DAPM_OUTPUT("OUT3"),
326 SND_SOC_DAPM_OUTPUT("VREF"), 326 SND_SOC_DAPM_VMID("VREF"),
327 327
328 SND_SOC_DAPM_INPUT("LINPUT1"), 328 SND_SOC_DAPM_INPUT("LINPUT1"),
329 SND_SOC_DAPM_INPUT("LINPUT2"), 329 SND_SOC_DAPM_INPUT("LINPUT2"),
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 8d18bbda661b..06d3a34ac90a 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -335,13 +335,47 @@ static int dw_i2s_resume(struct snd_soc_dai *dai)
335#define dw_i2s_resume NULL 335#define dw_i2s_resume NULL
336#endif 336#endif
337 337
338static void dw_configure_dai_by_pd(struct dw_i2s_dev *dev,
339 struct snd_soc_dai_driver *dw_i2s_dai,
340 struct resource *res,
341 const struct i2s_platform_data *pdata)
342{
343 /* Set DMA slaves info */
344
345 dev->play_dma_data.data = pdata->play_dma_data;
346 dev->capture_dma_data.data = pdata->capture_dma_data;
347 dev->play_dma_data.addr = res->start + I2S_TXDMA;
348 dev->capture_dma_data.addr = res->start + I2S_RXDMA;
349 dev->play_dma_data.max_burst = 16;
350 dev->capture_dma_data.max_burst = 16;
351 dev->play_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
352 dev->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
353 dev->play_dma_data.filter = pdata->filter;
354 dev->capture_dma_data.filter = pdata->filter;
355
356 if (pdata->cap & DWC_I2S_PLAY) {
357 dev_dbg(dev->dev, " designware: play supported\n");
358 dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM;
359 dw_i2s_dai->playback.channels_max = pdata->channel;
360 dw_i2s_dai->playback.formats = pdata->snd_fmts;
361 dw_i2s_dai->playback.rates = pdata->snd_rates;
362 }
363
364 if (pdata->cap & DWC_I2S_RECORD) {
365 dev_dbg(dev->dev, "designware: record supported\n");
366 dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM;
367 dw_i2s_dai->capture.channels_max = pdata->channel;
368 dw_i2s_dai->capture.formats = pdata->snd_fmts;
369 dw_i2s_dai->capture.rates = pdata->snd_rates;
370 }
371}
372
338static int dw_i2s_probe(struct platform_device *pdev) 373static int dw_i2s_probe(struct platform_device *pdev)
339{ 374{
340 const struct i2s_platform_data *pdata = pdev->dev.platform_data; 375 const struct i2s_platform_data *pdata = pdev->dev.platform_data;
341 struct dw_i2s_dev *dev; 376 struct dw_i2s_dev *dev;
342 struct resource *res; 377 struct resource *res;
343 int ret; 378 int ret;
344 unsigned int cap;
345 struct snd_soc_dai_driver *dw_i2s_dai; 379 struct snd_soc_dai_driver *dw_i2s_dai;
346 380
347 if (!pdata) { 381 if (!pdata) {
@@ -356,44 +390,23 @@ static int dw_i2s_probe(struct platform_device *pdev)
356 } 390 }
357 391
358 dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL); 392 dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL);
359 if (!dw_i2s_dai) { 393 if (!dw_i2s_dai)
360 dev_err(&pdev->dev, "mem allocation failed for dai driver\n");
361 return -ENOMEM; 394 return -ENOMEM;
362 }
363 395
364 dw_i2s_dai->ops = &dw_i2s_dai_ops; 396 dw_i2s_dai->ops = &dw_i2s_dai_ops;
365 dw_i2s_dai->suspend = dw_i2s_suspend; 397 dw_i2s_dai->suspend = dw_i2s_suspend;
366 dw_i2s_dai->resume = dw_i2s_resume; 398 dw_i2s_dai->resume = dw_i2s_resume;
367 399
368 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 400 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
369 if (!res) {
370 dev_err(&pdev->dev, "no i2s resource defined\n");
371 return -ENODEV;
372 }
373
374 dev->i2s_base = devm_ioremap_resource(&pdev->dev, res); 401 dev->i2s_base = devm_ioremap_resource(&pdev->dev, res);
375 if (IS_ERR(dev->i2s_base)) { 402 if (IS_ERR(dev->i2s_base))
376 dev_err(&pdev->dev, "ioremap fail for i2s_region\n");
377 return PTR_ERR(dev->i2s_base); 403 return PTR_ERR(dev->i2s_base);
378 }
379
380 cap = pdata->cap;
381 dev->capability = cap;
382 dev->i2s_clk_cfg = pdata->i2s_clk_cfg;
383
384 /* Set DMA slaves info */
385 404
386 dev->play_dma_data.data = pdata->play_dma_data; 405 dev->dev = &pdev->dev;
387 dev->capture_dma_data.data = pdata->capture_dma_data; 406 dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata);
388 dev->play_dma_data.addr = res->start + I2S_TXDMA;
389 dev->capture_dma_data.addr = res->start + I2S_RXDMA;
390 dev->play_dma_data.max_burst = 16;
391 dev->capture_dma_data.max_burst = 16;
392 dev->play_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
393 dev->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
394 dev->play_dma_data.filter = pdata->filter;
395 dev->capture_dma_data.filter = pdata->filter;
396 407
408 dev->capability = pdata->cap;
409 dev->i2s_clk_cfg = pdata->i2s_clk_cfg;
397 dev->clk = clk_get(&pdev->dev, NULL); 410 dev->clk = clk_get(&pdev->dev, NULL);
398 if (IS_ERR(dev->clk)) 411 if (IS_ERR(dev->clk))
399 return PTR_ERR(dev->clk); 412 return PTR_ERR(dev->clk);
@@ -402,23 +415,6 @@ static int dw_i2s_probe(struct platform_device *pdev)
402 if (ret < 0) 415 if (ret < 0)
403 goto err_clk_put; 416 goto err_clk_put;
404 417
405 if (cap & DWC_I2S_PLAY) {
406 dev_dbg(&pdev->dev, " designware: play supported\n");
407 dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM;
408 dw_i2s_dai->playback.channels_max = pdata->channel;
409 dw_i2s_dai->playback.formats = pdata->snd_fmts;
410 dw_i2s_dai->playback.rates = pdata->snd_rates;
411 }
412
413 if (cap & DWC_I2S_RECORD) {
414 dev_dbg(&pdev->dev, "designware: record supported\n");
415 dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM;
416 dw_i2s_dai->capture.channels_max = pdata->channel;
417 dw_i2s_dai->capture.formats = pdata->snd_fmts;
418 dw_i2s_dai->capture.rates = pdata->snd_rates;
419 }
420
421 dev->dev = &pdev->dev;
422 dev_set_drvdata(&pdev->dev, dev); 418 dev_set_drvdata(&pdev->dev, dev);
423 ret = snd_soc_register_component(&pdev->dev, &dw_i2s_component, 419 ret = snd_soc_register_component(&pdev->dev, &dw_i2s_component,
424 dw_i2s_dai, 1); 420 dw_i2s_dai, 1);
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index f86de1211b96..c0813f546d1f 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -46,7 +46,7 @@ config SND_SOC_INTEL_BAYTRAIL
46 46
47config SND_SOC_INTEL_HASWELL_MACH 47config SND_SOC_INTEL_HASWELL_MACH
48 tristate "ASoC Audio DSP support for Intel Haswell Lynxpoint" 48 tristate "ASoC Audio DSP support for Intel Haswell Lynxpoint"
49 depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && I2C && \\ 49 depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && I2C && \
50 I2C_DESIGNWARE_PLATFORM 50 I2C_DESIGNWARE_PLATFORM
51 select SND_SOC_INTEL_HASWELL 51 select SND_SOC_INTEL_HASWELL
52 select SND_SOC_RT5640 52 select SND_SOC_RT5640
@@ -76,7 +76,7 @@ config SND_SOC_INTEL_BYT_MAX98090_MACH
76 76
77config SND_SOC_INTEL_BROADWELL_MACH 77config SND_SOC_INTEL_BROADWELL_MACH
78 tristate "ASoC Audio DSP support for Intel Broadwell Wildcatpoint" 78 tristate "ASoC Audio DSP support for Intel Broadwell Wildcatpoint"
79 depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && DW_DMAC && \\ 79 depends on SND_SOC_INTEL_SST && X86_INTEL_LPSS && DW_DMAC && \
80 I2C_DESIGNWARE_PLATFORM 80 I2C_DESIGNWARE_PLATFORM
81 select SND_SOC_INTEL_HASWELL 81 select SND_SOC_INTEL_HASWELL
82 select SND_COMPRESS_OFFLOAD 82 select SND_COMPRESS_OFFLOAD
diff --git a/sound/soc/intel/bytcr_dpcm_rt5640.c b/sound/soc/intel/bytcr_dpcm_rt5640.c
index eef0c56ec32e..59308629043e 100644
--- a/sound/soc/intel/bytcr_dpcm_rt5640.c
+++ b/sound/soc/intel/bytcr_dpcm_rt5640.c
@@ -215,7 +215,6 @@ static int snd_byt_mc_probe(struct platform_device *pdev)
215 215
216static struct platform_driver snd_byt_mc_driver = { 216static struct platform_driver snd_byt_mc_driver = {
217 .driver = { 217 .driver = {
218 .owner = THIS_MODULE,
219 .name = "bytt100_rt5640", 218 .name = "bytt100_rt5640",
220 .pm = &snd_soc_pm_ops, 219 .pm = &snd_soc_pm_ops,
221 }, 220 },
diff --git a/sound/soc/intel/cht_bsw_rt5672.c b/sound/soc/intel/cht_bsw_rt5672.c
index 9b8b561171b7..a406c6104897 100644
--- a/sound/soc/intel/cht_bsw_rt5672.c
+++ b/sound/soc/intel/cht_bsw_rt5672.c
@@ -270,7 +270,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
270 270
271static struct platform_driver snd_cht_mc_driver = { 271static struct platform_driver snd_cht_mc_driver = {
272 .driver = { 272 .driver = {
273 .owner = THIS_MODULE,
274 .name = "cht-bsw-rt5672", 273 .name = "cht-bsw-rt5672",
275 .pm = &snd_soc_pm_ops, 274 .pm = &snd_soc_pm_ops,
276 }, 275 },
diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index b3f9489794a6..a2ae2c5f2e9f 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -497,6 +497,7 @@ struct sst_module *sst_module_new(struct sst_fw *sst_fw,
497 sst_module->sst_fw = sst_fw; 497 sst_module->sst_fw = sst_fw;
498 sst_module->scratch_size = template->scratch_size; 498 sst_module->scratch_size = template->scratch_size;
499 sst_module->persistent_size = template->persistent_size; 499 sst_module->persistent_size = template->persistent_size;
500 sst_module->entry = template->entry;
500 501
501 INIT_LIST_HEAD(&sst_module->block_list); 502 INIT_LIST_HEAD(&sst_module->block_list);
502 INIT_LIST_HEAD(&sst_module->runtime_list); 503 INIT_LIST_HEAD(&sst_module->runtime_list);
diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c
index 2ac72eb5e75d..c3fbcdec6a15 100644
--- a/sound/soc/intel/sst/sst_acpi.c
+++ b/sound/soc/intel/sst/sst_acpi.c
@@ -245,7 +245,7 @@ static struct sst_machines *sst_acpi_find_machine(
245 return NULL; 245 return NULL;
246} 246}
247 247
248int sst_acpi_probe(struct platform_device *pdev) 248static int sst_acpi_probe(struct platform_device *pdev)
249{ 249{
250 struct device *dev = &pdev->dev; 250 struct device *dev = &pdev->dev;
251 int ret = 0; 251 int ret = 0;
@@ -332,7 +332,7 @@ do_sst_cleanup:
332* This function is called by OS when a device is unloaded 332* This function is called by OS when a device is unloaded
333* This frees the interrupt etc 333* This frees the interrupt etc
334*/ 334*/
335int sst_acpi_remove(struct platform_device *pdev) 335static int sst_acpi_remove(struct platform_device *pdev)
336{ 336{
337 struct intel_sst_drv *ctx; 337 struct intel_sst_drv *ctx;
338 338
@@ -366,7 +366,6 @@ MODULE_DEVICE_TABLE(acpi, sst_acpi_ids);
366static struct platform_driver sst_acpi_driver = { 366static struct platform_driver sst_acpi_driver = {
367 .driver = { 367 .driver = {
368 .name = "intel_sst_acpi", 368 .name = "intel_sst_acpi",
369 .owner = THIS_MODULE,
370 .acpi_match_table = ACPI_PTR(sst_acpi_ids), 369 .acpi_match_table = ACPI_PTR(sst_acpi_ids),
371 .pm = &intel_sst_pm, 370 .pm = &intel_sst_pm,
372 }, 371 },
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index 3f9ac7dbdc80..ccfb41c22e53 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -393,7 +393,6 @@ static int omap_hdmi_audio_remove(struct platform_device *pdev)
393static struct platform_driver hdmi_audio_driver = { 393static struct platform_driver hdmi_audio_driver = {
394 .driver = { 394 .driver = {
395 .name = DRV_NAME, 395 .name = DRV_NAME,
396 .owner = THIS_MODULE,
397 }, 396 },
398 .probe = omap_hdmi_audio_probe, 397 .probe = omap_hdmi_audio_probe,
399 .remove = omap_hdmi_audio_remove, 398 .remove = omap_hdmi_audio_remove,
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index d7d5fb20ea6f..a6d680acd907 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -352,7 +352,6 @@ static int spitz_remove(struct platform_device *pdev)
352static struct platform_driver spitz_driver = { 352static struct platform_driver spitz_driver = {
353 .driver = { 353 .driver = {
354 .name = "spitz-audio", 354 .name = "spitz-audio",
355 .owner = THIS_MODULE,
356 .pm = &snd_soc_pm_ops, 355 .pm = &snd_soc_pm_ops,
357 }, 356 },
358 .probe = spitz_probe, 357 .probe = spitz_probe,
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index dcc26eda0539..acb5be53bfb4 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -247,6 +247,10 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
247 247
248 regmap_update_bits(i2s->regmap, I2S_TXCR, I2S_TXCR_VDW_MASK, val); 248 regmap_update_bits(i2s->regmap, I2S_TXCR, I2S_TXCR_VDW_MASK, val);
249 regmap_update_bits(i2s->regmap, I2S_RXCR, I2S_RXCR_VDW_MASK, val); 249 regmap_update_bits(i2s->regmap, I2S_RXCR, I2S_RXCR_VDW_MASK, val);
250 regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_TDL_MASK,
251 I2S_DMACR_TDL(16));
252 regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDL_MASK,
253 I2S_DMACR_RDL(16));
250 254
251 return 0; 255 return 0;
252} 256}
diff --git a/sound/soc/samsung/arndale_rt5631.c b/sound/soc/samsung/arndale_rt5631.c
index 1e2b61ca8db2..8bf2e2c4bafb 100644
--- a/sound/soc/samsung/arndale_rt5631.c
+++ b/sound/soc/samsung/arndale_rt5631.c
@@ -135,7 +135,6 @@ MODULE_DEVICE_TABLE(of, samsung_arndale_rt5631_of_match);
135static struct platform_driver arndale_audio_driver = { 135static struct platform_driver arndale_audio_driver = {
136 .driver = { 136 .driver = {
137 .name = "arndale-audio", 137 .name = "arndale-audio",
138 .owner = THIS_MODULE,
139 .pm = &snd_soc_pm_ops, 138 .pm = &snd_soc_pm_ops,
140 .of_match_table = of_match_ptr(samsung_arndale_rt5631_of_match), 139 .of_match_table = of_match_ptr(samsung_arndale_rt5631_of_match),
141 }, 140 },
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2c62620abca6..c024962ba500 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1626,9 +1626,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
1626 } 1626 }
1627 } 1627 }
1628 1628
1629 if (card->fully_routed)
1630 snd_soc_dapm_auto_nc_pins(card);
1631
1632 snd_soc_dapm_new_widgets(card); 1629 snd_soc_dapm_new_widgets(card);
1633 1630
1634 ret = snd_card_register(card->snd_card); 1631 ret = snd_card_register(card->snd_card);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index c5136bb1f982..ea496842ee83 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2279,6 +2279,9 @@ static void dapm_update_widget_flags(struct snd_soc_dapm_widget *w)
2279 2279
2280 switch (w->id) { 2280 switch (w->id) {
2281 case snd_soc_dapm_input: 2281 case snd_soc_dapm_input:
2282 /* On a fully routed card a input is never a source */
2283 if (w->dapm->card->fully_routed)
2284 break;
2282 w->is_source = 1; 2285 w->is_source = 1;
2283 list_for_each_entry(p, &w->sources, list_sink) { 2286 list_for_each_entry(p, &w->sources, list_sink) {
2284 if (p->source->id == snd_soc_dapm_micbias || 2287 if (p->source->id == snd_soc_dapm_micbias ||
@@ -2291,6 +2294,9 @@ static void dapm_update_widget_flags(struct snd_soc_dapm_widget *w)
2291 } 2294 }
2292 break; 2295 break;
2293 case snd_soc_dapm_output: 2296 case snd_soc_dapm_output:
2297 /* On a fully routed card a output is never a sink */
2298 if (w->dapm->card->fully_routed)
2299 break;
2294 w->is_sink = 1; 2300 w->is_sink = 1;
2295 list_for_each_entry(p, &w->sinks, list_source) { 2301 list_for_each_entry(p, &w->sinks, list_source) {
2296 if (p->sink->id == snd_soc_dapm_spk || 2302 if (p->sink->id == snd_soc_dapm_spk ||
@@ -3085,16 +3091,24 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3085 3091
3086 switch (w->id) { 3092 switch (w->id) {
3087 case snd_soc_dapm_mic: 3093 case snd_soc_dapm_mic:
3088 case snd_soc_dapm_input:
3089 w->is_source = 1; 3094 w->is_source = 1;
3090 w->power_check = dapm_generic_check_power; 3095 w->power_check = dapm_generic_check_power;
3091 break; 3096 break;
3097 case snd_soc_dapm_input:
3098 if (!dapm->card->fully_routed)
3099 w->is_source = 1;
3100 w->power_check = dapm_generic_check_power;
3101 break;
3092 case snd_soc_dapm_spk: 3102 case snd_soc_dapm_spk:
3093 case snd_soc_dapm_hp: 3103 case snd_soc_dapm_hp:
3094 case snd_soc_dapm_output:
3095 w->is_sink = 1; 3104 w->is_sink = 1;
3096 w->power_check = dapm_generic_check_power; 3105 w->power_check = dapm_generic_check_power;
3097 break; 3106 break;
3107 case snd_soc_dapm_output:
3108 if (!dapm->card->fully_routed)
3109 w->is_sink = 1;
3110 w->power_check = dapm_generic_check_power;
3111 break;
3098 case snd_soc_dapm_vmid: 3112 case snd_soc_dapm_vmid:
3099 case snd_soc_dapm_siggen: 3113 case snd_soc_dapm_siggen:
3100 w->is_source = 1; 3114 w->is_source = 1;
@@ -3809,93 +3823,6 @@ int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
3809EXPORT_SYMBOL_GPL(snd_soc_dapm_ignore_suspend); 3823EXPORT_SYMBOL_GPL(snd_soc_dapm_ignore_suspend);
3810 3824
3811/** 3825/**
3812 * dapm_is_external_path() - Checks if a path is a external path
3813 * @card: The card the path belongs to
3814 * @path: The path to check
3815 *
3816 * Returns true if the path is either between two different DAPM contexts or
3817 * between two external pins of the same DAPM context. Otherwise returns
3818 * false.
3819 */
3820static bool dapm_is_external_path(struct snd_soc_card *card,
3821 struct snd_soc_dapm_path *path)
3822{
3823 dev_dbg(card->dev,
3824 "... Path %s(id:%d dapm:%p) - %s(id:%d dapm:%p)\n",
3825 path->source->name, path->source->id, path->source->dapm,
3826 path->sink->name, path->sink->id, path->sink->dapm);
3827
3828 /* Connection between two different DAPM contexts */
3829 if (path->source->dapm != path->sink->dapm)
3830 return true;
3831
3832 /* Loopback connection from external pin to external pin */
3833 if (path->sink->id == snd_soc_dapm_input) {
3834 switch (path->source->id) {
3835 case snd_soc_dapm_output:
3836 case snd_soc_dapm_micbias:
3837 return true;
3838 default:
3839 break;
3840 }
3841 }
3842
3843 return false;
3844}
3845
3846static bool snd_soc_dapm_widget_in_card_paths(struct snd_soc_card *card,
3847 struct snd_soc_dapm_widget *w)
3848{
3849 struct snd_soc_dapm_path *p;
3850
3851 list_for_each_entry(p, &w->sources, list_sink) {
3852 if (dapm_is_external_path(card, p))
3853 return true;
3854 }
3855
3856 list_for_each_entry(p, &w->sinks, list_source) {
3857 if (dapm_is_external_path(card, p))
3858 return true;
3859 }
3860
3861 return false;
3862}
3863
3864/**
3865 * snd_soc_dapm_auto_nc_pins - call snd_soc_dapm_nc_pin for unused pins
3866 * @card: The card whose pins should be processed
3867 *
3868 * Automatically call snd_soc_dapm_nc_pin() for any external pins in the card
3869 * which are unused. Pins are used if they are connected externally to a
3870 * component, whether that be to some other device, or a loop-back connection to
3871 * the component itself.
3872 */
3873void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card)
3874{
3875 struct snd_soc_dapm_widget *w;
3876
3877 dev_dbg(card->dev, "ASoC: Auto NC: DAPMs: card:%p\n", &card->dapm);
3878
3879 list_for_each_entry(w, &card->widgets, list) {
3880 switch (w->id) {
3881 case snd_soc_dapm_input:
3882 case snd_soc_dapm_output:
3883 case snd_soc_dapm_micbias:
3884 dev_dbg(card->dev, "ASoC: Auto NC: Checking widget %s\n",
3885 w->name);
3886 if (!snd_soc_dapm_widget_in_card_paths(card, w)) {
3887 dev_dbg(card->dev,
3888 "... Not in map; disabling\n");
3889 snd_soc_dapm_nc_pin(w->dapm, w->name);
3890 }
3891 break;
3892 default:
3893 break;
3894 }
3895 }
3896}
3897
3898/**
3899 * snd_soc_dapm_free - free dapm resources 3826 * snd_soc_dapm_free - free dapm resources
3900 * @dapm: DAPM context 3827 * @dapm: DAPM context
3901 * 3828 *
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index eb87d96e2cf0..0ae0e2a9eed7 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -746,7 +746,8 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
746 codec_dai); 746 codec_dai);
747 if (ret < 0) { 747 if (ret < 0) {
748 dev_err(codec_dai->dev, 748 dev_err(codec_dai->dev,
749 "ASoC: DAI prepare error: %d\n", ret); 749 "ASoC: codec DAI prepare error: %d\n",
750 ret);
750 goto out; 751 goto out;
751 } 752 }
752 } 753 }
@@ -755,8 +756,8 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
755 if (cpu_dai->driver->ops && cpu_dai->driver->ops->prepare) { 756 if (cpu_dai->driver->ops && cpu_dai->driver->ops->prepare) {
756 ret = cpu_dai->driver->ops->prepare(substream, cpu_dai); 757 ret = cpu_dai->driver->ops->prepare(substream, cpu_dai);
757 if (ret < 0) { 758 if (ret < 0) {
758 dev_err(cpu_dai->dev, "ASoC: DAI prepare error: %d\n", 759 dev_err(cpu_dai->dev,
759 ret); 760 "ASoC: cpu DAI prepare error: %d\n", ret);
760 goto out; 761 goto out;
761 } 762 }
762 } 763 }