[SRU][B/OEM-B/D/E/unstable][PATCH 0/2] no sound inputs from the external microphone and headset on a Dell machine

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][B/OEM-B/D/E/unstable][PATCH 0/2] no sound inputs from the external microphone and headset on a Dell machine

Hui Wang
BugLink: http://bugs.launchpad.net/bugs/1842265


[Impact]
When we plug an external mic/headset-mic, the system can't
detect it and as a result can't record sound from it.

[Fix]
Apply an existing fixup to fix this issue.

[Test Case]
After applying the patch, plug an external mic or headset-mic,
system can detect it and can record the sound from it too.


[Regression Risk]
Low. just add an existing fixup to this new machine.


Hui Wang (2):
  UBUNTU: SAUCE: ALSA: hda - Expand pin_match function to match upcoming
    new tbls
  UBUNTU: SAUCE: ALSA: hda - Define a fallback_pin_fixup_tbl for alc269
    family

 sound/pci/hda/hda_auto_parser.c | 12 ++++++++----
 sound/pci/hda/hda_local.h       |  3 ++-
 sound/pci/hda/patch_realtek.c   | 22 ++++++++++++++++------
 3 files changed, 26 insertions(+), 11 deletions(-)

--
2.17.1


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

[SRU][D/E/unstable][PATCH 1/2] UBUNTU: SAUCE: ALSA: hda - Expand pin_match function to match upcoming new tbls

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1842265

With the existing pintbl, we already have many entries in it. it is
better to figure out a new way to reduce the size of the pintbl.

We plan to define a new tbl which will match more machines with a
single tbl, To do that, this function doesn't need to match all valid
pins between machine and tbl, it just needs to match all pins defined
in the tbl with the machine.

And the plan is to move some tbls from pin_fixup_tbl to
fallback_pin_fixup_tbl gradually.

Signed-off-by: Hui Wang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 0fc1e447e9e474c2460df8d0378f899b8813e1d2
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/hda_auto_parser.c | 12 ++++++++----
 sound/pci/hda/hda_local.h       |  3 ++-
 sound/pci/hda/patch_realtek.c   |  4 ++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 92390d457567..8a134f750bae 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -884,7 +884,8 @@ EXPORT_SYMBOL_GPL(snd_hda_apply_fixup);
 #define IGNORE_SEQ_ASSOC (~(AC_DEFCFG_SEQUENCE | AC_DEFCFG_DEF_ASSOC))
 
 static bool pin_config_match(struct hda_codec *codec,
-     const struct hda_pintbl *pins)
+     const struct hda_pintbl *pins,
+     bool match_all_pins)
 {
  const struct hda_pincfg *pin;
  int i;
@@ -908,7 +909,8 @@ static bool pin_config_match(struct hda_codec *codec,
  return false;
  }
  }
- if (!found && (cfg & 0xf0000000) != 0x40000000)
+ if (match_all_pins &&
+    !found && (cfg & 0xf0000000) != 0x40000000)
  return false;
  }
 
@@ -920,10 +922,12 @@ static bool pin_config_match(struct hda_codec *codec,
  * @codec: the HDA codec
  * @pin_quirk: zero-terminated pin quirk list
  * @fixlist: the fixup list
+ * @match_all_pins: all valid pins must match with the table entries
  */
 void snd_hda_pick_pin_fixup(struct hda_codec *codec,
     const struct snd_hda_pin_quirk *pin_quirk,
-    const struct hda_fixup *fixlist)
+    const struct hda_fixup *fixlist,
+    bool match_all_pins)
 {
  const struct snd_hda_pin_quirk *pq;
 
@@ -935,7 +939,7 @@ void snd_hda_pick_pin_fixup(struct hda_codec *codec,
  continue;
  if (codec->core.vendor_id != pq->codec)
  continue;
- if (pin_config_match(codec, pq->pins)) {
+ if (pin_config_match(codec, pq->pins, match_all_pins)) {
  codec->fixup_id = pq->value;
 #ifdef CONFIG_SND_DEBUG_VERBOSE
  codec->fixup_name = pq->name;
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 349a8312d06a..3942e1b528d8 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -361,7 +361,8 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
  const struct hda_fixup *fixlist);
 void snd_hda_pick_pin_fixup(struct hda_codec *codec,
     const struct snd_hda_pin_quirk *pin_quirk,
-    const struct hda_fixup *fixlist);
+    const struct hda_fixup *fixlist,
+    bool match_all_pins);
 
 /* helper macros to retrieve pin default-config values */
 #define get_defcfg_connect(cfg) \
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f8aa0ab026d9..56821da834c0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7875,7 +7875,7 @@ static int patch_alc269(struct hda_codec *codec)
 
  snd_hda_pick_fixup(codec, alc269_fixup_models,
        alc269_fixup_tbl, alc269_fixups);
- snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
+ snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
  snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
    alc269_fixups);
  snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
@@ -8860,7 +8860,7 @@ static int patch_alc662(struct hda_codec *codec)
 
  snd_hda_pick_fixup(codec, alc662_fixup_models,
        alc662_fixup_tbl, alc662_fixups);
- snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
+ snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
  snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
 
  alc_auto_parse_customize_define(codec);
--
2.17.1


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

[SRU][D/E/unstable][PATCH 2/2] UBUNTU: SAUCE: ALSA: hda - Define a fallback_pin_fixup_tbl for alc269 family

Hui Wang
In reply to this post by Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1842265

We have another Dell laptop which needs the DELL4_MIC_NO_PRESENCE,
and this laptop has different pincfg definitions from existing
ones in the pintbl, rather adding a new entry, let us define
a tbl in the fallback_pin_fixup_tbl and this tbl will match
all dell machines with alc289 codec and the pins of 0x19 and 0x1b
are undef by default.

Signed-off-by: Hui Wang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 7c0a69394c265f2bb674c3f5daadfdd5c15ea0d1
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/patch_realtek.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 56821da834c0..772ddda373bd 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7573,10 +7573,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
  {0x12, 0x90a60120},
  {0x14, 0x90170110},
  {0x21, 0x0321101f}),
- SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
- {0x12, 0xb7a60130},
- {0x14, 0x90170110},
- {0x21, 0x04211020}),
  SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
  ALC290_STANDARD_PINS,
  {0x15, 0x04211040},
@@ -7686,6 +7682,19 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
  {}
 };
 
+/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
+ * more machines, don't need to match all valid pins, just need to match
+ * all the pins defined in the tbl. Just because of this reason, it is possible
+ * that a single machine matches multiple tbls, so there is one limitation:
+ *   at most one tbl is allowed to define for the same vendor and same codec
+ */
+static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
+ SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
+ {0x19, 0x40000000},
+ {0x1b, 0x40000000}),
+ {}
+};
+
 static void alc269_fill_coef(struct hda_codec *codec)
 {
  struct alc_spec *spec = codec->spec;
@@ -7876,6 +7885,7 @@ static int patch_alc269(struct hda_codec *codec)
  snd_hda_pick_fixup(codec, alc269_fixup_models,
        alc269_fixup_tbl, alc269_fixups);
  snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
+ snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
  snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
    alc269_fixups);
  snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
--
2.17.1


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

[SRU][B/OEM-B][PATCH 1/2] UBUNTU: SAUCE: ALSA: hda - Expand pin_match function to match upcoming new tbls

Hui Wang
In reply to this post by Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1842265

With the existing pintbl, we already have many entries in it. it is
better to figure out a new way to reduce the size of the pintbl.

We plan to define a new tbl which will match more machines with a
single tbl, To do that, this function doesn't need to match all valid
pins between machine and tbl, it just needs to match all pins defined
in the tbl with the machine.

And the plan is to move some tbls from pin_fixup_tbl to
fallback_pin_fixup_tbl gradually.

Signed-off-by: Hui Wang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(backported from commit 0fc1e447e9e474c2460df8d0378f899b8813e1d2
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/hda_auto_parser.c | 12 ++++++++----
 sound/pci/hda/hda_local.h       |  3 ++-
 sound/pci/hda/patch_realtek.c   |  4 ++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index d3ea73171a3d..c910dc57af79 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -888,7 +888,8 @@ EXPORT_SYMBOL_GPL(snd_hda_apply_fixup);
 #define IGNORE_SEQ_ASSOC (~(AC_DEFCFG_SEQUENCE | AC_DEFCFG_DEF_ASSOC))
 
 static bool pin_config_match(struct hda_codec *codec,
-     const struct hda_pintbl *pins)
+     const struct hda_pintbl *pins,
+     bool match_all_pins)
 {
  int i;
 
@@ -912,7 +913,8 @@ static bool pin_config_match(struct hda_codec *codec,
  return false;
  }
  }
- if (!found && (cfg & 0xf0000000) != 0x40000000)
+ if (match_all_pins &&
+    !found && (cfg & 0xf0000000) != 0x40000000)
  return false;
  }
 
