History

Merge tag 'sound-4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai: "Now we hit the usual ASoC-fix-flood in the middle of release. Most of the changes are trivial and device-specific, while one significant change is the fix for unbalanced of_graph_*() refcounts. This involved a change in the graph API itself that had been a bit messy" * tag 'sound-4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Fix speaker output from VAIO VPCL14M1R device property: Fix usecount for of_graph_get_port_parent() ASoC: rt5665: fix wrong register for bclk ratio control ASoC: Intel: Use MCLK instead of BLCK as the sysclock for RT5514 codec on kabylake platform ASoC: Intel: Enabling ASRC for RT5663 codec on kabylake platform ASoC: codecs: msm8916-analog: fix DIG_CLK_CTL_RXD3_CLK_EN define ASoC: Intel: Skylake: Fix missing sentinels in sst_acpi_mach ASoC: sh: hac: add missing "int ret" ASoC: samsung: odroid: Fix EPLL frequency values ASoC: sgtl5000: Use snd_soc_kcontrol_codec() ASoC: rt5665: fix GPIO6 pin function define ASoC: ux500: Restore platform DAI assignments ASoC: fix pcm-creation regression ASoC: do not close shared backend dailink ASoC: pxa: SND_PXA2XX_SOC should depend on HAS_DMA ASoC: Intel: Skylake: Fix default dma_buffer_size ASoC: rt5663: Update the HW default values based on the shipping version ASoC: imx-ssi: add check on platform_get_irq return value

Linus Torvalds committed 9 years ago

Commit a64c40e2 parents 83b89ea 5ef26e921 files · +93 −103Browse files

Unified · Split

21 files
  1. drivers/of/property.c +15 −2
  2. include/sound/soc.h +0 −6
  3. sound/pci/hda/patch_realtek.c +1 −0
  4. sound/soc/codecs/msm8916-wcd-analog.c +1 −1
  5. sound/soc/codecs/rt5663.c +9 −9
  6. sound/soc/codecs/rt5665.c +2 −2
  7. sound/soc/codecs/rt5665.h +2 −2
  8. sound/soc/codecs/sgtl5000.c +2 −2
  9. sound/soc/fsl/imx-ssi.c +4 −0
  10. sound/soc/generic/audio-graph-card.c +5 −5
  11. sound/soc/generic/audio-graph-scu-card.c +9 −6
  12. sound/soc/generic/simple-card-utils.c +3 −5
  13. sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +5 −12
  14. sound/soc/intel/skylake/skl-messages.c +8 −0
  15. sound/soc/intel/skylake/skl.c +2 −0
  16. sound/soc/pxa/Kconfig +1 −0
  17. sound/soc/samsung/odroid.c +3 −3
  18. sound/soc/sh/hac.c +2 −0
  19. sound/soc/soc-core.c +2 −25
  20. sound/soc/soc-pcm.c +13 −23
  21. sound/soc/ux500/mop500.c +4 −0
