Skip to content

Commit 36e7a96

Browse files
committed
Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull second round of sound fixes from Takashi Iwai: "Yet a few more fixes popped up in this week. The biggest change here is the addition of pinctrl support for Atmel, which turned out to be almost mandatory to make things working. The rest are a few fixes for M-Audio usb-audio device and a fix for regression of HD-audio HDMI codecs with alsactl in the recent kernel." * tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/hdmi - Work around "alsactl restore" errors ALSA: usb-audio: selector map for M-Audio FT C400 ALSA: usb-audio: M-Audio FT C400 skip packet quirk ALSA: usb-audio: correct M-Audio C400 clock source quirk ALSA: usb - fix race in creation of M-Audio Fast track pro driver ASoC: atmel-ssc: add pinctrl selection to driver ARM: at91/dts: add pinctrl support for SSC peripheral
2 parents ce0f706 + 6f54c36 commit 36e7a96

File tree

10 files changed

+181
-13
lines changed

10 files changed

+181
-13
lines changed

arch/arm/boot/dts/at91sam9260.dtsi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,22 @@
306306
};
307307
};
308308

309+
ssc0 {
310+
pinctrl_ssc0_tx: ssc0_tx-0 {
311+
atmel,pins =
312+
<1 16 0x1 0x0 /* PB16 periph A */
313+
1 17 0x1 0x0 /* PB17 periph A */
314+
1 18 0x1 0x0>; /* PB18 periph A */
315+
};
316+
317+
pinctrl_ssc0_rx: ssc0_rx-0 {
318+
atmel,pins =
319+
<1 19 0x1 0x0 /* PB19 periph A */
320+
1 20 0x1 0x0 /* PB20 periph A */
321+
1 21 0x1 0x0>; /* PB21 periph A */
322+
};
323+
};
324+
309325
pioA: gpio@fffff400 {
310326
compatible = "atmel,at91rm9200-gpio";
311327
reg = <0xfffff400 0x200>;
@@ -450,6 +466,8 @@
450466
compatible = "atmel,at91rm9200-ssc";
451467
reg = <0xfffbc000 0x4000>;
452468
interrupts = <14 4 5>;
469+
pinctrl-names = "default";
470+
pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
453471
status = "disabled";
454472
};
455473

arch/arm/boot/dts/at91sam9263.dtsi

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,38 @@
271271
};
272272
};
273273

274+
ssc0 {
275+
pinctrl_ssc0_tx: ssc0_tx-0 {
276+
atmel,pins =
277+
<1 0 0x2 0x0 /* PB0 periph B */
278+
1 1 0x2 0x0 /* PB1 periph B */
279+
1 2 0x2 0x0>; /* PB2 periph B */
280+
};
281+
282+
pinctrl_ssc0_rx: ssc0_rx-0 {
283+
atmel,pins =
284+
<1 3 0x2 0x0 /* PB3 periph B */
285+
1 4 0x2 0x0 /* PB4 periph B */
286+
1 5 0x2 0x0>; /* PB5 periph B */
287+
};
288+
};
289+
290+
ssc1 {
291+
pinctrl_ssc1_tx: ssc1_tx-0 {
292+
atmel,pins =
293+
<1 6 0x1 0x0 /* PB6 periph A */
294+
1 7 0x1 0x0 /* PB7 periph A */
295+
1 8 0x1 0x0>; /* PB8 periph A */
296+
};
297+
298+
pinctrl_ssc1_rx: ssc1_rx-0 {
299+
atmel,pins =
300+
<1 9 0x1 0x0 /* PB9 periph A */
301+
1 10 0x1 0x0 /* PB10 periph A */
302+
1 11 0x1 0x0>; /* PB11 periph A */
303+
};
304+
};
305+
274306
pioA: gpio@fffff200 {
275307
compatible = "atmel,at91rm9200-gpio";
276308
reg = <0xfffff200 0x200>;
@@ -368,13 +400,17 @@
368400
compatible = "atmel,at91rm9200-ssc";
369401
reg = <0xfff98000 0x4000>;
370402
interrupts = <16 4 5>;
403+
pinctrl-names = "default";
404+
pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
371405
status = "disabled";
372406
};
373407

374408
ssc1: ssc@fff9c000 {
375409
compatible = "atmel,at91rm9200-ssc";
376410
reg = <0xfff9c000 0x4000>;
377411
interrupts = <17 4 5>;
412+
pinctrl-names = "default";
413+
pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
378414
status = "disabled";
379415
};
380416

arch/arm/boot/dts/at91sam9g45.dtsi

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,38 @@
290290
};
291291
};
292292

