aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2015-04-08 04:01:22 -0400
committerTakashi Iwai <tiwai@suse.de>2015-04-08 05:37:51 -0400
commite1e62b98ebddc3234f3259019d3236f66fc667f8 (patch)
tree4dc687315b21f6d8cba2b833b03b8557dbe44d24 /sound/pci
parentf3b703326541d0c1ce85f5e570f6d2b6bd4296ec (diff)
ALSA: hda/realtek - Support Dell headset mode for ALC288
Dell create new platform with ALC288 codec. This patch will enable headset mode for Dino platform. [slight code refactoring and compile fix by tiwai] Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ceb599a87803..7b5c93e0e78c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4121,6 +4121,29 @@ static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
4121 alc_fixup_headset_mode(codec, fix, action); 4121 alc_fixup_headset_mode(codec, fix, action);
4122} 4122}
4123 4123
4124static void alc288_update_headset_jack_cb(struct hda_codec *codec,
4125 struct hda_jack_callback *jack)
4126{
4127 struct alc_spec *spec = codec->spec;
4128 int present;
4129
4130 alc_update_headset_jack_cb(codec, jack);
4131 /* Headset Mic enable or disable, only for Dell Dino */
4132 present = spec->gen.hp_jack_present ? 0x40 : 0;
4133 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
4134 present);
4135}
4136
4137static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
4138 const struct hda_fixup *fix, int action)
4139{
4140 alc_fixup_headset_mode(codec, fix, action);
4141 if (action == HDA_FIXUP_ACT_PROBE) {
4142 struct alc_spec *spec = codec->spec;
4143 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
4144 }
4145}
4146
4124static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, 4147static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
4125 const struct hda_fixup *fix, int action) 4148 const struct hda_fixup *fix, int action)
4126{ 4149{
@@ -4460,6 +4483,9 @@ enum {
4460 ALC286_FIXUP_HP_GPIO_LED, 4483 ALC286_FIXUP_HP_GPIO_LED,
4461 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, 4484 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
4462 ALC280_FIXUP_HP_DOCK_PINS, 4485 ALC280_FIXUP_HP_DOCK_PINS,
4486 ALC288_FIXUP_DELL_HEADSET_MODE,
4487 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
4488 ALC288_FIXUP_DELL_XPS_13_GPIO6,
4463}; 4489};
4464 4490
4465static const struct hda_fixup alc269_fixups[] = { 4491static const struct hda_fixup alc269_fixups[] = {
@@ -4948,6 +4974,33 @@ static const struct hda_fixup alc269_fixups[] = {
4948 .chained = true, 4974 .chained = true,
4949 .chain_id = ALC280_FIXUP_HP_GPIO4 4975 .chain_id = ALC280_FIXUP_HP_GPIO4
4950 }, 4976 },
4977 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
4978 .type = HDA_FIXUP_FUNC,
4979 .v.func = alc_fixup_headset_mode_dell_alc288,
4980 .chained = true,
4981 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
4982 },
4983 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
4984 .type = HDA_FIXUP_PINS,
4985 .v.pins = (const struct hda_pintbl[]) {
4986 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4987 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
4988 { }
4989 },
4990 .chained = true,
4991 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
4992 },
4993 [ALC288_FIXUP_DELL_XPS_13_GPIO6] = {
4994 .type = HDA_FIXUP_VERBS,
4995 .v.verbs = (const struct hda_verb[]) {
4996 {0x01, AC_VERB_SET_GPIO_MASK, 0x40},
4997 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x40},
4998 {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
4999 { }
5000 },
5001 .chained = true,
5002 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
5003 },
4951}; 5004};
4952 5005
4953static const struct snd_pci_quirk alc269_fixup_tbl[] = { 5006static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -5174,6 +5227,13 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
5174 {0x1b, 0x411111f0}, \ 5227 {0x1b, 0x411111f0}, \
5175 {0x1e, 0x411111f0} 5228 {0x1e, 0x411111f0}
5176 5229
5230#define ALC288_STANDARD_PINS \
5231 {0x17, 0x411111f0}, \
5232 {0x18, 0x411111f0}, \
5233 {0x19, 0x411111f0}, \
5234 {0x1a, 0x411111f0}, \
5235 {0x1e, 0x411111f0}
5236
5177#define ALC290_STANDARD_PINS \ 5237#define ALC290_STANDARD_PINS \
5178 {0x12, 0x99a30130}, \ 5238 {0x12, 0x99a30130}, \
5179 {0x13, 0x40000000}, \ 5239 {0x13, 0x40000000}, \
@@ -5369,6 +5429,13 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
5369 {0x19, 0x03a11020}, 5429 {0x19, 0x03a11020},
5370 {0x1d, 0x40e00001}, 5430 {0x1d, 0x40e00001},
5371 {0x21, 0x0321101f}), 5431 {0x21, 0x0321101f}),
5432 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6,
5433 ALC288_STANDARD_PINS,
5434 {0x12, 0x90a60120},
5435 {0x13, 0x40000000},
5436 {0x14, 0x90170110},
5437 {0x1d, 0x4076832d},
5438 {0x21, 0x0321101f}),
5372 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 5439 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
5373 ALC290_STANDARD_PINS, 5440 ALC290_STANDARD_PINS,
5374 {0x14, 0x411111f0}, 5441 {0x14, 0x411111f0},