提交 ed2c8911 编写于 作者: L Linus Torvalds

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
...@@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config) ...@@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config)
{ {
char temp[100]; char temp[100];
if (pas_model < 0 ||
pas_model >= ARRAY_SIZE(pas_model_names)) {
printk(KERN_ERR "pas2 unrecognized model.\n");
return;
}
sprintf(temp, sprintf(temp,
"%s rev %d", pas_model_names[(int) pas_model], "%s rev %d", pas_model_names[(int) pas_model],
pas_read(0x2789)); pas_read(0x2789));
......
...@@ -58,7 +58,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en) ...@@ -58,7 +58,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
if (en) if (en)
temp |= (1 << (wt & 0x1f)); temp |= (1 << (wt & 0x1f));
else else
temp &= (1 << ~(wt & 0x1f)); temp &= ~(1 << (wt & 0x1f));
hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp); hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp);
} }
......
...@@ -2531,7 +2531,7 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol, ...@@ -2531,7 +2531,7 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
static const char * const texts[] = { static const char * const texts[] = {
"Off", "On", "Follow Master" "On", "Off", "Follow Master"
}; };
unsigned int index; unsigned int index;
......
...@@ -5992,6 +5992,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec, ...@@ -5992,6 +5992,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec,
spec->automute_hook = alc269_quanta_automute; spec->automute_hook = alc269_quanta_automute;
} }
/* update mute-LED according to the speaker mute state via mic1 VREF pin */
static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled)
{
struct hda_codec *codec = private_data;
unsigned int pinval = AC_PINCTL_IN_EN + (enabled ?
AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80);
snd_hda_set_pin_ctl_cache(codec, 0x18, pinval);
}
static void alc269_fixup_mic1_mute(struct hda_codec *codec,
const struct alc_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
switch (action) {
case ALC_FIXUP_ACT_BUILD:
spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook;
snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
/* fallthru */
case ALC_FIXUP_ACT_INIT:
snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
break;
}
}
/* update mute-LED according to the speaker mute state via mic2 VREF pin */ /* update mute-LED according to the speaker mute state via mic2 VREF pin */
static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled) static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
{ {
...@@ -6043,6 +6067,7 @@ enum { ...@@ -6043,6 +6067,7 @@ enum {
ALC269_FIXUP_DMIC, ALC269_FIXUP_DMIC,
ALC269VB_FIXUP_AMIC, ALC269VB_FIXUP_AMIC,
ALC269VB_FIXUP_DMIC, ALC269VB_FIXUP_DMIC,
ALC269_FIXUP_MIC1_MUTE_LED,
ALC269_FIXUP_MIC2_MUTE_LED, ALC269_FIXUP_MIC2_MUTE_LED,
ALC269_FIXUP_INV_DMIC, ALC269_FIXUP_INV_DMIC,
ALC269_FIXUP_LENOVO_DOCK, ALC269_FIXUP_LENOVO_DOCK,
...@@ -6171,6 +6196,10 @@ static const struct alc_fixup alc269_fixups[] = { ...@@ -6171,6 +6196,10 @@ static const struct alc_fixup alc269_fixups[] = {
{ } { }
}, },
}, },
[ALC269_FIXUP_MIC1_MUTE_LED] = {
.type = ALC_FIXUP_FUNC,
.v.func = alc269_fixup_mic1_mute,
},
[ALC269_FIXUP_MIC2_MUTE_LED] = { [ALC269_FIXUP_MIC2_MUTE_LED] = {
.type = ALC_FIXUP_FUNC, .type = ALC_FIXUP_FUNC,
.v.func = alc269_fixup_mic2_mute, .v.func = alc269_fixup_mic2_mute,
...@@ -6215,6 +6244,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -6215,6 +6244,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
......
...@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card, ...@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card,
umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
break; break;
case QUIRK_MIDI_MBOX2:
umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops;
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
break;
case QUIRK_MIDI_RAW_BYTES: case QUIRK_MIDI_RAW_BYTES:
umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
/* /*
......
...@@ -50,6 +50,28 @@ ...@@ -50,6 +50,28 @@
} }
}, },
{
/* Creative BT-D1 */
USB_DEVICE(0x041e, 0x0005),
.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
.ifnum = 1,
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
.data = &(const struct audioformat) {
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.channels = 2,
.iface = 1,
.altsetting = 1,
.altset_idx = 1,
.endpoint = 0x03,
.ep_attr = USB_ENDPOINT_XFER_ISOC,
.attributes = 0,
.rates = SNDRV_PCM_RATE_CONTINUOUS,
.rate_min = 48000,
.rate_max = 48000,
}
}
},
/* Creative/Toshiba Multimedia Center SB-0500 */ /* Creative/Toshiba Multimedia Center SB-0500 */
{ {
USB_DEVICE(0x041e, 0x3048), USB_DEVICE(0x041e, 0x3048),
...@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), ...@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
}, },
{ {
.ifnum = 6, .ifnum = 6,
.type = QUIRK_MIDI_MBOX2, .type = QUIRK_MIDI_MIDIMAN,
.data = &(const struct snd_usb_midi_endpoint_info) { .data = &(const struct snd_usb_midi_endpoint_info) {
.out_ep = 0x02, .out_ep = 0x02,
.out_cables = 0x0001, .out_cables = 0x0001,
......
...@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip, ...@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
[QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
[QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
[QUIRK_MIDI_NOVATION] = create_any_midi_quirk, [QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
[QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
[QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk, [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
[QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
[QUIRK_MIDI_CME] = create_any_midi_quirk, [QUIRK_MIDI_CME] = create_any_midi_quirk,
...@@ -528,11 +527,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev) ...@@ -528,11 +527,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev)
#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */ #define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */
#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */ #define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */
int snd_usb_mbox2_boot_quirk(struct usb_device *dev) static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
{ {
struct usb_host_config *config = dev->actconfig; struct usb_host_config *config = dev->actconfig;
int err; int err;
u8 bootresponse; u8 bootresponse[12];
int fwsize; int fwsize;
int count; int count;
...@@ -546,20 +545,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev) ...@@ -546,20 +545,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
count = 0; count = 0;
bootresponse = MBOX2_BOOT_LOADING; bootresponse[0] = MBOX2_BOOT_LOADING;
while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) { while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
msleep(500); /* 0.5 second delay */ msleep(500); /* 0.5 second delay */
snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
/* Control magic - load onboard firmware */ /* Control magic - load onboard firmware */
0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
if (bootresponse == MBOX2_BOOT_READY) if (bootresponse[0] == MBOX2_BOOT_READY)
break; break;
snd_printd("usb-audio: device not ready, resending boot sequence...\n"); snd_printd("usb-audio: device not ready, resending boot sequence...\n");
count++; count++;
} }
if (bootresponse != MBOX2_BOOT_READY) { if (bootresponse[0] != MBOX2_BOOT_READY) {
snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse); snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
return -ENODEV; return -ENODEV;
} }
...@@ -660,7 +659,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, ...@@ -660,7 +659,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
return 0; /* keep this altsetting */ return 0; /* keep this altsetting */
} }
static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
int iface, int altno) int iface, int altno)
{ {
......
...@@ -76,7 +76,6 @@ enum quirk_type { ...@@ -76,7 +76,6 @@ enum quirk_type {
QUIRK_MIDI_YAMAHA, QUIRK_MIDI_YAMAHA,
QUIRK_MIDI_MIDIMAN, QUIRK_MIDI_MIDIMAN,
QUIRK_MIDI_NOVATION, QUIRK_MIDI_NOVATION,
QUIRK_MIDI_MBOX2,
QUIRK_MIDI_RAW_BYTES, QUIRK_MIDI_RAW_BYTES,
QUIRK_MIDI_EMAGIC, QUIRK_MIDI_EMAGIC,
QUIRK_MIDI_CME, QUIRK_MIDI_CME,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册