[Bionic][PATCH v2 0/2] Updates for Realtek ALC225

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bionic][PATCH v2 0/2] Updates for Realtek ALC225

Wen-chien Jesse Sung
BugLink: https://launchpad.net/bugs/1723913
BugLink: https://launchpad.net/bugs/1744058

These commits work on specific hardware and are verified on a system
with this device.

Kailang Yang (2):
  UBUNTU: SAUCE: ALSA: hda/realtek - Add support headset mode for DELL
    WYSE
  ALSA: hda/realtek - update ALC225 depop optimize

 sound/pci/hda/patch_realtek.c | 117 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 116 insertions(+), 1 deletion(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[Bionic][PATCH v2 1/2] UBUNTU: SAUCE: ALSA: hda/realtek - Add support headset mode for DELL WYSE

Wen-chien Jesse Sung
From: Kailang Yang <[hidden email]>

BugLink: https://launchpad.net/bugs/1723913

Enable headset mode support for WYSE(0x080c) platform.

Signed-off-by: Kailang Yang <[hidden email]>

(backported from Kailang Yang's patch)
Signed-off-by: Wen-chien Jesse Sung <[hidden email]>
---
 sound/pci/hda/patch_realtek.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1750e00..9db50cf 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5324,6 +5324,7 @@ enum {
  ALC700_FIXUP_INTEL_REFERENCE,
  ALC274_FIXUP_DELL_BIND_DACS,
  ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
+ ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -6149,6 +6150,18 @@ static const struct hda_fixup alc269_fixups[] = {
  .chained = true,
  .chain_id = ALC274_FIXUP_DELL_BIND_DACS
  },
+ [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
+ .type = HDA_FIXUP_PINS,
+ .v.pins = (const struct hda_pintbl[]) {
+ { 0x16, 0x0101102f }, /* Rear Headset HP */
+ { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
+ { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
+ { 0x1b, 0x02011020 },
+ { }
+ },
+ .chained = true,
+ .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
+ },
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6198,6 +6211,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
  SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
  SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
  SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
+ SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
  SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
  SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
  SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[Bionic][PATCH v2 2/2] ALSA: hda/realtek - update ALC225 depop optimize

Wen-chien Jesse Sung
In reply to this post by Wen-chien Jesse Sung
From: Kailang Yang <[hidden email]>

BugLink: https://launchpad.net/bugs/1744058

Add ALC225 its own depop functions for alc_init and alc_shutup.
Add depop optimize step for headset mode functions.

Signed-off-by: Kailang Yang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(backported from commit da911b1f5e98f21b20aa042748dfe73e36322fb1)
Signed-off-by: Wen-chien Jesse Sung <[hidden email]>
---
 sound/pci/hda/patch_realtek.c | 103 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 102 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 9db50cf..ea4d3c1 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3168,6 +3168,93 @@ static void alc256_shutup(struct hda_codec *codec)
  snd_hda_shutup_pins(codec);
 }
 
+static void alc225_init(struct hda_codec *codec)
+{
+ struct alc_spec *spec = codec->spec;
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp1_pin_sense, hp2_pin_sense;
+
+ if (!hp_pin)
+ return;
+
+ msleep(30);
+
+ hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
+ hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
+
+ if (hp1_pin_sense || hp2_pin_sense)
+ msleep(2);
+
+ alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
+
+ if (hp1_pin_sense)
+ snd_hda_codec_write(codec, hp_pin, 0,
+    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+ if (hp2_pin_sense)
+ snd_hda_codec_write(codec, 0x16, 0,
+    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+
+ if (hp1_pin_sense || hp2_pin_sense)
+ msleep(85);
+
+ if (hp1_pin_sense)
+ snd_hda_codec_write(codec, hp_pin, 0,
+    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
+ if (hp2_pin_sense)
+ snd_hda_codec_write(codec, 0x16, 0,
+    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
+
+ if (hp1_pin_sense || hp2_pin_sense)
+ msleep(100);
+
+ alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
+ alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
+}
+
+static void alc225_shutup(struct hda_codec *codec)
+{
+ struct alc_spec *spec = codec->spec;
+ hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
+ bool hp1_pin_sense, hp2_pin_sense;
+
+ if (!hp_pin) {
+ alc269_shutup(codec);
+ return;
+ }
+
+ /* 3k pull low control for Headset jack. */
+ alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
+
+ hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
+ hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
+
+ if (hp1_pin_sense || hp2_pin_sense)
+ msleep(2);
+
+ if (hp1_pin_sense)
+ snd_hda_codec_write(codec, hp_pin, 0,
+    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+ if (hp2_pin_sense)
+ snd_hda_codec_write(codec, 0x16, 0,
+    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+
+ if (hp1_pin_sense || hp2_pin_sense)
+ msleep(85);
+
+ if (hp1_pin_sense)
+ snd_hda_codec_write(codec, hp_pin, 0,
+    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+ if (hp2_pin_sense)
+ snd_hda_codec_write(codec, 0x16, 0,
+    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+
+ if (hp1_pin_sense || hp2_pin_sense)
+ msleep(100);
+
+ alc_auto_setup_eapd(codec, false);
+ snd_hda_shutup_pins(codec);
+}
+
 static void alc_default_init(struct hda_codec *codec)
 {
  struct alc_spec *spec = codec->spec;
@@ -4571,6 +4658,12 @@ static void alc_determine_headset_type(struct hda_codec *codec)
  case 0x10ec0225:
  case 0x10ec0295:
  case 0x10ec0299:
+ snd_hda_codec_write(codec, 0x21, 0,
+    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+ msleep(80);
+ snd_hda_codec_write(codec, 0x21, 0,
+    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+
  alc_process_coef_fw(codec, alc225_pre_hsmode);
  alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
  val = alc_read_coef_idx(codec, 0x45);
@@ -4590,6 +4683,12 @@ static void alc_determine_headset_type(struct hda_codec *codec)
  alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
  alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
  alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
+
+ snd_hda_codec_write(codec, 0x21, 0,
+    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
+ msleep(80);
+ snd_hda_codec_write(codec, 0x21, 0,
+    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
  break;
  case 0x10ec0867:
  is_ctia = true;
@@ -6945,7 +7044,9 @@ static int patch_alc269(struct hda_codec *codec)
  break;
  case 0x10ec0299:
  spec->codec_variant = ALC269_TYPE_ALC225;
- spec->gen.mixer_nid = 0; /* no loopback on ALC299 */
+ spec->shutup = alc225_shutup;
+ spec->init_hook = alc225_init;
+ spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
  break;
  case 0x10ec0234:
  case 0x10ec0274:
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [Bionic][PATCH v2 0/2] Updates for Realtek ALC225

Seth Forshee
In reply to this post by Wen-chien Jesse Sung
On Tue, Feb 13, 2018 at 07:29:04PM +0800, Wen-chien Jesse Sung wrote:

> BugLink: https://launchpad.net/bugs/1723913
> BugLink: https://launchpad.net/bugs/1744058
>
> These commits work on specific hardware and are verified on a system
> with this device.
>
> Kailang Yang (2):
>   UBUNTU: SAUCE: ALSA: hda/realtek - Add support headset mode for DELL
>     WYSE
>   ALSA: hda/realtek - update ALC225 depop optimize
>
>  sound/pci/hda/patch_realtek.c | 117 +++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 116 insertions(+), 1 deletion(-)

Applied to bionic/master-next, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team