Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148408
b: refs/heads/master
c: 514bf54
h: refs/heads/master
v: v3
  • Loading branch information
James Gardiner authored and Takashi Iwai committed May 4, 2009
1 parent fa6a428 commit 664a528
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb6605c1e4d2a2eaffdde433fbfe1567ca688458
refs/heads/master: 514bf54cd8c7f172816d3c003a6d022e9165a29b
1 change: 1 addition & 0 deletions trunk/Documentation/sound/alsa/HD-Audio-Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ STAC92HD71B*
hp-m4 HP mini 1000
hp-dv5 HP dv series
hp-hdx HP HDX series
hp-dv4-1222nr HP dv4-1222nr (with LED support)
auto BIOS setup (default)

STAC92HD73*
Expand Down
44 changes: 38 additions & 6 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ enum {
STAC_HP_M4,
STAC_HP_DV5,
STAC_HP_HDX,
STAC_HP_DV4_1222NR,
STAC_92HD71BXX_MODELS
};

Expand Down Expand Up @@ -1836,6 +1837,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
[STAC_HP_M4] = NULL,
[STAC_HP_DV5] = NULL,
[STAC_HP_HDX] = NULL,
[STAC_HP_DV4_1222NR] = NULL,
};

static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
Expand All @@ -1847,6 +1849,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
[STAC_HP_M4] = "hp-m4",
[STAC_HP_DV5] = "hp-dv5",
[STAC_HP_HDX] = "hp-hdx",
[STAC_HP_DV4_1222NR] = "hp-dv4-1222nr",
};

static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
Expand All @@ -1855,6 +1858,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
"DFI LanParty", STAC_92HD71BXX_REF),
SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb,
"HP dv4-1222nr", STAC_HP_DV4_1222NR),
SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
"HP", STAC_HP_DV5),
SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
Expand Down Expand Up @@ -4520,27 +4525,38 @@ static int stac92xx_resume(struct hda_codec *codec)
return 0;
}


/*
* using power check for controlling mute led of HP HDX notebooks
* using power check for controlling mute led of HP notebooks
* check for mute state only on Speakers (nid = 0x10)
*
* For this feature CONFIG_SND_HDA_POWER_SAVE is needed, otherwise
* the LED is NOT working properly !
*
* Changed name to reflect that it now works for any designated
* model, not just HP HDX.
*/

#ifdef CONFIG_SND_HDA_POWER_SAVE
static int stac92xx_hp_hdx_check_power_status(struct hda_codec *codec,
static int stac92xx_hp_check_power_status(struct hda_codec *codec,
hda_nid_t nid)
{
struct sigmatel_spec *spec = codec->spec;
unsigned int gpio_bit = 0; /* gets rid of compiler warning */

switch (spec->board_config) {
case STAC_HP_DV4_1222NR:
gpio_bit = 0x01;
break;
case STAC_HP_HDX:
gpio_bit = 0x08;
}

if (nid == 0x10) {
if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
HDA_AMP_MUTE)
spec->gpio_data &= ~0x08; /* orange */
spec->gpio_data &= ~gpio_bit; /* orange */
else
spec->gpio_data |= 0x08; /* white */
spec->gpio_data |= gpio_bit; /* white */

stac_gpio_set(codec, spec->gpio_mask,
spec->gpio_dir,
Expand Down Expand Up @@ -5219,6 +5235,22 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
spec->num_smuxes = 0;
spec->num_dmuxes = 1;
break;
case STAC_HP_DV4_1222NR:
spec->num_dmics = 1;
/* I don't know if it needs 1 or 2 smuxes - will wait for
* bug reports to fix if needed
*/
spec->num_smuxes = 1;
spec->num_dmuxes = 1;
#ifdef CONFIG_SND_HDA_POWER_SAVE
/* This controls MUTE LED */
spec->gpio_mask |= 0x01;
spec->gpio_dir |= 0x01;
spec->gpio_data |= 0x01;
codec->patch_ops.check_power_status =
stac92xx_hp_check_power_status;
#endif
/* fallthrough */
case STAC_HP_DV5:
snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN);
Expand All @@ -5239,7 +5271,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)

/* register check_power_status callback. */
codec->patch_ops.check_power_status =
stac92xx_hp_hdx_check_power_status;
stac92xx_hp_check_power_status;
#endif
break;
};
Expand Down

0 comments on commit 664a528

Please sign in to comment.