aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-02-16 06:35:16 -0500
committerTakashi Iwai <tiwai@suse.de>2012-02-16 06:39:35 -0500
commit20f7d928fa6e51ca81648946ead6244c58a0b4c0 (patch)
tree48627846fbe1977d87e9d58b7ffd8b05f845deaa /sound/pci/hda/patch_realtek.c
parent15317ab21686044f1af96dd329ba809a08f04b89 (diff)
ALSA: hda/realtek - Replace ALC260 model=replacer with the auto-parser
The support for Replacer 627V in the auto-parser needs the unique unsol event handling: although the machine has a single output pin 0x0f, it's used for both the headphone and the speaker, and the driver needs to toggle the output route via GPIO 1. In addition, it needs a special COEF setup with 0x3050. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 95ef722e4075..cfa6ad758343 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4211,8 +4211,35 @@ enum {
4211 ALC260_FIXUP_HP_PIN_0F, 4211 ALC260_FIXUP_HP_PIN_0F,
4212 ALC260_FIXUP_COEF, 4212 ALC260_FIXUP_COEF,
4213 ALC260_FIXUP_GPIO1, 4213 ALC260_FIXUP_GPIO1,
4214 ALC260_FIXUP_GPIO1_TOGGLE,
4215 ALC260_FIXUP_REPLACER,
4214}; 4216};
4215 4217
4218static void alc260_gpio1_automute(struct hda_codec *codec)
4219{
4220 struct alc_spec *spec = codec->spec;
4221 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
4222 spec->hp_jack_present);
4223}
4224
4225static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
4226 const struct alc_fixup *fix, int action)
4227{
4228 struct alc_spec *spec = codec->spec;
4229 if (action == ALC_FIXUP_ACT_PROBE) {
4230 /* although the machine has only one output pin, we need to
4231 * toggle GPIO1 according to the jack state
4232 */
4233 spec->automute_hook = alc260_gpio1_automute;
4234 spec->detect_hp = 1;
4235 spec->automute_speaker = 1;
4236 spec->autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
4237 snd_hda_jack_detect_enable(codec, 0x0f, ALC_HP_EVENT);
4238 spec->unsol_event = alc_sku_unsol_event;
4239 add_verb(codec->spec, alc_gpio1_init_verbs);
4240 }
4241}
4242
4216static const struct alc_fixup alc260_fixups[] = { 4243static const struct alc_fixup alc260_fixups[] = {
4217 [ALC260_FIXUP_HP_DC5750] = { 4244 [ALC260_FIXUP_HP_DC5750] = {
4218 .type = ALC_FIXUP_PINS, 4245 .type = ALC_FIXUP_PINS,
@@ -4242,6 +4269,22 @@ static const struct alc_fixup alc260_fixups[] = {
4242 .type = ALC_FIXUP_VERBS, 4269 .type = ALC_FIXUP_VERBS,
4243 .v.verbs = alc_gpio1_init_verbs, 4270 .v.verbs = alc_gpio1_init_verbs,
4244 }, 4271 },
4272 [ALC260_FIXUP_GPIO1_TOGGLE] = {
4273 .type = ALC_FIXUP_FUNC,
4274 .v.func = alc260_fixup_gpio1_toggle,
4275 .chained = true,
4276 .chain_id = ALC260_FIXUP_HP_PIN_0F,
4277 },
4278 [ALC260_FIXUP_REPLACER] = {
4279 .type = ALC_FIXUP_VERBS,
4280 .v.verbs = (const struct hda_verb[]) {
4281 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
4282 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
4283 { }
4284 },
4285 .chained = true,
4286 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
4287 },
4245}; 4288};
4246 4289
4247static const struct snd_pci_quirk alc260_fixup_tbl[] = { 4290static const struct snd_pci_quirk alc260_fixup_tbl[] = {
@@ -4249,6 +4292,7 @@ static const struct snd_pci_quirk alc260_fixup_tbl[] = {
4249 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), 4292 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
4250 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), 4293 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
4251 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), 4294 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
4295 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
4252 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), 4296 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
4253 {} 4297 {}
4254}; 4298};