293+
ssc0 {
294+
pinctrl_ssc0_tx: ssc0_tx-0 {
295+
atmel,pins =
296+
<3 0 0x1 0x0 /* PD0 periph A */
297+
3 1 0x1 0x0 /* PD1 periph A */
298+
3 2 0x1 0x0>; /* PD2 periph A */
299+
};
300+
301+
pinctrl_ssc0_rx: ssc0_rx-0 {
302+
atmel,pins =
303+
<3 3 0x1 0x0 /* PD3 periph A */
304+
3 4 0x1 0x0 /* PD4 periph A */
305+
3 5 0x1 0x0>; /* PD5 periph A */
306+
};
307+
};
308+
309+
ssc1 {
310+
pinctrl_ssc1_tx: ssc1_tx-0 {
311+
atmel,pins =
312+
<3 10 0x1 0x0 /* PD10 periph A */
313+
3 11 0x1 0x0 /* PD11 periph A */
314+
3 12 0x1 0x0>; /* PD12 periph A */
315+
};
316+
317+
pinctrl_ssc1_rx: ssc1_rx-0 {
318+
atmel,pins =
319+
<3 13 0x1 0x0 /* PD13 periph A */
320+
3 14 0x1 0x0 /* PD14 periph A */
321+
3 15 0x1 0x0>; /* PD15 periph A */
322+
};
323+
};
324+
293325
pioA: gpio@fffff200 {
294326
compatible = "atmel,at91rm9200-gpio";
295327
reg = <0xfffff200 0x200>;
@@ -425,13 +457,17 @@
425457
compatible = "atmel,at91sam9g45-ssc";
426458
reg = <0xfff9c000 0x4000>;
427459
interrupts = <16 4 5>;
460+
pinctrl-names = "default";
461+
pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
428462
status = "disabled";
429463
};
430464

431465
ssc1: ssc@fffa0000 {
432466
compatible = "atmel,at91sam9g45-ssc";
433467
reg = <0xfffa0000 0x4000>;
434468
interrupts = <17 4 5>;
469+
pinctrl-names = "default";
470+
pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
435471
status = "disabled";
436472
};
437473

arch/arm/boot/dts/at91sam9n12.dtsi

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
tcb1 = &tcb1;
2929
i2c0 = &i2c0;
3030
i2c1 = &i2c1;
31+
ssc0 = &ssc0;
3132
};
3233
cpus {
3334
cpu@0 {
@@ -244,6 +245,22 @@
244245
};
245246
};
246247

248+
ssc0 {
249+
pinctrl_ssc0_tx: ssc0_tx-0 {
250+
atmel,pins =
251+
<0 24 0x2 0x0 /* PA24 periph B */
252+
0 25 0x2 0x0 /* PA25 periph B */
253+
0 26 0x2 0x0>; /* PA26 periph B */
254+
};
255+
256+
pinctrl_ssc0_rx: ssc0_rx-0 {
257+
atmel,pins =
258+
<0 27 0x2 0x0 /* PA27 periph B */
259+
0 28 0x2 0x0 /* PA28 periph B */
260+
0 29 0x2 0x0>; /* PA29 periph B */
261+
};
262+
};
263+
247264
pioA: gpio@fffff400 {
248265
compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
249266
reg = <0xfffff400 0x200>;
@@ -294,6 +311,15 @@
294311
status = "disabled";
295312
};
296313

314+
ssc0: ssc@f0010000 {
315+
compatible = "atmel,at91sam9g45-ssc";
316+
reg = <0xf0010000 0x4000>;
317+
interrupts = <28 4 5>;
318+
pinctrl-names = "default";
319+
pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
320+
status = "disabled";
321+
};
322+
297323
usart0: serial@f801c000 {
298324
compatible = "atmel,at91sam9260-usart";
299325
reg = <0xf801c000 0x4000>;

arch/arm/boot/dts/at91sam9x5.dtsi

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@
8888
interrupts = <1 4 7>;
8989
};
9090

91-
ssc0: ssc@f0010000 {
92-
compatible = "atmel,at91sam9g45-ssc";
93-
reg = <0xf0010000 0x4000>;
94-
interrupts = <28 4 5>;
95-
status = "disabled";
96-
};
97-
9891
tcb0: timer@f8008000 {
9992
compatible = "atmel,at91sam9x5-tcb";
10093
reg = <0xf8008000 0x100>;
@@ -290,6 +283,22 @@
290283
};
291284
};
292285

286+
ssc0 {
287+
pinctrl_ssc0_tx: ssc0_tx-0 {
288+
atmel,pins =
289+
<0 24 0x2 0x0 /* PA24 periph B */
290+
0 25 0x2 0x0 /* PA25 periph B */
291+
0 26 0x2 0x0>; /* PA26 periph B */
292+
};
293+
294+
pinctrl_ssc0_rx: ssc0_rx-0 {
295+
atmel,pins =
296+
<0 27 0x2 0x0 /* PA27 periph B */
297+
0 28 0x2 0x0 /* PA28 periph B */
298+
0 29 0x2 0x0>; /* PA29 periph B */
299+
};
300+
};
301+
293302
pioA: gpio@fffff400 {
294303
compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
295304
reg = <0xfffff400 0x200>;
@@ -333,6 +342,15 @@
333342
};
334343
};
335344

