Commit cd72c317a0a11f64225b9a3f1fe503bb8c7327b5

Authored by Kai-Heng Feng
Committed by Takashi Iwai
1 parent 559ff03fa3

ALSA: hda/hdmi: Add quirk to force connectivity

HDMI on some platforms doesn't enable audio support because its Port
Connectivity [31:30] is set to AC_JACK_PORT_NONE:
Node 0x05 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0b000094: OUT Detect HBR HDMI DP
  Pin Default 0x58560010: [N/A] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Power states:  D0 D3 EPSS
  Power: setting=D0, actual=D0
  Devices: 0
  Connection: 3
     0x02 0x03* 0x04

For now, use a quirk to force connectivity based on SSID. If there are
more platforms affected by the same issue, we can eye for a more generic
solution.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200804155836.16252-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 15 additions and 1 deletions Side-by-side Diff

sound/pci/hda/patch_hdmi.c
... ... @@ -165,6 +165,7 @@
165 165  
166 166 bool use_acomp_notifier; /* use eld_notify callback for hotplug */
167 167 bool acomp_registered; /* audio component registered in this driver */
  168 + bool force_connect; /* force connectivity */
168 169 struct drm_audio_component_audio_ops drm_audio_ops;
169 170 int (*port2pin)(struct hda_codec *, int); /* reverse port/pin mapping */
170 171  
... ... @@ -1758,7 +1759,8 @@
1758 1759 * all device entries on the same pin
1759 1760 */
1760 1761 config = snd_hda_codec_get_pincfg(codec, pin_nid);
1761   - if (get_defcfg_connect(config) == AC_JACK_PORT_NONE)
  1762 + if (get_defcfg_connect(config) == AC_JACK_PORT_NONE &&
  1763 + !spec->force_connect)
1762 1764 return 0;
1763 1765  
1764 1766 /*
1765 1767  
1766 1768  
1767 1769  
... ... @@ -1860,17 +1862,29 @@
1860 1862 return 0;
1861 1863 }
1862 1864  
  1865 +static const struct snd_pci_quirk force_connect_list[] = {
  1866 + SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
  1867 + {}
  1868 +};
  1869 +
1863 1870 static int hdmi_parse_codec(struct hda_codec *codec)
1864 1871 {
  1872 + struct hdmi_spec *spec = codec->spec;
1865 1873 hda_nid_t start_nid;
1866 1874 unsigned int caps;
1867 1875 int i, nodes;
  1876 + const struct snd_pci_quirk *q;
1868 1877  
1869 1878 nodes = snd_hda_get_sub_nodes(codec, codec->core.afg, &start_nid);
1870 1879 if (!start_nid || nodes < 0) {
1871 1880 codec_warn(codec, "HDMI: failed to get afg sub nodes\n");
1872 1881 return -EINVAL;
1873 1882 }
  1883 +
  1884 + q = snd_pci_quirk_lookup(codec->bus->pci, force_connect_list);
  1885 +
  1886 + if (q && q->value)
  1887 + spec->force_connect = true;
1874 1888  
1875 1889 /*
1876 1890 * hdmi_add_pin() assumes total amount of converters to