drivers/of/property.c+15−2
@@ -708,6 +708,15 @@ struct device_node *of_graph_get_port_parent(struct device_node *node) · 707 unmodified lines
708708 {
709709 unsigned int depth;
710710
711+ if (!node)
712+ return NULL;
713+
714+ /*
715+ * Preserve usecount for passed in node as of_get_next_parent()
716+ * will do of_node_put() on it.
717+ */
718+ of_node_get(node);
719+
711720 /* Walk 3 levels up only if there is 'ports' node. */
712721 for (depth = 3; depth && node; depth--) {
713722 node = of_get_next_parent(node);
@@ -728,12 +737,16 @@ EXPORT_SYMBOL(of_graph_get_port_parent); · 14 unmodified lines
728737 struct device_node *of_graph_get_remote_port_parent(
729738 const struct device_node *node)
730739 {
731− struct device_node *np;
740+ struct device_node *np, *pp;
732741
733742 /* Get remote endpoint node. */
734743 np = of_graph_get_remote_endpoint(node);
735744
736− return of_graph_get_port_parent(np);
745+ pp = of_graph_get_port_parent(np);
746+
747+ of_node_put(np);
748+
749+ return pp;
737750 }
738751 EXPORT_SYMBOL(of_graph_get_remote_port_parent);
739752
include/sound/soc.h+0−6
@@ -795,10 +795,6 @@ struct snd_soc_component_driver { · 794 unmodified lines
795795 int (*suspend)(struct snd_soc_component *);
796796 int (*resume)(struct snd_soc_component *);
797797
798− /* pcm creation and destruction */
799− int (*pcm_new)(struct snd_soc_pcm_runtime *);
800− void (*pcm_free)(struct snd_pcm *);
801−
802798 /* DT */
803799 int (*of_xlate_dai_name)(struct snd_soc_component *component,
804800 struct of_phandle_args *args,
@@ -874,8 +870,6 @@ struct snd_soc_component { · 69 unmodified lines
874870 void (*remove)(struct snd_soc_component *);
875871 int (*suspend)(struct snd_soc_component *);
876872 int (*resume)(struct snd_soc_component *);
877− int (*pcm_new)(struct snd_soc_pcm_runtime *);
878− void (*pcm_free)(struct snd_pcm *);
879873
880874 /* machine specific init */
881875 int (*init)(struct snd_soc_component *component);
sound/pci/hda/patch_realtek.c+1−0
@@ -2296,6 +2296,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { · 2295 unmodified lines
22962296 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
22972297 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
22982298 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2299+ SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
22992300 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
23002301 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
23012302
sound/soc/codecs/msm8916-wcd-analog.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #define CDC_D_CDC_DIG_CLK_CTL (0xf04A)
3737 #define DIG_CLK_CTL_RXD1_CLK_EN BIT(0)
3838 #define DIG_CLK_CTL_RXD2_CLK_EN BIT(1)
39−#define DIG_CLK_CTL_RXD3_CLK_EN BIT(3)
39+#define DIG_CLK_CTL_RXD3_CLK_EN BIT(2)
4040 #define DIG_CLK_CTL_TXD_CLK_EN BIT(4)
4141 #define DIG_CLK_CTL_NCP_CLK_EN_MASK BIT(6)
4242 #define DIG_CLK_CTL_NCP_CLK_EN BIT(6)
sound/soc/codecs/rt5663.c+9−9
@@ -466,7 +466,7 @@ static const struct reg_default rt5663_reg[] = { · 465 unmodified lines
466466 { 0x0006, 0x1000 },
467467 { 0x000a, 0x0000 },
468468 { 0x0010, 0x000f },
469− { 0x0015, 0x42c1 },
469+ { 0x0015, 0x42f1 },
470470 { 0x0016, 0x0000 },
471471 { 0x0018, 0x000b },
472472 { 0x0019, 0xafaf },
@@ -509,7 +509,7 @@ static const struct reg_default rt5663_reg[] = { · 36 unmodified lines
509509 { 0x008a, 0x0000 },
510510 { 0x008b, 0x0000 },
511511 { 0x008c, 0x0003 },
512− { 0x008e, 0x0004 },
512+ { 0x008e, 0x0008 },
513513 { 0x008f, 0x1000 },
514514 { 0x0090, 0x0646 },
515515 { 0x0091, 0x0e3e },
@@ -520,7 +520,7 @@ static const struct reg_default rt5663_reg[] = { · 4 unmodified lines
520520 { 0x0098, 0x0000 },
521521 { 0x009a, 0x0000 },
522522 { 0x009f, 0x0000 },
523− { 0x00ae, 0x2000 },
523+ { 0x00ae, 0x6000 },
524524 { 0x00af, 0x0000 },
525525 { 0x00b6, 0x0000 },
526526 { 0x00b7, 0x0000 },
@@ -538,7 +538,7 @@ static const struct reg_default rt5663_reg[] = { · 11 unmodified lines
538538 { 0x00d9, 0x08f9 },
539539 { 0x00db, 0x0008 },
540540 { 0x00dc, 0x00c0 },
541− { 0x00dd, 0x6724 },
541+ { 0x00dd, 0x6729 },
542542 { 0x00de, 0x3131 },
543543 { 0x00df, 0x0008 },
544544 { 0x00e0, 0x4000 },
@@ -578,7 +578,7 @@ static const struct reg_default rt5663_reg[] = { · 33 unmodified lines
578578 { 0x0116, 0x0000 },
579579 { 0x0117, 0x0f00 },
580580 { 0x0118, 0x0006 },
581− { 0x0125, 0x2224 },
581+ { 0x0125, 0x2424 },
582582 { 0x0126, 0x5550 },
583583 { 0x0127, 0x0400 },
584584 { 0x0128, 0x7711 },
@@ -596,8 +596,8 @@ static const struct reg_default rt5663_reg[] = { · 11 unmodified lines
596596 { 0x0145, 0x0002 },
597597 { 0x0146, 0x0000 },
598598 { 0x0160, 0x0e80 },
599− { 0x0161, 0x0020 },
600− { 0x0162, 0x0080 },
599+ { 0x0161, 0x0080 },
600+ { 0x0162, 0x0200 },
601601 { 0x0163, 0x0800 },
602602 { 0x0164, 0x0000 },
603603 { 0x0165, 0x0000 },
@@ -676,8 +676,8 @@ static const struct reg_default rt5663_reg[] = { · 72 unmodified lines
676676 { 0x0251, 0x0000 },
677677 { 0x0252, 0x028a },
678678 { 0x02fa, 0x0000 },
679− { 0x02fb, 0x0000 },
680− { 0x02fc, 0x0000 },
679+ { 0x02fb, 0x00a4 },
680+ { 0x02fc, 0x0300 },
681681 { 0x0300, 0x0000 },
682682 { 0x03d0, 0x0000 },
683683 { 0x03d1, 0x0000 },
sound/soc/codecs/rt5665.c+2−2
@@ -4368,12 +4368,12 @@ static int rt5665_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) · 4367 unmodified lines
43684368 switch (dai->id) {
43694369 case RT5665_AIF2_1:
43704370 case RT5665_AIF2_2:
4371− snd_soc_update_bits(codec, RT5665_ADDA_CLK_1,
4371+ snd_soc_update_bits(codec, RT5665_ADDA_CLK_2,
43724372 RT5665_I2S_BCLK_MS2_MASK,
43734373 RT5665_I2S_BCLK_MS2_64);
43744374 break;
43754375 case RT5665_AIF3:
4376− snd_soc_update_bits(codec, RT5665_ADDA_CLK_1,
4376+ snd_soc_update_bits(codec, RT5665_ADDA_CLK_2,
43774377 RT5665_I2S_BCLK_MS3_MASK,
43784378 RT5665_I2S_BCLK_MS3_64);
43794379 break;
sound/soc/codecs/rt5665.h+2−2
@@ -1692,8 +1692,8 @@ · 1691 unmodified lines
16921692 #define RT5665_GP6_PIN_MASK (0x3 << 5)
16931693 #define RT5665_GP6_PIN_SFT 5
16941694 #define RT5665_GP6_PIN_GPIO6 (0x0 << 5)
1695−#define RT5665_GP6_PIN_BCLK3 (0x0 << 5)
1696−#define RT5665_GP6_PIN_PDM_SCL (0x1 << 5)
1695+#define RT5665_GP6_PIN_BCLK3 (0x1 << 5)
1696+#define RT5665_GP6_PIN_PDM_SCL (0x2 << 5)
16971697 #define RT5665_GP7_PIN_MASK (0x3 << 3)
16981698 #define RT5665_GP7_PIN_SFT 3
16991699 #define RT5665_GP7_PIN_GPIO7 (0x0 << 3)
sound/soc/codecs/sgtl5000.c+2−2
@@ -409,7 +409,7 @@ static int dac_put_volsw(struct snd_kcontrol *kcontrol, · 408 unmodified lines
409409 static int avc_get_threshold(struct snd_kcontrol *kcontrol,
410410 struct snd_ctl_elem_value *ucontrol)
411411 {
412− struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
412+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
413413 int db, i;
414414 u16 reg = snd_soc_read(codec, SGTL5000_DAP_AVC_THRESHOLD);
415415
@@ -442,7 +442,7 @@ static int avc_get_threshold(struct snd_kcontrol *kcontrol, · 26 unmodified lines
442442 static int avc_put_threshold(struct snd_kcontrol *kcontrol,
443443 struct snd_ctl_elem_value *ucontrol)
444444 {
445− struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
445+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
446446 int db;
447447 u16 reg;
448448
sound/soc/fsl/imx-ssi.c+4−0
@@ -527,6 +527,10 @@ static int imx_ssi_probe(struct platform_device *pdev) · 526 unmodified lines
527527 }
528528
529529 ssi->irq = platform_get_irq(pdev, 0);
530+ if (ssi->irq < 0) {
531+ dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
532+ return ssi->irq;
533+ }
530534
531535 ssi->clk = devm_clk_get(&pdev->dev, NULL);
532536 if (IS_ERR(ssi->clk)) {
sound/soc/generic/audio-graph-card.c+5−5
@@ -224,9 +224,11 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) · 223 unmodified lines
224224
225225 of_for_each_phandle(&it, rc, node, "dais", NULL, 0) {
226226 ret = asoc_graph_card_dai_link_of(it.node, priv, idx++);
227− of_node_put(it.node);
228− if (ret < 0)
227+ if (ret < 0) {
228+ of_node_put(it.node);
229+
229230 return ret;
231+ }
230232 }
231233
232234 return asoc_simple_card_parse_card_name(card, NULL);
@@ -239,10 +241,8 @@ static int asoc_graph_get_dais_count(struct device *dev) · 6 unmodified lines
239241 int count = 0;
240242 int rc;
241243
242− of_for_each_phandle(&it, rc, node, "dais", NULL, 0) {
244+ of_for_each_phandle(&it, rc, node, "dais", NULL, 0)
243245 count++;
244− of_node_put(it.node);
245− }
246246
247247 return count;
248248 }
sound/soc/generic/audio-graph-scu-card.c+9−6
@@ -215,7 +215,6 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) · 214 unmodified lines
215215 codec_ep = of_graph_get_remote_endpoint(cpu_ep);
216216 rcpu_ep = of_graph_get_remote_endpoint(codec_ep);
217217
218− of_node_put(cpu_port);
219218 of_node_put(cpu_ep);
220219 of_node_put(codec_ep);
221220 of_node_put(rcpu_ep);
@@ -232,8 +231,10 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) · 10 unmodified lines
232231
233232 ret = asoc_simple_card_parse_daifmt(dev, cpu_ep, codec_ep,
234233 NULL, &daifmt);
235− if (ret < 0)
234+ if (ret < 0) {
235+ of_node_put(cpu_port);
236236 goto parse_of_err;
237+ }
237238 }
238239
239240 dai_idx = 0;
@@ -250,7 +251,6 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) · 10 unmodified lines
250251 codec_ep = of_graph_get_remote_endpoint(cpu_ep);
251252 codec_port = of_graph_get_port_parent(codec_ep);
252253
253− of_node_put(cpu_port);
254254 of_node_put(cpu_ep);
255255 of_node_put(codec_ep);
256256 of_node_put(codec_port);
@@ -266,13 +266,17 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) · 9 unmodified lines
266266
267267 /* Back-End (= Codec) */
268268 ret = asoc_graph_card_dai_link_of(codec_ep, priv, daifmt, dai_idx++, 0);
269− if (ret < 0)
269+ if (ret < 0) {
270+ of_node_put(cpu_port);
270271 goto parse_of_err;
272+ }
271273 } else {
272274 /* Front-End (= CPU) */
273275 ret = asoc_graph_card_dai_link_of(cpu_ep, priv, daifmt, dai_idx++, 1);
274− if (ret < 0)
276+ if (ret < 0) {
277+ of_node_put(cpu_port);
275278 goto parse_of_err;
279+ }
276280 }
277281 }
278282 }
@@ -306,7 +310,6 @@ static int asoc_graph_get_dais_count(struct device *dev) · 27 unmodified lines
306310 codec_ep = of_graph_get_remote_endpoint(cpu_ep);
307311 codec_port = of_graph_get_port_parent(codec_ep);
308312
309− of_node_put(cpu_port);
310313 of_node_put(cpu_ep);
311314 of_node_put(codec_ep);
312315 of_node_put(codec_port);
sound/soc/generic/simple-card-utils.c+3−5
@@ -263,6 +263,9 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep) · 262 unmodified lines
263263 id = i;
264264 i++;
265265 }
266+
267+ of_node_put(node);
268+
266269 if (id < 0)
267270 return -ENODEV;
268271
@@ -282,11 +285,6 @@ int asoc_simple_card_parse_graph_dai(struct device_node *ep, · 13 unmodified lines
282285 if (!dai_name)
283286 return 0;
284287
285− /*
286− * of_graph_get_port_parent() will call
287− * of_node_put(). So, call of_node_get() here
288− */
289− of_node_get(ep);
290288 node = of_graph_get_port_parent(ep);
291289
292290 /* Get dai->name */
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c+5−12
@@ -319,7 +319,9 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream, · 318 unmodified lines
319319 int ret;
320320
321321 /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
322− rt5663_sel_asrc_clk_src(codec_dai->codec, RT5663_DA_STEREO_FILTER, 1);
322+ rt5663_sel_asrc_clk_src(codec_dai->codec,
323+ RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
324+ RT5663_CLK_SEL_I2S1_ASRC);
323325
324326 ret = snd_soc_dai_set_sysclk(codec_dai,
325327 RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);
@@ -349,19 +351,10 @@ static int kabylake_ssp0_hw_params(struct snd_pcm_substream *substream, · 23 unmodified lines
349351 return ret;
350352 }
351353
352− ret = snd_soc_dai_set_pll(codec_dai, 0,
353− RT5514_PLL1_S_BCLK, RT5514_AIF1_BCLK_FREQ,
354− RT5514_AIF1_SYSCLK_FREQ);
355− if (ret < 0) {
356− dev_err(rtd->dev, "set bclk err: %d\n", ret);
357− return ret;
358− }
359−
360354 ret = snd_soc_dai_set_sysclk(codec_dai,
361− RT5514_SCLK_S_PLL1, RT5514_AIF1_SYSCLK_FREQ,
362− SND_SOC_CLOCK_IN);
355+ RT5514_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);
363356 if (ret < 0) {
364− dev_err(rtd->dev, "set sclk err: %d\n", ret);
357+ dev_err(rtd->dev, "set sysclk err: %d\n", ret);
365358 return ret;
366359 }
367360 }
sound/soc/intel/skylake/skl-messages.c+8−0
@@ -540,6 +540,14 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, · 539 unmodified lines
540540 cpr_mconfig->gtw_cfg.dma_buffer_size =
541541 mconfig->dma_buffer_size * dma_io_buf;
542542
543+ /* fallback to 2ms default value */
544+ if (!cpr_mconfig->gtw_cfg.dma_buffer_size) {
545+ if (mconfig->hw_conn_type == SKL_CONN_SOURCE)
546+ cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs;
547+ else
548+ cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->ibs;
549+ }
550+
543551 cpr_mconfig->cpr_feature_mask = 0;
544552 cpr_mconfig->gtw_cfg.config_length = 0;
545553
sound/soc/intel/skylake/skl.c+2−0
@@ -941,6 +941,7 @@ static struct sst_acpi_mach sst_bxtp_devdata[] = { · 940 unmodified lines
941941 .machine_quirk = sst_acpi_codec_list,
942942 .quirk_data = &bxt_codecs,
943943 },
944+ {}
944945 };
945946
946947 static struct sst_acpi_mach sst_kbl_devdata[] = {
@@ -991,6 +992,7 @@ static struct sst_acpi_mach sst_glk_devdata[] = { · 44 unmodified lines
991992 .drv_name = "glk_alc298s_i2s",
992993 .fw_filename = "intel/dsp_fw_glk.bin",
993994 },
995+ {}
994996 };
995997
996998 /* PCI IDs */
sound/soc/pxa/Kconfig+1−0
@@ -1,6 +1,7 @@
11 config SND_PXA2XX_SOC
22 tristate "SoC Audio for the Intel PXA2xx chip"
33 depends on ARCH_PXA || COMPILE_TEST
4+ depends on HAS_DMA
45 select SND_PXA2XX_LIB
56 help
67 Say Y or M if you want to add support for codecs attached to
sound/soc/samsung/odroid.c+3−3
@@ -42,17 +42,17 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream, · 41 unmodified lines
4242 switch (params_rate(params)) {
4343 case 32000:
4444 case 64000:
45− pll_freq = 131072000U;
45+ pll_freq = 131072006U;
4646 break;
4747 case 44100:
4848 case 88200:
4949 case 176400:
50− pll_freq = 180633600U;
50+ pll_freq = 180633609U;
5151 break;
5252 case 48000:
5353 case 96000:
5454 case 192000:
55− pll_freq = 196608000U;
55+ pll_freq = 196608001U;
5656 break;
5757 default:
5858 return -EINVAL;
sound/soc/sh/hac.c+2−0
@@ -315,6 +315,8 @@ static const struct snd_soc_component_driver sh4_hac_component = { · 314 unmodified lines
315315
316316 static int hac_soc_platform_probe(struct platform_device *pdev)
317317 {
318+ int ret;
319+
318320 ret = snd_soc_set_ac97_ops(&hac_ac97_ops);
319321 if (ret != 0)
320322 return ret;
sound/soc/soc-core.c+2−25
@@ -3171,8 +3171,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, · 3170 unmodified lines
31713171 component->remove = component->driver->remove;
31723172 component->suspend = component->driver->suspend;
31733173 component->resume = component->driver->resume;
3174− component->pcm_new = component->driver->pcm_new;
3175− component->pcm_free = component->driver->pcm_free;
31763174
31773175 dapm = &component->dapm;
31783176 dapm->dev = dev;
@@ -3360,25 +3358,6 @@ static void snd_soc_platform_drv_remove(struct snd_soc_component *component) · 181 unmodified lines
33603358 platform->driver->remove(platform);
33613359 }
33623360
3363−static int snd_soc_platform_drv_pcm_new(struct snd_soc_pcm_runtime *rtd)
3364−{
3365− struct snd_soc_platform *platform = rtd->platform;
3366−
3367− if (platform->driver->pcm_new)
3368− return platform->driver->pcm_new(rtd);
3369− else
3370− return 0;
3371−}
3372−
3373−static void snd_soc_platform_drv_pcm_free(struct snd_pcm *pcm)
3374−{
3375− struct snd_soc_pcm_runtime *rtd = pcm->private_data;
3376− struct snd_soc_platform *platform = rtd->platform;
3377−
3378− if (platform->driver->pcm_free)
3379− platform->driver->pcm_free(pcm);
3380−}
3381−
33823361 /**
33833362 * snd_soc_add_platform - Add a platform to the ASoC core
33843363 * @dev: The parent device for the platform
@@ -3402,10 +3381,6 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform, · 17 unmodified lines
34023381 platform->component.probe = snd_soc_platform_drv_probe;
34033382 if (platform_drv->remove)
34043383 platform->component.remove = snd_soc_platform_drv_remove;
3405− if (platform_drv->pcm_new)
3406− platform->component.pcm_new = snd_soc_platform_drv_pcm_new;
3407− if (platform_drv->pcm_free)
3408− platform->component.pcm_free = snd_soc_platform_drv_pcm_free;
34093384
34103385 #ifdef CONFIG_DEBUG_FS
34113386 platform->component.debugfs_prefix = "platform";
@@ -4113,6 +4088,8 @@ int snd_soc_get_dai_id(struct device_node *ep) · 701 unmodified lines
41134088 }
41144089 mutex_unlock(&client_mutex);
41154090
4091+ of_node_put(node);
4092+
41164093 return ret;
41174094 }
41184095 EXPORT_SYMBOL_GPL(snd_soc_get_dai_id);
sound/soc/soc-pcm.c+13−23
@@ -181,6 +181,10 @@ int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, · 180 unmodified lines
181181 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n",
182182 be->dai_link->name, event, dir);
183183
184+ if ((event == SND_SOC_DAPM_STREAM_STOP) &&
185+ (be->dpcm[dir].users >= 1))
186+ continue;
187+
184188 snd_soc_dapm_stream_event(be, dir, event);
185189 }
186190
@@ -2628,25 +2632,12 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream) · 2441 unmodified lines
26282632 return ret;
26292633 }
26302634
2631−static void soc_pcm_free(struct snd_pcm *pcm)
2632−{
2633− struct snd_soc_pcm_runtime *rtd = pcm->private_data;
2634− struct snd_soc_component *component;
2635−
2636− list_for_each_entry(component, &rtd->card->component_dev_list,
2637− card_list) {
2638− if (component->pcm_free)
2639− component->pcm_free(pcm);
2640− }
2641−}
2642−
26432635 /* create a new pcm */
26442636 int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
26452637 {
26462638 struct snd_soc_platform *platform = rtd->platform;
26472639 struct snd_soc_dai *codec_dai;
26482640 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
2649− struct snd_soc_component *component;
26502641 struct snd_pcm *pcm;
26512642 char new_name[64];
26522643 int ret = 0, playback = 0, capture = 0;
@@ -2756,18 +2747,17 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) · 103 unmodified lines
27562747 if (capture)
27572748 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops);
27582749
2759− list_for_each_entry(component, &rtd->card->component_dev_list, card_list) {
2760− if (component->pcm_new) {
2761− ret = component->pcm_new(rtd);
2762− if (ret < 0) {
2763− dev_err(component->dev,
2764− "ASoC: pcm constructor failed: %d\n",
2765− ret);
2766− return ret;
2767− }
2750+ if (platform->driver->pcm_new) {
2751+ ret = platform->driver->pcm_new(rtd);
2752+ if (ret < 0) {
2753+ dev_err(platform->dev,
2754+ "ASoC: pcm constructor failed: %d\n",
2755+ ret);
2756+ return ret;
27682757 }
27692758 }
2770− pcm->private_free = soc_pcm_free;
2759+
2760+ pcm->private_free = platform->driver->pcm_free;
27712761 out:
27722762 dev_info(rtd->card->dev, "%s <-> %s mapping ok\n",
27732763 (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name,
sound/soc/ux500/mop500.c+4−0
@@ -33,6 +33,7 @@ static struct snd_soc_dai_link mop500_dai_links[] = { · 32 unmodified lines
3333 .stream_name = "ab8500_0",
3434 .cpu_dai_name = "ux500-msp-i2s.1",
3535 .codec_dai_name = "ab8500-codec-dai.0",
36+ .platform_name = "ux500-msp-i2s.1",
3637 .codec_name = "ab8500-codec.0",
3738 .init = mop500_ab8500_machine_init,
3839 .ops = mop500_ab8500_ops,
@@ -42,6 +43,7 @@ static struct snd_soc_dai_link mop500_dai_links[] = { · 3 unmodified lines
4243 .stream_name = "ab8500_1",
4344 .cpu_dai_name = "ux500-msp-i2s.3",
4445 .codec_dai_name = "ab8500-codec-dai.1",
46+ .platform_name = "ux500-msp-i2s.3",
4547 .codec_name = "ab8500-codec.0",
4648 .init = NULL,
4749 .ops = mop500_ab8500_ops,
@@ -85,6 +87,8 @@ static int mop500_of_probe(struct platform_device *pdev, · 37 unmodified lines
8587 for (i = 0; i < 2; i++) {
8688 mop500_dai_links[i].cpu_of_node = msp_np[i];
8789 mop500_dai_links[i].cpu_dai_name = NULL;
90+ mop500_dai_links[i].platform_of_node = msp_np[i];
91+ mop500_dai_links[i].platform_name = NULL;
8892 mop500_dai_links[i].codec_of_node = codec_np;
8993 mop500_dai_links[i].codec_name = NULL;
9094 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t