Skip to content

Commit ae79394

Browse files
committed
Merge tag 'sound-fix-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes that have been gathered before rc1, including a few regression fixes for the problem in the previous pull request" * tag 'sound-fix-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: gus: Fix repeated probe for ISA interwave card ALSA: gus: Fix repeated probes of snd_gus_create() ALSA: vx222: fix null-ptr-deref ASoC: rockchip: i2s: Fix concurrency between tx/rx ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select ASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX8ULP ALSA: usb-audio: Add registration quirk for JBL Quantum 800 ASoC: rt5682: fix headset background noise when S3 state ASoC: dt-bindings: mt8195: remove dependent headers in the example ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device" ASoC: audio-graph: respawn Platform Support ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency
2 parents d6c338a + 25fca8c commit ae79394

File tree

13 files changed

+111
-82
lines changed

13 files changed

+111
-82
lines changed

Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ properties:
2121
- fsl,imx8mn-rpmsg-audio
2222
- fsl,imx8mm-rpmsg-audio
2323
- fsl,imx8mp-rpmsg-audio
24+
- fsl,imx8ulp-rpmsg-audio
2425

2526
model:
2627
$ref: /schemas/types.yaml#/definitions/string

Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -130,36 +130,34 @@ additionalProperties: false
130130

131131
examples:
132132
- |
133-
#include <dt-bindings/clock/mt8195-clk.h>
134133
#include <dt-bindings/interrupt-controller/arm-gic.h>
135134
#include <dt-bindings/interrupt-controller/irq.h>
136-
#include <dt-bindings/power/mt8195-power.h>
137135
138136
afe: mt8195-afe-pcm@10890000 {
139137
compatible = "mediatek,mt8195-audio";
140138
reg = <0x10890000 0x10000>;
141139
interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH 0>;
142140
mediatek,topckgen = <&topckgen>;
143-
power-domains = <&spm MT8195_POWER_DOMAIN_AUDIO>;
141+
power-domains = <&spm 7>; //MT8195_POWER_DOMAIN_AUDIO
144142
clocks = <&clk26m>,
145-
<&topckgen CLK_TOP_APLL1>,
146-
<&topckgen CLK_TOP_APLL2>,
147-
<&topckgen CLK_TOP_APLL12_DIV0>,
148-
<&topckgen CLK_TOP_APLL12_DIV1>,
149-
<&topckgen CLK_TOP_APLL12_DIV2>,
150-
<&topckgen CLK_TOP_APLL12_DIV3>,
151-
<&topckgen CLK_TOP_APLL12_DIV9>,
152-
<&topckgen CLK_TOP_A1SYS_HP_SEL>,
153-
<&topckgen CLK_TOP_AUD_INTBUS_SEL>,
154-
<&topckgen CLK_TOP_AUDIO_H_SEL>,
155-
<&topckgen CLK_TOP_AUDIO_LOCAL_BUS_SEL>,
156-
<&topckgen CLK_TOP_DPTX_M_SEL>,
157-
<&topckgen CLK_TOP_I2SO1_M_SEL>,
158-
<&topckgen CLK_TOP_I2SO2_M_SEL>,
159-
<&topckgen CLK_TOP_I2SI1_M_SEL>,
160-
<&topckgen CLK_TOP_I2SI2_M_SEL>,
161-
<&infracfg_ao CLK_INFRA_AO_AUDIO_26M_B>,
162-
<&scp_adsp CLK_SCP_ADSP_AUDIODSP>;
143+
<&topckgen 163>, //CLK_TOP_APLL1
144+
<&topckgen 166>, //CLK_TOP_APLL2
145+
<&topckgen 233>, //CLK_TOP_APLL12_DIV0
146+
<&topckgen 234>, //CLK_TOP_APLL12_DIV1
147+
<&topckgen 235>, //CLK_TOP_APLL12_DIV2
148+
<&topckgen 236>, //CLK_TOP_APLL12_DIV3
149+
<&topckgen 238>, //CLK_TOP_APLL12_DIV9
150+
<&topckgen 100>, //CLK_TOP_A1SYS_HP_SEL
151+
<&topckgen 33>, //CLK_TOP_AUD_INTBUS_SEL
152+
<&topckgen 34>, //CLK_TOP_AUDIO_H_SEL
153+
<&topckgen 107>, //CLK_TOP_AUDIO_LOCAL_BUS_SEL
154+
<&topckgen 98>, //CLK_TOP_DPTX_M_SEL
155+
<&topckgen 94>, //CLK_TOP_I2SO1_M_SEL
156+
<&topckgen 95>, //CLK_TOP_I2SO2_M_SEL
157+
<&topckgen 96>, //CLK_TOP_I2SI1_M_SEL
158+
<&topckgen 97>, //CLK_TOP_I2SI2_M_SEL
159+
<&infracfg_ao 50>, //CLK_INFRA_AO_AUDIO_26M_B
160+
<&scp_adsp 0>; //CLK_SCP_ADSP_AUDIODSP
163161
clock-names = "clk26m",
164162
"apll1_ck",
165163
"apll2_ck",

sound/isa/gus/gus_main.c

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,24 @@ static void snd_gus_init_control(struct snd_gus_card *gus)
8787

8888
static int snd_gus_free(struct snd_gus_card *gus)
8989
{
90-
if (gus->gf1.res_port2) {
91-
snd_gf1_stop(gus);
92-
snd_gus_init_dma_irq(gus, 0);
90+
if (gus->gf1.res_port2 == NULL)
91+
goto __hw_end;
92+
snd_gf1_stop(gus);
93+
snd_gus_init_dma_irq(gus, 0);
94+
__hw_end:
95+
release_and_free_resource(gus->gf1.res_port1);
96+
release_and_free_resource(gus->gf1.res_port2);
97+
if (gus->gf1.irq >= 0)
98+
free_irq(gus->gf1.irq, (void *) gus);
99+
if (gus->gf1.dma1 >= 0) {
100+
disable_dma(gus->gf1.dma1);
101+
free_dma(gus->gf1.dma1);
93102
}
103+
if (!gus->equal_dma && gus->gf1.dma2 >= 0) {
104+
disable_dma(gus->gf1.dma2);
105+
free_dma(gus->gf1.dma2);
106+
}
107+
kfree(gus);
94108
return 0;
95109
}
96110

@@ -116,7 +130,7 @@ int snd_gus_create(struct snd_card *card,
116130
};
117131

118132
*rgus = NULL;
119-
gus = devm_kzalloc(card->dev, sizeof(*gus), GFP_KERNEL);
133+
gus = kzalloc(sizeof(*gus), GFP_KERNEL);
120134
if (gus == NULL)
121135
return -ENOMEM;
122136
spin_lock_init(&gus->reg_lock);
@@ -142,33 +156,35 @@ int snd_gus_create(struct snd_card *card,
142156
gus->gf1.reg_timerctrl = GUSP(gus, TIMERCNTRL);
143157
gus->gf1.reg_timerdata = GUSP(gus, TIMERDATA);
144158
/* allocate resources */
145-
gus->gf1.res_port1 = devm_request_region(card->dev, port, 16,
146-
"GUS GF1 (Adlib/SB)");
159+
gus->gf1.res_port1 = request_region(port, 16, "GUS GF1 (Adlib/SB)");
147160
if (!gus->gf1.res_port1) {
148161
snd_printk(KERN_ERR "gus: can't grab SB port 0x%lx\n", port);
162+
snd_gus_free(gus);
149163
return -EBUSY;
150164
}
151-
gus->gf1.res_port2 = devm_request_region(card->dev, port + 0x100, 12,
152-
"GUS GF1 (Synth)");
165+
gus->gf1.res_port2 = request_region(port + 0x100, 12, "GUS GF1 (Synth)");
153166
if (!gus->gf1.res_port2) {
154167
snd_printk(KERN_ERR "gus: can't grab synth port 0x%lx\n", port + 0x100);
168+
snd_gus_free(gus);
155169
return -EBUSY;
156170
}
157-
if (irq >= 0 && devm_request_irq(card->dev, irq, snd_gus_interrupt, 0,
158-
"GUS GF1", (void *) gus)) {
171+
if (irq >= 0 && request_irq(irq, snd_gus_interrupt, 0, "GUS GF1", (void *) gus)) {
159172
snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq);
173+
snd_gus_free(gus);
160174
return -EBUSY;
161175
}
162176
gus->gf1.irq = irq;
163177
card->sync_irq = irq;
164-
if (snd_devm_request_dma(card->dev, dma1, "GUS - 1")) {
178+
if (request_dma(dma1, "GUS - 1")) {
165179
snd_printk(KERN_ERR "gus: can't grab DMA1 %d\n", dma1);
180+
snd_gus_free(gus);
166181
return -EBUSY;
167182
}
168183
gus->gf1.dma1 = dma1;
169184
if (dma2 >= 0 && dma1 != dma2) {
170-
if (snd_devm_request_dma(card->dev, dma2, "GUS - 2")) {
185+
if (request_dma(dma2, "GUS - 2")) {
171186
snd_printk(KERN_ERR "gus: can't grab DMA2 %d\n", dma2);
187+
snd_gus_free(gus);
172188
return -EBUSY;
173189
}
174190
gus->gf1.dma2 = dma2;
@@ -193,8 +209,10 @@ int snd_gus_create(struct snd_card *card,
193209
gus->gf1.volume_ramp = 25;
194210
gus->gf1.smooth_pan = 1;
195211
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, gus, &ops);
196-
if (err < 0)
212+
if (err < 0) {
213+
snd_gus_free(gus);
197214
return err;
215+
}
198216
*rgus = gus;
199217
return 0;
200218
}

sound/isa/gus/interwave.c

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,19 @@ static int snd_interwave_card_new(struct device *pdev, int dev,
618618
return 0;
619619
}
620620

621-
static int snd_interwave_probe(struct snd_card *card, int dev)
621+
static int snd_interwave_probe_gus(struct snd_card *card, int dev,
622+
struct snd_gus_card **gusp)
623+
{
624+
return snd_gus_create(card, port[dev], -irq[dev], dma1[dev], dma2[dev],
625+
0, 32, pcm_channels[dev], effect[dev], gusp);
626+
}
627+
628+
static int snd_interwave_probe(struct snd_card *card, int dev,
629+
struct snd_gus_card *gus)
622630
{
623631
int xirq, xdma1, xdma2;
624632
struct snd_interwave *iwcard = card->private_data;
625633
struct snd_wss *wss;
626-
struct snd_gus_card *gus;
627634
#ifdef SNDRV_STB
628635
struct snd_i2c_bus *i2c_bus;
629636
#endif
@@ -634,14 +641,6 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
634641
xdma1 = dma1[dev];
635642
xdma2 = dma2[dev];
636643

637-
err = snd_gus_create(card,
638-
port[dev],
639-
-xirq, xdma1, xdma2,
640-
0, 32,
641-
pcm_channels[dev], effect[dev], &gus);
642-
if (err < 0)
643-
return err;
644-
645644
err = snd_interwave_detect(iwcard, gus, dev
646645
#ifdef SNDRV_STB
647646
, &i2c_bus
@@ -757,22 +756,6 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
757756
return 0;
758757
}
759758

760-
static int snd_interwave_isa_probe1(int dev, struct device *devptr)
761-
{
762-
struct snd_card *card;
763-
int err;
764-
765-
err = snd_interwave_card_new(devptr, dev, &card);
766-
if (err < 0)
767-
return err;
768-
769-
err = snd_interwave_probe(card, dev);
770-
if (err < 0)
771-
return err;
772-
dev_set_drvdata(devptr, card);
773-
return 0;
774-
}
775-
776759
static int snd_interwave_isa_match(struct device *pdev,
777760
unsigned int dev)
778761
{
@@ -788,6 +771,8 @@ static int snd_interwave_isa_match(struct device *pdev,
788771
static int snd_interwave_isa_probe(struct device *pdev,
789772
unsigned int dev)
790773
{
774+
struct snd_card *card;
775+
struct snd_gus_card *gus;
791776
int err;
792777
static const int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
793778
static const int possible_dmas[] = {0, 1, 3, 5, 6, 7, -1};
@@ -814,19 +799,31 @@ static int snd_interwave_isa_probe(struct device *pdev,
814799
}
815800
}
816801

802+
err = snd_interwave_card_new(pdev, dev, &card);
803+
if (err < 0)
804+
return err;
805+
817806
if (port[dev] != SNDRV_AUTO_PORT)
818-
return snd_interwave_isa_probe1(dev, pdev);
807+
err = snd_interwave_probe_gus(card, dev, &gus);
819808
else {
820809
static const long possible_ports[] = {0x210, 0x220, 0x230, 0x240, 0x250, 0x260};
821810
int i;
822811
for (i = 0; i < ARRAY_SIZE(possible_ports); i++) {
823812
port[dev] = possible_ports[i];
824-
err = snd_interwave_isa_probe1(dev, pdev);
813+
err = snd_interwave_probe_gus(card, dev, &gus);
825814
if (! err)
826815
return 0;
827816
}
828-
return err;
829817
}
818+
if (err < 0)
819+
return err;
820+
821+
err = snd_interwave_probe(card, dev, gus);
822+
if (err < 0)
823+
return err;
824+
825+
dev_set_drvdata(pdev, card);
826+
return 0;
830827
}
831828

832829
static struct isa_driver snd_interwave_driver = {
@@ -844,6 +841,7 @@ static int snd_interwave_pnp_detect(struct pnp_card_link *pcard,
844841
{
845842
static int dev;
846843
struct snd_card *card;
844+
struct snd_gus_card *gus;
847845
int res;
848846

849847
for ( ; dev < SNDRV_CARDS; dev++) {
@@ -860,7 +858,10 @@ static int snd_interwave_pnp_detect(struct pnp_card_link *pcard,
860858
res = snd_interwave_pnp(dev, card->private_data, pcard, pid);
861859
if (res < 0)
862860
return res;
863-
res = snd_interwave_probe(card, dev);
861+
res = snd_interwave_probe_gus(card, dev, &gus);
862+
if (res < 0)
863+
return res;
864+
res = snd_interwave_probe(card, dev, gus);
864865
if (res < 0)
865866
return res;
866867
pnp_set_card_drvdata(pcard, card);

sound/pci/vx222/vx222.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
137137
}
138138
chip->irq = pci->irq;
139139
card->sync_irq = chip->irq;
140+
*rchip = vx;
140141

141142
return 0;
142143
}

sound/soc/codecs/rt5682.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,9 +2942,6 @@ static int rt5682_suspend(struct snd_soc_component *component)
29422942
break;
29432943
}
29442944

2945-
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
2946-
RT5682_PWR_CBJ, 0);
2947-
29482945
/* enter SAR ADC power saving mode */
29492946
snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
29502947
RT5682_SAR_BUTT_DET_MASK | RT5682_SAR_BUTDET_MODE_MASK |

sound/soc/generic/audio-graph-card.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
285285
if (li->cpu) {
286286
struct snd_soc_card *card = simple_priv_to_card(priv);
287287
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
288+
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
288289
int is_single_links = 0;
289290

290291
/* Codec is dummy */
@@ -313,6 +314,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
313314
dai_link->no_pcm = 1;
314315

315316
asoc_simple_canonicalize_cpu(cpus, is_single_links);
317+
asoc_simple_canonicalize_platform(platforms, cpus);
316318
} else {
317319
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0);
318320
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
@@ -366,6 +368,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
366368
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
367369
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
368370
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
371+
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
369372
char dai_name[64];
370373
int ret, is_single_links = 0;
371374

@@ -383,6 +386,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
383386
"%s-%s", cpus->dai_name, codecs->dai_name);
384387

385388
asoc_simple_canonicalize_cpu(cpus, is_single_links);
389+
asoc_simple_canonicalize_platform(platforms, cpus);
386390

387391
ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
388392
if (ret < 0)
@@ -608,6 +612,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv,
608612

609613
li->num[li->link].cpus = 1;
610614
li->num[li->link].codecs = 1;
615+
li->num[li->link].platforms = 1;
611616

612617
li->link += 1; /* 1xCPU-Codec */
613618

@@ -630,6 +635,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
630635

631636
if (li->cpu) {
632637
li->num[li->link].cpus = 1;
638+
li->num[li->link].platforms = 1;
633639

634640
li->link++; /* 1xCPU-dummy */
635641
} else {

sound/soc/intel/boards/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
602602
select SND_SOC_DMIC
603603
select SND_SOC_INTEL_HDA_DSP_COMMON
604604
select SND_SOC_INTEL_SOF_MAXIM_COMMON
605-
select SND_SOC_SDW_MOCKUP
605+
imply SND_SOC_SDW_MOCKUP
606606
help
607607
Add support for Intel SoundWire-based platforms connected to
608608
MAX98373, RT700, RT711, RT1308 and RT715

sound/soc/mediatek/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ config SND_SOC_MT8192_MT6359_RT1015_RT5682
187187

188188
config SND_SOC_MT8195
189189
tristate "ASoC support for Mediatek MT8195 chip"
190+
depends on ARCH_MEDIATEK || COMPILE_TEST
190191
select SND_SOC_MEDIATEK
191192
help
192193
This adds ASoC platform driver support for Mediatek MT8195 chip
@@ -197,7 +198,7 @@ config SND_SOC_MT8195
197198
config SND_SOC_MT8195_MT6359_RT1019_RT5682
198199
tristate "ASoC Audio driver for MT8195 with MT6359 RT1019 RT5682 codec"
199200
depends on I2C
200-
depends on SND_SOC_MT8195
201+
depends on SND_SOC_MT8195 && MTK_PMIC_WRAP
201202
select SND_SOC_MT6359
202203
select SND_SOC_RT1015P
203204
select SND_SOC_RT5682_I2C

0 commit comments

Comments
 (0)