aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 66c0876bf734..86de305fc9f2 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -28,6 +28,7 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/pci.h> 30#include <linux/pci.h>
31#include <linux/dmi.h>
31#include <sound/core.h> 32#include <sound/core.h>
32#include <sound/asoundef.h> 33#include <sound/asoundef.h>
33#include <sound/jack.h> 34#include <sound/jack.h>
@@ -1589,6 +1590,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1589 "Dell Studio 17", STAC_DELL_M6_DMIC), 1590 "Dell Studio 17", STAC_DELL_M6_DMIC),
1590 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, 1591 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
1591 "Dell Studio 1555", STAC_DELL_M6_DMIC), 1592 "Dell Studio 1555", STAC_DELL_M6_DMIC),
1593 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd,
1594 "Dell Studio 1557", STAC_DELL_M6_DMIC),
1592 {} /* terminator */ 1595 {} /* terminator */
1593}; 1596};
1594 1597
@@ -1693,6 +1696,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1693 "DFI LanParty", STAC_92HD71BXX_REF), 1696 "DFI LanParty", STAC_92HD71BXX_REF),
1694 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb, 1697 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb,
1695 "HP dv4-1222nr", STAC_HP_DV4_1222NR), 1698 "HP dv4-1222nr", STAC_HP_DV4_1222NR),
1699 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x1720,
1700 "HP", STAC_HP_DV5),
1696 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, 1701 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
1697 "HP", STAC_HP_DV5), 1702 "HP", STAC_HP_DV5),
1698 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, 1703 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
@@ -4665,6 +4670,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4665 } 4670 }
4666} 4671}
4667 4672
4673static int hp_bseries_system(u32 subsystem_id)
4674{
4675 switch (subsystem_id) {
4676 case 0x103c307e:
4677 case 0x103c307f:
4678 case 0x103c3080:
4679 case 0x103c3081:
4680 case 0x103c1722:
4681 case 0x103c1723:
4682 case 0x103c1724:
4683 case 0x103c1725:
4684 case 0x103c1726:
4685 case 0x103c1727:
4686 case 0x103c1728:
4687 case 0x103c1729:
4688 return 1;
4689 }
4690 return 0;
4691}
4692
4668#ifdef CONFIG_PROC_FS 4693#ifdef CONFIG_PROC_FS
4669static void stac92hd_proc_hook(struct snd_info_buffer *buffer, 4694static void stac92hd_proc_hook(struct snd_info_buffer *buffer,
4670 struct hda_codec *codec, hda_nid_t nid) 4695 struct hda_codec *codec, hda_nid_t nid)
@@ -4754,6 +4779,11 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
4754 else 4779 else
4755 spec->gpio_data |= spec->gpio_led; /* white */ 4780 spec->gpio_data |= spec->gpio_led; /* white */
4756 4781
4782 if (hp_bseries_system(codec->subsystem_id)) {
4783 /* LED state is inverted on these systems */
4784 spec->gpio_data ^= spec->gpio_led;
4785 }
4786
4757 stac_gpio_set(codec, spec->gpio_mask, 4787 stac_gpio_set(codec, spec->gpio_mask,
4758 spec->gpio_dir, 4788 spec->gpio_dir,
4759 spec->gpio_data); 4789 spec->gpio_data);
@@ -5243,6 +5273,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
5243{ 5273{
5244 struct sigmatel_spec *spec; 5274 struct sigmatel_spec *spec;
5245 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init; 5275 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init;
5276 unsigned int pin_cfg;
5246 int err = 0; 5277 int err = 0;
5247 5278
5248 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5279 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
@@ -5426,6 +5457,45 @@ again:
5426 break; 5457 break;
5427 } 5458 }
5428 5459
5460 if (hp_bseries_system(codec->subsystem_id)) {
5461 pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f);
5462 if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
5463 get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER ||
5464 get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) {
5465 /* It was changed in the BIOS to just satisfy MS DTM.
5466 * Lets turn it back into slaved HP
5467 */
5468 pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE))
5469 | (AC_JACK_HP_OUT <<
5470 AC_DEFCFG_DEVICE_SHIFT);
5471 pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC
5472 | AC_DEFCFG_SEQUENCE)))
5473 | 0x1f;
5474 snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg);
5475 }
5476 }
5477
5478 if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
5479 const struct dmi_device *dev = NULL;
5480 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
5481 NULL, dev))) {
5482 if (strcmp(dev->name, "HP_Mute_LED_1")) {
5483 switch (codec->vendor_id) {
5484 case 0x111d7608:
5485 spec->gpio_led = 0x01;
5486 break;
5487 case 0x111d7600:
5488 case 0x111d7601:
5489 case 0x111d7602:
5490 case 0x111d7603:
5491 spec->gpio_led = 0x08;
5492 break;
5493 }
5494 break;
5495 }
5496 }
5497 }
5498
5429#ifdef CONFIG_SND_HDA_POWER_SAVE 5499#ifdef CONFIG_SND_HDA_POWER_SAVE
5430 if (spec->gpio_led) { 5500 if (spec->gpio_led) {
5431 spec->gpio_mask |= spec->gpio_led; 5501 spec->gpio_mask |= spec->gpio_led;