Skip to content

Commit ed2c891

Browse files
committed
Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Nothing too exciting here, just a few regression and trivial fixes, and new quirks for HD-audio and USB-audio. - HD-audio mute LED mode enum fix - Fix kernel panic of Digidesign Mbox2 usb-audio quirk (which was new in 3.8-rc1) - Creative BT-D1 usb-audio quirk - mute LED fixup for HP Pavillion 17 laptop" * tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec) ALSA: au88x0: fix incorrect left shift sound: oss/pas2: Fix possible access out of array ALSA: usb-audio: Fix kernel panic of Digidesign Mbox2 quirk ALSA: usb-audio: Add support for Creative BT-D1 via usb sound quirks ALSA: hda - Switch "On" and "Off" for "Mute-LED Mode" kcontrol
2 parents 5c33d9b + 6d3cd5d commit ed2c891

File tree

8 files changed

+67
-17
lines changed

8 files changed

+67
-17
lines changed

sound/oss/pas2_card.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config)
333333
{
334334
char temp[100];
335335

336+
if (pas_model < 0 ||
337+
pas_model >= ARRAY_SIZE(pas_model_names)) {
338+
printk(KERN_ERR "pas2 unrecognized model.\n");
339+
return;
340+
}
336341
sprintf(temp,
337342
"%s rev %d", pas_model_names[(int) pas_model],
338343
pas_read(0x2789));

sound/pci/au88x0/au88x0_synth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
5858
if (en)
5959
temp |= (1 << (wt & 0x1f));
6060
else
61-
temp &= (1 << ~(wt & 0x1f));
61+
temp &= ~(1 << (wt & 0x1f));
6262
hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp);
6363
}
6464

sound/pci/hda/hda_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,7 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol,
25312531
struct snd_ctl_elem_info *uinfo)
25322532
{
25332533
static const char * const texts[] = {
2534-
"Off", "On", "Follow Master"
2534+
"On", "Off", "Follow Master"
25352535
};
25362536
unsigned int index;
25372537

sound/pci/hda/patch_realtek.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5992,6 +5992,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec,
59925992
spec->automute_hook = alc269_quanta_automute;
59935993
}
59945994