@@ -924,10 +926,12 @@ static bool pin_config_match(struct hda_codec *codec,
  * @codec: the HDA codec
  * @pin_quirk: zero-terminated pin quirk list
  * @fixlist: the fixup list
+ * @match_all_pins: all valid pins must match with the table entries
  */
 void snd_hda_pick_pin_fixup(struct hda_codec *codec,
     const struct snd_hda_pin_quirk *pin_quirk,
-    const struct hda_fixup *fixlist)
+    const struct hda_fixup *fixlist,
+    bool match_all_pins)
 {
  const struct snd_hda_pin_quirk *pq;
 
@@ -939,7 +943,7 @@ void snd_hda_pick_pin_fixup(struct hda_codec *codec,
  continue;
  if (codec->core.vendor_id != pq->codec)
  continue;
- if (pin_config_match(codec, pq->pins)) {
+ if (pin_config_match(codec, pq->pins, match_all_pins)) {
  codec->fixup_id = pq->value;
 #ifdef CONFIG_SND_DEBUG_VERBOSE
  codec->fixup_name = pq->name;
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 5b5c324c99b9..4ca1b138688c 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -374,7 +374,8 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
  const struct hda_fixup *fixlist);
 void snd_hda_pick_pin_fixup(struct hda_codec *codec,
     const struct snd_hda_pin_quirk *pin_quirk,
-    const struct hda_fixup *fixlist);
+    const struct hda_fixup *fixlist,
+    bool match_all_pins);
 
 /* helper macros to retrieve pin default-config values */
 #define get_defcfg_connect(cfg) \
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 54d8bb0da314..6a06f2541348 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7585,7 +7585,7 @@ static int patch_alc269(struct hda_codec *codec)
 
  snd_hda_pick_fixup(codec, alc269_fixup_models,
        alc269_fixup_tbl, alc269_fixups);
- snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
+ snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
  snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
    alc269_fixups);
  snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
@@ -8663,7 +8663,7 @@ static int patch_alc662(struct hda_codec *codec)
 
  snd_hda_pick_fixup(codec, alc662_fixup_models,
        alc662_fixup_tbl, alc662_fixups);
- snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
+ snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
  snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
 
  alc_auto_parse_customize_define(codec);
--
2.17.1


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

[SRU][B/OEM-B][PATCH 2/2] UBUNTU: SAUCE: ALSA: hda - Define a fallback_pin_fixup_tbl for alc269 family

Hui Wang
In reply to this post by Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1842265

We have another Dell laptop which needs the DELL4_MIC_NO_PRESENCE,
and this laptop has different pincfg definitions from existing
ones in the pintbl, rather adding a new entry, let us define
a tbl in the fallback_pin_fixup_tbl and this tbl will match
all dell machines with alc289 codec and the pins of 0x19 and 0x1b
are undef by default.

Signed-off-by: Hui Wang <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(backported from commit 7c0a69394c265f2bb674c3f5daadfdd5c15ea0d1
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/patch_realtek.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6a06f2541348..42e05851ebcd 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7404,10 +7404,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
  {0x12, 0x90a60120},
  {0x14, 0x90170110},
  {0x21, 0x0321101f}),
- SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
- {0x12, 0xb7a60130},
- {0x14, 0x90170110},
- {0x21, 0x04211020}),
  SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
  ALC290_STANDARD_PINS,
  {0x15, 0x04211040},
@@ -7521,6 +7517,19 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
  {}
 };
 
+/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
+ * more machines, don't need to match all valid pins, just need to match
+ * all the pins defined in the tbl. Just because of this reason, it is possible
+ * that a single machine matches multiple tbls, so there is one limitation:
+ *   at most one tbl is allowed to define for the same vendor and same codec
+ */
+static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
+ SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
+ {0x19, 0x40000000},
+ {0x1b, 0x40000000}),
+ {}
+};
+
 static void alc269_fill_coef(struct hda_codec *codec)
 {
  struct alc_spec *spec = codec->spec;
@@ -7586,6 +7595,7 @@ static int patch_alc269(struct hda_codec *codec)
  snd_hda_pick_fixup(codec, alc269_fixup_models,
        alc269_fixup_tbl, alc269_fixups);
  snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
+ snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
  snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
    alc269_fixups);
  snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
--
2.17.1


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

ACK / APPLIED[E/Unstable]: [SRU][B/OEM-B/D/E/unstable][PATCH 0/2] no sound inputs from the external microphone and headset on a Dell machine

Seth Forshee
In reply to this post by Hui Wang
On Mon, Sep 02, 2019 at 12:28:11PM +0800, Hui Wang wrote:

> BugLink: http://bugs.launchpad.net/bugs/1842265
>
>
> [Impact]
> When we plug an external mic/headset-mic, the system can't
> detect it and as a result can't record sound from it.
>
> [Fix]
> Apply an existing fixup to fix this issue.
>
> [Test Case]
> After applying the patch, plug an external mic or headset-mic,
> system can detect it and can record the sound from it too.
>
>
> [Regression Risk]
> Low. just add an existing fixup to this new machine.

Patches from a maintainer tree, limited scope, positive testing.

Acked-by: Seth Forshee <[hidden email]>

Applied to eoan/master-next and unstable/master, thanks!

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