345+
ssc0: ssc@f0010000 {
346+
compatible = "atmel,at91sam9g45-ssc";
347+
reg = <0xf0010000 0x4000>;
348+
interrupts = <28 4 5>;
349+
pinctrl-names = "default";
350+
pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
351+
status = "disabled";
352+
};
353+
336354
mmc0: mmc@f0008000 {
337355
compatible = "atmel,hsmci";
338356
reg = <0xf0008000 0x600>;

drivers/misc/atmel-ssc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/module.h>
2020

2121
#include <linux/of.h>
22+
#include <linux/pinctrl/consumer.h>
2223

2324
/* Serialize access to ssc_list and user count */
2425
static DEFINE_SPINLOCK(user_lock);
@@ -131,6 +132,13 @@ static int ssc_probe(struct platform_device *pdev)
131132
struct resource *regs;
132133
struct ssc_device *ssc;
133134
const struct atmel_ssc_platform_data *plat_dat;
135+
struct pinctrl *pinctrl;
136+
137+
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
138+
if (IS_ERR(pinctrl)) {
139+
dev_err(&pdev->dev, "Failed to request pinctrl\n");
140+
return PTR_ERR(pinctrl);
141+
}
134142

135143
ssc = devm_kzalloc(&pdev->dev, sizeof(struct ssc_device), GFP_KERNEL);
136144
if (!ssc) {

sound/pci/hda/patch_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol,
15021502
ctl_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
15031503
substream = snd_pcm_chmap_substream(info, ctl_idx);
15041504
if (!substream || !substream->runtime)
1505-
return -EBADFD;
1505+
return 0; /* just for avoiding error from alsactl restore */
15061506
switch (substream->runtime->status->state) {
15071507
case SNDRV_PCM_STATE_OPEN:
15081508
case SNDRV_PCM_STATE_SETUP:

sound/usb/mixer_maps.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,15 @@ static struct usbmix_name_map audigy2nx_map[] = {
179179
{ 0 } /* terminator */
180180
};
181181

182+
static struct usbmix_selector_map c400_selectors[] = {
183+
{
184+
.id = 0x80,
185+
.count = 2,
186+
.names = (const char*[]) {"Internal", "SPDIF"}
187+
},
188+
{ 0 } /* terminator */
189+
};
190+
182191
static struct usbmix_selector_map audigy2nx_selectors[] = {
183192
{
184193
.id = 14, /* Capture Source */
@@ -366,6 +375,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
366375
.id = USB_ID(0x06f8, 0xc000),
367376
.map = hercules_usb51_map,
368377
},
378+
{
379+
.id = USB_ID(0x0763, 0x2030),
380+
.selector_map = c400_selectors,
381+
},
369382
{
370383
.id = USB_ID(0x08bb, 0x2702),
371384
.map = linex_map,

sound/usb/quirks-table.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
22892289
.rate_table = (unsigned int[]) {
22902290
44100, 48000, 88200, 96000
22912291
},
2292-
.clock = 0x81,
2292+
.clock = 0x80,
22932293
}
22942294
},
22952295
/* Capture */
@@ -2315,7 +2315,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
23152315
.rate_table = (unsigned int[]) {
23162316
44100, 48000, 88200, 96000
23172317
},
2318-
.clock = 0x81,
2318+
.clock = 0x80,
23192319
}
23202320
},
23212321
/* MIDI */

sound/usb/quirks.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev)
387387
* rules
388388
*/
389389
err = usb_driver_set_configuration(dev, 2);
390-
if (err < 0) {
390+
if (err < 0)
391391
snd_printdd("error usb_driver_set_configuration: %d\n",
392392
err);
393-
return -ENODEV;
394-
}
393+
/* Always return an error, so that we stop creating a device
394+
that will just be destroyed and recreated with a new
395+
configuration */
396+
return -ENODEV;
395397
} else
396398
snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n");
397399

@@ -859,6 +861,17 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
859861
if ((le16_to_cpu(ep->chip->dev->descriptor.idVendor) == 0x23ba) &&
860862
ep->type == SND_USB_ENDPOINT_TYPE_SYNC)
861863
ep->skip_packets = 4;
864+
865+
/*
866+
* M-Audio Fast Track C400 - when packets are not skipped, real world
867+
* latency varies by approx. +/- 50 frames (at 96KHz) each time the
868+
* stream is (re)started. When skipping packets 16 at endpoint start
869+
* up, the real world latency is stable within +/- 1 frame (also
870+
* across power cycles).
871+
*/
872+
if (ep->chip->usb_id == USB_ID(0x0763, 0x2030) &&
873+
ep->type == SND_USB_ENDPOINT_TYPE_DATA)
874+
ep->skip_packets = 16;
862875
}
863876

864877
void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,

0 commit comments

Comments
 (0)