5995+
/* update mute-LED according to the speaker mute state via mic1 VREF pin */
5996+
static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled)
5997+
{
5998+
struct hda_codec *codec = private_data;
5999+
unsigned int pinval = AC_PINCTL_IN_EN + (enabled ?
6000+
AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80);
6001+
snd_hda_set_pin_ctl_cache(codec, 0x18, pinval);
6002+
}
6003+
6004+
static void alc269_fixup_mic1_mute(struct hda_codec *codec,
6005+
const struct alc_fixup *fix, int action)
6006+
{
6007+
struct alc_spec *spec = codec->spec;
6008+
switch (action) {
6009+
case ALC_FIXUP_ACT_BUILD:
6010+
spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook;
6011+
snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
6012+
/* fallthru */
6013+
case ALC_FIXUP_ACT_INIT:
6014+
snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
6015+
break;
6016+
}
6017+
}
6018+
59956019
/* update mute-LED according to the speaker mute state via mic2 VREF pin */
59966020
static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
59976021
{
@@ -6043,6 +6067,7 @@ enum {
60436067
ALC269_FIXUP_DMIC,
60446068
ALC269VB_FIXUP_AMIC,
60456069
ALC269VB_FIXUP_DMIC,
6070+
ALC269_FIXUP_MIC1_MUTE_LED,
60466071
ALC269_FIXUP_MIC2_MUTE_LED,
60476072
ALC269_FIXUP_INV_DMIC,
60486073
ALC269_FIXUP_LENOVO_DOCK,
@@ -6171,6 +6196,10 @@ static const struct alc_fixup alc269_fixups[] = {
61716196
{ }
61726197
},
61736198
},
6199+
[ALC269_FIXUP_MIC1_MUTE_LED] = {
6200+
.type = ALC_FIXUP_FUNC,
6201+
.v.func = alc269_fixup_mic1_mute,
6202+
},
61746203
[ALC269_FIXUP_MIC2_MUTE_LED] = {
61756204
.type = ALC_FIXUP_FUNC,
61766205
.v.func = alc269_fixup_mic2_mute,
@@ -6215,6 +6244,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
62156244
SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
62166245
SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
62176246
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
6247+
SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
62186248
SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
62196249
SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
62206250
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),

sound/usb/midi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card,
21812181
umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
21822182
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
21832183
break;
2184-
case QUIRK_MIDI_MBOX2:
2185-
umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops;
2186-
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
2187-
break;
21882184
case QUIRK_MIDI_RAW_BYTES:
21892185
umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
21902186
/*

sound/usb/quirks-table.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,28 @@
5050
}
5151
},
5252

53+
{
54+
/* Creative BT-D1 */
55+
USB_DEVICE(0x041e, 0x0005),
56+
.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
57+
.ifnum = 1,
58+
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
59+
.data = &(const struct audioformat) {
60+
.formats = SNDRV_PCM_FMTBIT_S16_LE,
61+
.channels = 2,
62+
.iface = 1,
63+
.altsetting = 1,
64+
.altset_idx = 1,
65+
.endpoint = 0x03,
66+
.ep_attr = USB_ENDPOINT_XFER_ISOC,
67+
.attributes = 0,
68+
.rates = SNDRV_PCM_RATE_CONTINUOUS,
69+
.rate_min = 48000,
70+
.rate_max = 48000,
71+
}
72+
}
73+
},
74+
5375
/* Creative/Toshiba Multimedia Center SB-0500 */
5476
{
5577
USB_DEVICE(0x041e, 0x3048),
@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
29933015
},
29943016
{
29953017
.ifnum = 6,
2996-
.type = QUIRK_MIDI_MBOX2,
3018+
.type = QUIRK_MIDI_MIDIMAN,
29973019
.data = &(const struct snd_usb_midi_endpoint_info) {
29983020
.out_ep = 0x02,
29993021
.out_cables = 0x0001,

sound/usb/quirks.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
306306
[QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
307307
[QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
308308
[QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
309-
[QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
310309
[QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
311310
[QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
312311
[QUIRK_MIDI_CME] = create_any_midi_quirk,
@@ -528,11 +527,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev)
528527
#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */
529528
#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */
530529

531-
int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
530+
static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
532531
{
533532
struct usb_host_config *config = dev->actconfig;
534533
int err;
535-
u8 bootresponse;
534+
u8 bootresponse[12];
536535
int fwsize;
537536
int count;
538537

@@ -546,20 +545,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
546545
snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
547546

548547
count = 0;
549-
bootresponse = MBOX2_BOOT_LOADING;
550-
while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) {
548+
bootresponse[0] = MBOX2_BOOT_LOADING;
549+
while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
551550
msleep(500); /* 0.5 second delay */
552551
snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
553552
/* Control magic - load onboard firmware */
554553
0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
555-
if (bootresponse == MBOX2_BOOT_READY)
554+
if (bootresponse[0] == MBOX2_BOOT_READY)
556555
break;
557556
snd_printd("usb-audio: device not ready, resending boot sequence...\n");
558557
count++;
559558
}
560559

561-
if (bootresponse != MBOX2_BOOT_READY) {
562-
snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse);
560+
if (bootresponse[0] != MBOX2_BOOT_READY) {
561+
snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
563562
return -ENODEV;
564563
}
565564

@@ -660,7 +659,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
660659
return 0; /* keep this altsetting */
661660
}
662661

663-
664662
static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
665663
int iface, int altno)
666664
{

sound/usb/usbaudio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ enum quirk_type {
7676
QUIRK_MIDI_YAMAHA,
7777
QUIRK_MIDI_MIDIMAN,
7878
QUIRK_MIDI_NOVATION,
79-
QUIRK_MIDI_MBOX2,
8079
QUIRK_MIDI_RAW_BYTES,
8180
QUIRK_MIDI_EMAGIC,
8281
QUIRK_MIDI_CME,

0 commit comments

Comments
 (0)