Hi,
On Wed, 27 Nov 2019, Takashi Iwai wrote:
On Wed, 27 Nov 2019 12:25:36 +0100, Kai Vehmanen wrote:
@@ -1312,10 +1316,19 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
[...]
- if (spec->intel_hsw_fixup) {
intel_haswell_fixup_connect_list(codec, pin_nid);
conns = snd_hda_get_connections(codec, pin_nid,
per_pin->mux_nids,
HDA_MAX_CONNECTIONS);
- } else {
conns = snd_hda_get_raw_connections(codec, pin_nid,
per_pin->mux_nids,
HDA_MAX_CONNECTIONS);
- }
Actually intel_haswell_fixup_connect_list() doesn't influence on the hardware setup but just updates the software cache. So, basically we can copy the values directly from spec->cvt_nids here without the override hack as we have now.
That is, something like
if (spec->intel_hsw_fixup) { conns = spec->cvt_nids; memcpy(per_pin->mux_nids, spec->num_cvts, sizeof(hda_nid_t) * conns); } else { snd_hda_set_dev_select(codec, pin_nid, dev_id); conns = snd_hda_get_raw_connections(codec, pin_nid, per_pin->mux_nids, HDA_MAX_CONNECTIONS); }
Could you check whether this works?
hmm, you are right, this should work. spec->cvt_nids and spec->num_cvts were reversed in the proto code :), but otherwise looks ok based on a few tests. I'll send a v2 patch shortly. This simplifies the code as well.
Br, Kai