diff options
Diffstat (limited to 'sound/soc/intel')
-rw-r--r-- | sound/soc/intel/Kconfig | 13 | ||||
-rw-r--r-- | sound/soc/intel/atom/sst-mfld-platform-pcm.c | 1 | ||||
-rw-r--r-- | sound/soc/intel/boards/skl_rt286.c | 5 | ||||
-rw-r--r-- | sound/soc/intel/common/Makefile | 9 | ||||
-rw-r--r-- | sound/soc/intel/common/sst-acpi.c | 4 | ||||
-rw-r--r-- | sound/soc/intel/common/sst-match-acpi.c | 3 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-messages.c | 6 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-pcm.c | 1 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 75 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 2 |
10 files changed, 82 insertions, 37 deletions
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig index 803f95e40679..7d7c872c280d 100644 --- a/sound/soc/intel/Kconfig +++ b/sound/soc/intel/Kconfig | |||
@@ -30,11 +30,15 @@ config SND_SST_IPC_ACPI | |||
30 | config SND_SOC_INTEL_SST | 30 | config SND_SOC_INTEL_SST |
31 | tristate | 31 | tristate |
32 | select SND_SOC_INTEL_SST_ACPI if ACPI | 32 | select SND_SOC_INTEL_SST_ACPI if ACPI |
33 | select SND_SOC_INTEL_SST_MATCH if ACPI | ||
33 | depends on (X86 || COMPILE_TEST) | 34 | depends on (X86 || COMPILE_TEST) |
34 | 35 | ||
35 | config SND_SOC_INTEL_SST_ACPI | 36 | config SND_SOC_INTEL_SST_ACPI |
36 | tristate | 37 | tristate |
37 | 38 | ||
39 | config SND_SOC_INTEL_SST_MATCH | ||
40 | tristate | ||
41 | |||
38 | config SND_SOC_INTEL_HASWELL | 42 | config SND_SOC_INTEL_HASWELL |
39 | tristate | 43 | tristate |
40 | 44 | ||
@@ -57,7 +61,7 @@ config SND_SOC_INTEL_HASWELL_MACH | |||
57 | config SND_SOC_INTEL_BYT_RT5640_MACH | 61 | config SND_SOC_INTEL_BYT_RT5640_MACH |
58 | tristate "ASoC Audio driver for Intel Baytrail with RT5640 codec" | 62 | tristate "ASoC Audio driver for Intel Baytrail with RT5640 codec" |
59 | depends on X86_INTEL_LPSS && I2C | 63 | depends on X86_INTEL_LPSS && I2C |
60 | depends on DW_DMAC_CORE=y && (SND_SOC_INTEL_BYTCR_RT5640_MACH = n) | 64 | depends on DW_DMAC_CORE=y && (SND_SST_IPC_ACPI = n) |
61 | select SND_SOC_INTEL_SST | 65 | select SND_SOC_INTEL_SST |
62 | select SND_SOC_INTEL_BAYTRAIL | 66 | select SND_SOC_INTEL_BAYTRAIL |
63 | select SND_SOC_RT5640 | 67 | select SND_SOC_RT5640 |
@@ -69,7 +73,7 @@ config SND_SOC_INTEL_BYT_RT5640_MACH | |||
69 | config SND_SOC_INTEL_BYT_MAX98090_MACH | 73 | config SND_SOC_INTEL_BYT_MAX98090_MACH |
70 | tristate "ASoC Audio driver for Intel Baytrail with MAX98090 codec" | 74 | tristate "ASoC Audio driver for Intel Baytrail with MAX98090 codec" |
71 | depends on X86_INTEL_LPSS && I2C | 75 | depends on X86_INTEL_LPSS && I2C |
72 | depends on DW_DMAC_CORE=y | 76 | depends on DW_DMAC_CORE=y && (SND_SST_IPC_ACPI = n) |
73 | select SND_SOC_INTEL_SST | 77 | select SND_SOC_INTEL_SST |
74 | select SND_SOC_INTEL_BAYTRAIL | 78 | select SND_SOC_INTEL_BAYTRAIL |
75 | select SND_SOC_MAX98090 | 79 | select SND_SOC_MAX98090 |
@@ -97,6 +101,7 @@ config SND_SOC_INTEL_BYTCR_RT5640_MACH | |||
97 | select SND_SOC_RT5640 | 101 | select SND_SOC_RT5640 |
98 | select SND_SST_MFLD_PLATFORM | 102 | select SND_SST_MFLD_PLATFORM |
99 | select SND_SST_IPC_ACPI | 103 | select SND_SST_IPC_ACPI |
104 | select SND_SOC_INTEL_SST_MATCH if ACPI | ||
100 | help | 105 | help |
101 | This adds support for ASoC machine driver for Intel(R) Baytrail and Baytrail-CR | 106 | This adds support for ASoC machine driver for Intel(R) Baytrail and Baytrail-CR |
102 | platforms with RT5640 audio codec. | 107 | platforms with RT5640 audio codec. |
@@ -109,6 +114,7 @@ config SND_SOC_INTEL_BYTCR_RT5651_MACH | |||
109 | select SND_SOC_RT5651 | 114 | select SND_SOC_RT5651 |
110 | select SND_SST_MFLD_PLATFORM | 115 | select SND_SST_MFLD_PLATFORM |
111 | select SND_SST_IPC_ACPI | 116 | select SND_SST_IPC_ACPI |
117 | select SND_SOC_INTEL_SST_MATCH if ACPI | ||
112 | help | 118 | help |
113 | This adds support for ASoC machine driver for Intel(R) Baytrail and Baytrail-CR | 119 | This adds support for ASoC machine driver for Intel(R) Baytrail and Baytrail-CR |
114 | platforms with RT5651 audio codec. | 120 | platforms with RT5651 audio codec. |
@@ -121,6 +127,7 @@ config SND_SOC_INTEL_CHT_BSW_RT5672_MACH | |||
121 | select SND_SOC_RT5670 | 127 | select SND_SOC_RT5670 |
122 | select SND_SST_MFLD_PLATFORM | 128 | select SND_SST_MFLD_PLATFORM |
123 | select SND_SST_IPC_ACPI | 129 | select SND_SST_IPC_ACPI |
130 | select SND_SOC_INTEL_SST_MATCH if ACPI | ||
124 | help | 131 | help |
125 | This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell | 132 | This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell |
126 | platforms with RT5672 audio codec. | 133 | platforms with RT5672 audio codec. |
@@ -133,6 +140,7 @@ config SND_SOC_INTEL_CHT_BSW_RT5645_MACH | |||
133 | select SND_SOC_RT5645 | 140 | select SND_SOC_RT5645 |
134 | select SND_SST_MFLD_PLATFORM | 141 | select SND_SST_MFLD_PLATFORM |
135 | select SND_SST_IPC_ACPI | 142 | select SND_SST_IPC_ACPI |
143 | select SND_SOC_INTEL_SST_MATCH if ACPI | ||
136 | help | 144 | help |
137 | This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell | 145 | This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell |
138 | platforms with RT5645/5650 audio codec. | 146 | platforms with RT5645/5650 audio codec. |
@@ -145,6 +153,7 @@ config SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH | |||
145 | select SND_SOC_TS3A227E | 153 | select SND_SOC_TS3A227E |
146 | select SND_SST_MFLD_PLATFORM | 154 | select SND_SST_MFLD_PLATFORM |
147 | select SND_SST_IPC_ACPI | 155 | select SND_SST_IPC_ACPI |
156 | select SND_SOC_INTEL_SST_MATCH if ACPI | ||
148 | help | 157 | help |
149 | This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell | 158 | This adds support for ASoC machine driver for Intel(R) Cherrytrail & Braswell |
150 | platforms with MAX98090 audio codec it also can support TI jack chip as aux device. | 159 | platforms with MAX98090 audio codec it also can support TI jack chip as aux device. |
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index 55c33dc76ce4..52ed434cbca6 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c | |||
@@ -528,6 +528,7 @@ static struct snd_soc_dai_driver sst_platform_dai[] = { | |||
528 | .ops = &sst_compr_dai_ops, | 528 | .ops = &sst_compr_dai_ops, |
529 | .playback = { | 529 | .playback = { |
530 | .stream_name = "Compress Playback", | 530 | .stream_name = "Compress Playback", |
531 | .channels_min = 1, | ||
531 | }, | 532 | }, |
532 | }, | 533 | }, |
533 | /* BE CPU Dais */ | 534 | /* BE CPU Dais */ |
diff --git a/sound/soc/intel/boards/skl_rt286.c b/sound/soc/intel/boards/skl_rt286.c index 7396ddb427d8..2cbcbe412661 100644 --- a/sound/soc/intel/boards/skl_rt286.c +++ b/sound/soc/intel/boards/skl_rt286.c | |||
@@ -212,7 +212,10 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd, | |||
212 | { | 212 | { |
213 | struct snd_interval *channels = hw_param_interval(params, | 213 | struct snd_interval *channels = hw_param_interval(params, |
214 | SNDRV_PCM_HW_PARAM_CHANNELS); | 214 | SNDRV_PCM_HW_PARAM_CHANNELS); |
215 | channels->min = channels->max = 4; | 215 | if (params_channels(params) == 2) |
216 | channels->min = channels->max = 2; | ||
217 | else | ||
218 | channels->min = channels->max = 4; | ||
216 | 219 | ||
217 | return 0; | 220 | return 0; |
218 | } | 221 | } |
diff --git a/sound/soc/intel/common/Makefile b/sound/soc/intel/common/Makefile index 668fdeee195e..fbbb25c2ceed 100644 --- a/sound/soc/intel/common/Makefile +++ b/sound/soc/intel/common/Makefile | |||
@@ -1,13 +1,10 @@ | |||
1 | snd-soc-sst-dsp-objs := sst-dsp.o | 1 | snd-soc-sst-dsp-objs := sst-dsp.o |
2 | ifneq ($(CONFIG_SND_SST_IPC_ACPI),) | 2 | snd-soc-sst-acpi-objs := sst-acpi.o |
3 | snd-soc-sst-acpi-objs := sst-match-acpi.o | 3 | snd-soc-sst-match-objs := sst-match-acpi.o |
4 | else | ||
5 | snd-soc-sst-acpi-objs := sst-acpi.o sst-match-acpi.o | ||
6 | endif | ||
7 | |||
8 | snd-soc-sst-ipc-objs := sst-ipc.o | 4 | snd-soc-sst-ipc-objs := sst-ipc.o |
9 | 5 | ||
10 | snd-soc-sst-dsp-$(CONFIG_DW_DMAC_CORE) += sst-firmware.o | 6 | snd-soc-sst-dsp-$(CONFIG_DW_DMAC_CORE) += sst-firmware.o |
11 | 7 | ||
12 | obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o | 8 | obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o |
13 | obj-$(CONFIG_SND_SOC_INTEL_SST_ACPI) += snd-soc-sst-acpi.o | 9 | obj-$(CONFIG_SND_SOC_INTEL_SST_ACPI) += snd-soc-sst-acpi.o |
10 | obj-$(CONFIG_SND_SOC_INTEL_SST_MATCH) += snd-soc-sst-match.o | ||
diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 7a85c576dad3..2c5eda14d510 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c | |||
@@ -215,6 +215,7 @@ static struct sst_acpi_desc sst_acpi_broadwell_desc = { | |||
215 | .dma_size = SST_LPT_DSP_DMA_SIZE, | 215 | .dma_size = SST_LPT_DSP_DMA_SIZE, |
216 | }; | 216 | }; |
217 | 217 | ||
218 | #if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) | ||
218 | static struct sst_acpi_mach baytrail_machines[] = { | 219 | static struct sst_acpi_mach baytrail_machines[] = { |
219 | { "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL }, | 220 | { "10EC5640", "byt-rt5640", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL }, |
220 | { "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL }, | 221 | { "193C9890", "byt-max98090", "intel/fw_sst_0f28.bin-48kHz_i2s_master", NULL, NULL, NULL }, |
@@ -231,11 +232,14 @@ static struct sst_acpi_desc sst_acpi_baytrail_desc = { | |||
231 | .sst_id = SST_DEV_ID_BYT, | 232 | .sst_id = SST_DEV_ID_BYT, |
232 | .resindex_dma_base = -1, | 233 | .resindex_dma_base = -1, |
233 | }; | 234 | }; |
235 | #endif | ||
234 | 236 | ||
235 | static const struct acpi_device_id sst_acpi_match[] = { | 237 | static const struct acpi_device_id sst_acpi_match[] = { |
236 | { "INT33C8", (unsigned long)&sst_acpi_haswell_desc }, | 238 | { "INT33C8", (unsigned long)&sst_acpi_haswell_desc }, |
237 | { "INT3438", (unsigned long)&sst_acpi_broadwell_desc }, | 239 | { "INT3438", (unsigned long)&sst_acpi_broadwell_desc }, |
240 | #if !IS_ENABLED(CONFIG_SND_SST_IPC_ACPI) | ||
238 | { "80860F28", (unsigned long)&sst_acpi_baytrail_desc }, | 241 | { "80860F28", (unsigned long)&sst_acpi_baytrail_desc }, |
242 | #endif | ||
239 | { } | 243 | { } |
240 | }; | 244 | }; |
241 | MODULE_DEVICE_TABLE(acpi, sst_acpi_match); | 245 | MODULE_DEVICE_TABLE(acpi, sst_acpi_match); |
diff --git a/sound/soc/intel/common/sst-match-acpi.c b/sound/soc/intel/common/sst-match-acpi.c index dd077e116d25..3b4539d21492 100644 --- a/sound/soc/intel/common/sst-match-acpi.c +++ b/sound/soc/intel/common/sst-match-acpi.c | |||
@@ -41,3 +41,6 @@ struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines) | |||
41 | return NULL; | 41 | return NULL; |
42 | } | 42 | } |
43 | EXPORT_SYMBOL_GPL(sst_acpi_find_machine); | 43 | EXPORT_SYMBOL_GPL(sst_acpi_find_machine); |
44 | |||
45 | MODULE_LICENSE("GPL v2"); | ||
46 | MODULE_DESCRIPTION("Intel Common ACPI Match module"); | ||
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index de6dac496a0d..4629372d7c8e 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c | |||
@@ -688,14 +688,14 @@ int skl_unbind_modules(struct skl_sst *ctx, | |||
688 | /* get src queue index */ | 688 | /* get src queue index */ |
689 | src_index = skl_get_queue_index(src_mcfg->m_out_pin, dst_id, out_max); | 689 | src_index = skl_get_queue_index(src_mcfg->m_out_pin, dst_id, out_max); |
690 | if (src_index < 0) | 690 | if (src_index < 0) |
691 | return -EINVAL; | 691 | return 0; |
692 | 692 | ||
693 | msg.src_queue = src_index; | 693 | msg.src_queue = src_index; |
694 | 694 | ||
695 | /* get dst queue index */ | 695 | /* get dst queue index */ |
696 | dst_index = skl_get_queue_index(dst_mcfg->m_in_pin, src_id, in_max); | 696 | dst_index = skl_get_queue_index(dst_mcfg->m_in_pin, src_id, in_max); |
697 | if (dst_index < 0) | 697 | if (dst_index < 0) |
698 | return -EINVAL; | 698 | return 0; |
699 | 699 | ||
700 | msg.dst_queue = dst_index; | 700 | msg.dst_queue = dst_index; |
701 | 701 | ||
@@ -747,7 +747,7 @@ int skl_bind_modules(struct skl_sst *ctx, | |||
747 | 747 | ||
748 | skl_dump_bind_info(ctx, src_mcfg, dst_mcfg); | 748 | skl_dump_bind_info(ctx, src_mcfg, dst_mcfg); |
749 | 749 | ||
750 | if (src_mcfg->m_state < SKL_MODULE_INIT_DONE && | 750 | if (src_mcfg->m_state < SKL_MODULE_INIT_DONE || |
751 | dst_mcfg->m_state < SKL_MODULE_INIT_DONE) | 751 | dst_mcfg->m_state < SKL_MODULE_INIT_DONE) |
752 | return 0; | 752 | return 0; |
753 | 753 | ||
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index f3553258091a..b6e6b61d10ec 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c | |||
@@ -863,6 +863,7 @@ static int skl_get_delay_from_lpib(struct hdac_ext_bus *ebus, | |||
863 | else | 863 | else |
864 | delay += hstream->bufsize; | 864 | delay += hstream->bufsize; |
865 | } | 865 | } |
866 | delay = (hstream->bufsize == delay) ? 0 : delay; | ||
866 | 867 | ||
867 | if (delay >= hstream->period_bytes) { | 868 | if (delay >= hstream->period_bytes) { |
868 | dev_info(bus->dev, | 869 | dev_info(bus->dev, |
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 4624556f486d..a294fee431f0 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c | |||
@@ -54,12 +54,9 @@ static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w) | |||
54 | 54 | ||
55 | /* | 55 | /* |
56 | * Each pipelines needs memory to be allocated. Check if we have free memory | 56 | * Each pipelines needs memory to be allocated. Check if we have free memory |
57 | * from available pool. Then only add this to pool | 57 | * from available pool. |
58 | * This is freed when pipe is deleted | ||
59 | * Note: DSP does actual memory management we only keep track for complete | ||
60 | * pool | ||
61 | */ | 58 | */ |
62 | static bool skl_tplg_alloc_pipe_mem(struct skl *skl, | 59 | static bool skl_is_pipe_mem_avail(struct skl *skl, |
63 | struct skl_module_cfg *mconfig) | 60 | struct skl_module_cfg *mconfig) |
64 | { | 61 | { |
65 | struct skl_sst *ctx = skl->skl_sst; | 62 | struct skl_sst *ctx = skl->skl_sst; |
@@ -74,10 +71,20 @@ static bool skl_tplg_alloc_pipe_mem(struct skl *skl, | |||
74 | "exceeds ppl memory available %d mem %d\n", | 71 | "exceeds ppl memory available %d mem %d\n", |
75 | skl->resource.max_mem, skl->resource.mem); | 72 | skl->resource.max_mem, skl->resource.mem); |
76 | return false; | 73 | return false; |
74 | } else { | ||
75 | return true; | ||
77 | } | 76 | } |
77 | } | ||
78 | 78 | ||
79 | /* | ||
80 | * Add the mem to the mem pool. This is freed when pipe is deleted. | ||
81 | * Note: DSP does actual memory management we only keep track for complete | ||
82 | * pool | ||
83 | */ | ||
84 | static void skl_tplg_alloc_pipe_mem(struct skl *skl, | ||
85 | struct skl_module_cfg *mconfig) | ||
86 | { | ||
79 | skl->resource.mem += mconfig->pipe->memory_pages; | 87 | skl->resource.mem += mconfig->pipe->memory_pages; |
80 | return true; | ||
81 | } | 88 | } |
82 | 89 | ||
83 | /* | 90 | /* |
@@ -85,10 +92,10 @@ static bool skl_tplg_alloc_pipe_mem(struct skl *skl, | |||
85 | * quantified in MCPS (Million Clocks Per Second) required for module/pipe | 92 | * quantified in MCPS (Million Clocks Per Second) required for module/pipe |
86 | * | 93 | * |
87 | * Each pipelines needs mcps to be allocated. Check if we have mcps for this | 94 | * Each pipelines needs mcps to be allocated. Check if we have mcps for this |
88 | * pipe. This adds the mcps to driver counter | 95 | * pipe. |
89 | * This is removed on pipeline delete | ||
90 | */ | 96 | */ |
91 | static bool skl_tplg_alloc_pipe_mcps(struct skl *skl, | 97 | |
98 | static bool skl_is_pipe_mcps_avail(struct skl *skl, | ||
92 | struct skl_module_cfg *mconfig) | 99 | struct skl_module_cfg *mconfig) |
93 | { | 100 | { |
94 | struct skl_sst *ctx = skl->skl_sst; | 101 | struct skl_sst *ctx = skl->skl_sst; |
@@ -98,13 +105,18 @@ static bool skl_tplg_alloc_pipe_mcps(struct skl *skl, | |||
98 | "%s: module_id %d instance %d\n", __func__, | 105 | "%s: module_id %d instance %d\n", __func__, |
99 | mconfig->id.module_id, mconfig->id.instance_id); | 106 | mconfig->id.module_id, mconfig->id.instance_id); |
100 | dev_err(ctx->dev, | 107 | dev_err(ctx->dev, |
101 | "exceeds ppl memory available %d > mem %d\n", | 108 | "exceeds ppl mcps available %d > mem %d\n", |
102 | skl->resource.max_mcps, skl->resource.mcps); | 109 | skl->resource.max_mcps, skl->resource.mcps); |
103 | return false; | 110 | return false; |
111 | } else { | ||
112 | return true; | ||
104 | } | 113 | } |
114 | } | ||
105 | 115 | ||
116 | static void skl_tplg_alloc_pipe_mcps(struct skl *skl, | ||
117 | struct skl_module_cfg *mconfig) | ||
118 | { | ||
106 | skl->resource.mcps += mconfig->mcps; | 119 | skl->resource.mcps += mconfig->mcps; |
107 | return true; | ||
108 | } | 120 | } |
109 | 121 | ||
110 | /* | 122 | /* |
@@ -411,7 +423,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe) | |||
411 | mconfig = w->priv; | 423 | mconfig = w->priv; |
412 | 424 | ||
413 | /* check resource available */ | 425 | /* check resource available */ |
414 | if (!skl_tplg_alloc_pipe_mcps(skl, mconfig)) | 426 | if (!skl_is_pipe_mcps_avail(skl, mconfig)) |
415 | return -ENOMEM; | 427 | return -ENOMEM; |
416 | 428 | ||
417 | if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) { | 429 | if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) { |
@@ -435,6 +447,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe) | |||
435 | ret = skl_tplg_set_module_params(w, ctx); | 447 | ret = skl_tplg_set_module_params(w, ctx); |
436 | if (ret < 0) | 448 | if (ret < 0) |
437 | return ret; | 449 | return ret; |
450 | skl_tplg_alloc_pipe_mcps(skl, mconfig); | ||
438 | } | 451 | } |
439 | 452 | ||
440 | return 0; | 453 | return 0; |
@@ -477,10 +490,10 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w, | |||
477 | struct skl_sst *ctx = skl->skl_sst; | 490 | struct skl_sst *ctx = skl->skl_sst; |
478 | 491 | ||
479 | /* check resource available */ | 492 | /* check resource available */ |
480 | if (!skl_tplg_alloc_pipe_mcps(skl, mconfig)) | 493 | if (!skl_is_pipe_mcps_avail(skl, mconfig)) |
481 | return -EBUSY; | 494 | return -EBUSY; |
482 | 495 | ||
483 | if (!skl_tplg_alloc_pipe_mem(skl, mconfig)) | 496 | if (!skl_is_pipe_mem_avail(skl, mconfig)) |
484 | return -ENOMEM; | 497 | return -ENOMEM; |
485 | 498 | ||
486 | /* | 499 | /* |
@@ -526,11 +539,15 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w, | |||
526 | src_module = dst_module; | 539 | src_module = dst_module; |
527 | } | 540 | } |
528 | 541 | ||
542 | skl_tplg_alloc_pipe_mem(skl, mconfig); | ||
543 | skl_tplg_alloc_pipe_mcps(skl, mconfig); | ||
544 | |||
529 | return 0; | 545 | return 0; |
530 | } | 546 | } |
531 | 547 | ||
532 | static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, | 548 | static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, |
533 | struct skl *skl, | 549 | struct skl *skl, |
550 | struct snd_soc_dapm_widget *src_w, | ||
534 | struct skl_module_cfg *src_mconfig) | 551 | struct skl_module_cfg *src_mconfig) |
535 | { | 552 | { |
536 | struct snd_soc_dapm_path *p; | 553 | struct snd_soc_dapm_path *p; |
@@ -547,6 +564,10 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, | |||
547 | dev_dbg(ctx->dev, "%s: sink widget=%s\n", __func__, p->sink->name); | 564 | dev_dbg(ctx->dev, "%s: sink widget=%s\n", __func__, p->sink->name); |
548 | 565 | ||
549 | next_sink = p->sink; | 566 | next_sink = p->sink; |
567 | |||
568 | if (!is_skl_dsp_widget_type(p->sink)) | ||
569 | return skl_tplg_bind_sinks(p->sink, skl, src_w, src_mconfig); | ||
570 | |||
550 | /* | 571 | /* |
551 | * here we will check widgets in sink pipelines, so that | 572 | * here we will check widgets in sink pipelines, so that |
552 | * can be any widgets type and we are only interested if | 573 | * can be any widgets type and we are only interested if |
@@ -576,7 +597,7 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w, | |||
576 | } | 597 | } |
577 | 598 | ||
578 | if (!sink) | 599 | if (!sink) |
579 | return skl_tplg_bind_sinks(next_sink, skl, src_mconfig); | 600 | return skl_tplg_bind_sinks(next_sink, skl, src_w, src_mconfig); |
580 | 601 | ||
581 | return 0; | 602 | return 0; |
582 | } | 603 | } |
@@ -605,7 +626,7 @@ static int skl_tplg_pga_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w, | |||
605 | * if sink is not started, start sink pipe first, then start | 626 | * if sink is not started, start sink pipe first, then start |
606 | * this pipe | 627 | * this pipe |
607 | */ | 628 | */ |
608 | ret = skl_tplg_bind_sinks(w, skl, src_mconfig); | 629 | ret = skl_tplg_bind_sinks(w, skl, w, src_mconfig); |
609 | if (ret) | 630 | if (ret) |
610 | return ret; | 631 | return ret; |
611 | 632 | ||
@@ -773,10 +794,7 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w, | |||
773 | continue; | 794 | continue; |
774 | } | 795 | } |
775 | 796 | ||
776 | ret = skl_unbind_modules(ctx, src_module, dst_module); | 797 | skl_unbind_modules(ctx, src_module, dst_module); |
777 | if (ret < 0) | ||
778 | return ret; | ||
779 | |||
780 | src_module = dst_module; | 798 | src_module = dst_module; |
781 | } | 799 | } |
782 | 800 | ||
@@ -814,9 +832,6 @@ static int skl_tplg_pga_dapm_post_pmd_event(struct snd_soc_dapm_widget *w, | |||
814 | * This is a connecter and if path is found that means | 832 | * This is a connecter and if path is found that means |
815 | * unbind between source and sink has not happened yet | 833 | * unbind between source and sink has not happened yet |
816 | */ | 834 | */ |
817 | ret = skl_stop_pipe(ctx, sink_mconfig->pipe); | ||
818 | if (ret < 0) | ||
819 | return ret; | ||
820 | ret = skl_unbind_modules(ctx, src_mconfig, | 835 | ret = skl_unbind_modules(ctx, src_mconfig, |
821 | sink_mconfig); | 836 | sink_mconfig); |
822 | } | 837 | } |
@@ -842,6 +857,12 @@ static int skl_tplg_vmixer_event(struct snd_soc_dapm_widget *w, | |||
842 | case SND_SOC_DAPM_PRE_PMU: | 857 | case SND_SOC_DAPM_PRE_PMU: |
843 | return skl_tplg_mixer_dapm_pre_pmu_event(w, skl); | 858 | return skl_tplg_mixer_dapm_pre_pmu_event(w, skl); |
844 | 859 | ||
860 | case SND_SOC_DAPM_POST_PMU: | ||
861 | return skl_tplg_mixer_dapm_post_pmu_event(w, skl); | ||
862 | |||
863 | case SND_SOC_DAPM_PRE_PMD: | ||
864 | return skl_tplg_mixer_dapm_pre_pmd_event(w, skl); | ||
865 | |||
845 | case SND_SOC_DAPM_POST_PMD: | 866 | case SND_SOC_DAPM_POST_PMD: |
846 | return skl_tplg_mixer_dapm_post_pmd_event(w, skl); | 867 | return skl_tplg_mixer_dapm_post_pmd_event(w, skl); |
847 | } | 868 | } |
@@ -916,6 +937,13 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol, | |||
916 | skl_get_module_params(skl->skl_sst, (u32 *)bc->params, | 937 | skl_get_module_params(skl->skl_sst, (u32 *)bc->params, |
917 | bc->max, bc->param_id, mconfig); | 938 | bc->max, bc->param_id, mconfig); |
918 | 939 | ||
940 | /* decrement size for TLV header */ | ||
941 | size -= 2 * sizeof(u32); | ||
942 | |||
943 | /* check size as we don't want to send kernel data */ | ||
944 | if (size > bc->max) | ||
945 | size = bc->max; | ||
946 | |||
919 | if (bc->params) { | 947 | if (bc->params) { |
920 | if (copy_to_user(data, &bc->param_id, sizeof(u32))) | 948 | if (copy_to_user(data, &bc->param_id, sizeof(u32))) |
921 | return -EFAULT; | 949 | return -EFAULT; |
@@ -1510,6 +1538,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus) | |||
1510 | &skl_tplg_ops, fw, 0); | 1538 | &skl_tplg_ops, fw, 0); |
1511 | if (ret < 0) { | 1539 | if (ret < 0) { |
1512 | dev_err(bus->dev, "tplg component load failed%d\n", ret); | 1540 | dev_err(bus->dev, "tplg component load failed%d\n", ret); |
1541 | release_firmware(fw); | ||
1513 | return -EINVAL; | 1542 | return -EINVAL; |
1514 | } | 1543 | } |
1515 | 1544 | ||
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 443a15de94b5..092705e73db4 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -614,8 +614,6 @@ static int skl_probe(struct pci_dev *pci, | |||
614 | goto out_unregister; | 614 | goto out_unregister; |
615 | 615 | ||
616 | /*configure PM */ | 616 | /*configure PM */ |
617 | pm_runtime_set_autosuspend_delay(bus->dev, SKL_SUSPEND_DELAY); | ||
618 | pm_runtime_use_autosuspend(bus->dev); | ||
619 | pm_runtime_put_noidle(bus->dev); | 617 | pm_runtime_put_noidle(bus->dev); |
620 | pm_runtime_allow(bus->dev); | 618 | pm_runtime_allow(bus->dev); |
621 | 619 | ||