From 2f44f84725dec354228fddc129e83e251060361d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 22 Jun 2010 11:12:32 +0200 Subject: [PATCH 1/4] ALSA: hda - Fix uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following compile warning. kctl should be NULL-initialized. sound/pci/hda/patch_realtek.c: In function ‘alc_build_controls’: sound/pci/hda/patch_realtek.c:2550:23: warning: ‘kctl’ may be used uninitialized in this function Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f1ce7d7f5aa3..2bf678917e87 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2547,7 +2547,7 @@ static struct snd_kcontrol_new alc_beep_mixer[] = { static int alc_build_controls(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; - struct snd_kcontrol *kctl; + struct snd_kcontrol *kctl = NULL; struct snd_kcontrol_new *knew; int i, j, err; unsigned int u; From 3bfea98ff73d377ffce0d4c7f938b7ef958cdb35 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 22 Jun 2010 11:04:19 +1000 Subject: [PATCH 2/4] ALSA: hda - Add Macbook 5,2 quirk BugLink: https://bugs.launchpad.net/bugs/463178 Set Macbook 5,2 (106b:4a00) hardware to use ALC885_MB5 Cc: Signed-off-by: Luke Yelavich Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2bf678917e87..32299ee5b4cd 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -9486,6 +9486,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = { SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91), SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), + SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5), /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, * so apparently no perfect solution yet */ From a5c7d797dcce3be5e77cd6ea62cc4920ededc32b Mon Sep 17 00:00:00 2001 From: Alexey Fisher Date: Wed, 23 Jun 2010 14:17:09 +0200 Subject: [PATCH 3/4] ALSA: usb-audio - Add volume resolution quirk for some Logitech webcams Some programs like Skype trying to set capture volume automatically. Normally it will tray, carefully step by step lover or higher, set the volume. In real word it work not really well, because devises and vendors lie about real audio settings. For example most Logitech webcams have 6400 or 3500 steps for capture volume. They do not tell that actual resolution is 384. So we have only 7 or 18 real steps. In this patch I set real resolution only for tested devices. Signed-off-by: Alexey Fisher Signed-off-by: Takashi Iwai --- sound/usb/mixer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 6939d0f517d9..736d134cc03c 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1107,6 +1107,19 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, } break; + case USB_ID(0x046d, 0x0809): + case USB_ID(0x046d, 0x0991): + /* Most audio usb devices lie about volume resolution. + * Most Logitech webcams have res = 384. + * Proboly there is some logitech magic behind this number --fishor + */ + if (!strcmp(kctl->id.name, "Mic Capture Volume")) { + snd_printk(KERN_INFO + "set resolution quirk: cval->res = 384\n"); + cval->res = 384; + } + break; + } snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", From f189efcd1cc06b75fe18642c9751d26aa5ed2b54 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 5 Jul 2010 17:28:17 +0200 Subject: [PATCH 4/4] ALSA: hda - Enable beep on Realtek codecs with PCI SSID override When the PCI SSID gives an overriding SKU assno, PC-beep bit isn't detected (since it's located over 16bit), resulting in no PC beep. Also, many devices seem ignoring the requirement by Realtek's spec for SSID numbers, and it also confuses the PC beep detection. This patch assumes the PC beep is available on every machine with PCI SSID override. It's a regression fix from 2.6.34. Reference: Kernel bug 16251 http://bugzilla.kernel.org/show_bug.cgi?id=16251 Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 32299ee5b4cd..ff614dd824c1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1268,8 +1268,10 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) struct alc_spec *spec = codec->spec; ass = codec->subsystem_id & 0xffff; - if (ass != codec->bus->pci->subsystem_device && (ass & 1)) + if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { + spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ goto do_sku; + } nid = 0x1d; if (codec->vendor_id == 0x10ec0260)