[alsa-devel] [PATCH 0/5] hda-emu: Add more stuff in hda-spec

After the recent addition of more codecs, the journey towards 0 errors starts over. Here we work around the latest secret stuff the vendors decided to add.
In particular, it would be interesting to have a little more info on the secret IDT EQ verbs, which I just labelled "set_eq_*".
David Henningsson (5): hda-spec: Add fixups for Haswell/Broadwell HDMI hda-spec: Add access to secret node 0x8 for Haswell/Broadwell HDMI hda-spec: Add more secret nodes for Realtek codecs hda-spec: Add secret eq verbs for IDT hda-spec: Add IDT 92HD95 to IDT verb codec list
hda-spec.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 85 insertions(+), 8 deletions(-)

Signed-off-by: David Henningsson david.henningsson@canonical.com --- hda-spec.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/hda-spec.c b/hda-spec.c index 58dd87a..0ff0388 100644 --- a/hda-spec.c +++ b/hda-spec.c @@ -271,6 +271,12 @@ static struct xhda_verb_table nvhdmi_8ch_7x_verbs[] = { { } /* terminator */ };
+static struct xhda_verb_table haswellhdmi_verbs[] = { + { 0x781, set_cached_verb, "intelhdmi_set_vendor_verb" }, + { 0xf81, get_cached_verb, "intelhdmi_get_vendor_verb" }, + { } /* terminator */ +}; + /* */
@@ -445,6 +451,10 @@ static struct verb_ext_list extensions[] = { { .id = 0x10de0006, .verbs = nvhdmi_8ch_7x_verbs }, { .id = 0x10de0007, .verbs = nvhdmi_8ch_7x_verbs },
+ /* Haswell/Broadwell HDMI */ + { .id = 0x80862807, .verbs = haswellhdmi_verbs }, + { .id = 0x80862808, .verbs = haswellhdmi_verbs }, + { } };
@@ -565,6 +575,35 @@ static void fixup_alc268_beep(struct xhda_codec *codec) node->amp_in_caps.override = 1; }
+static void fixup_haswellhdmi(struct xhda_codec *codec) +{ + struct xhda_node *node; + + /* Haswell can run in two modes: either with one cvt 0x2 and one pin 0x3, + or three cvts 0x2, 0x3, 0x4 and three pins 0x5, 0x6, 0x7. + But the connection can be broken in either case. */ + + if (find_node(codec, 0x05)) { + int nid; + for (nid = 0x05; nid <= 0x07; nid++) { + node = find_node(codec, nid); + if (node) { + node->num_nodes = 3; + node->node[0] = 0x2; + node->node[1] = 0x3; + node->node[2] = 0x4; + } + } + } + else { + node = find_node(codec, 0x03); + if (node) { + node->num_nodes = 1; + node->node[0] = 0x2; + } + } +} + struct fixup_list { unsigned int vendor_id; void (*func)(struct xhda_codec *); @@ -603,6 +642,9 @@ static struct fixup_list fixups[] = { { 0x11064761, fixup_vt3476 }, { 0x11064762, fixup_vt3476 },
+ { 0x80862807, fixup_haswellhdmi }, + { 0x80862808, fixup_haswellhdmi }, + { } };

Signed-off-by: David Henningsson david.henningsson@canonical.com --- hda-spec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/hda-spec.c b/hda-spec.c index 0ff0388..fa21cf5 100644 --- a/hda-spec.c +++ b/hda-spec.c @@ -575,6 +575,18 @@ static void fixup_alc268_beep(struct xhda_codec *codec) node->amp_in_caps.override = 1; }
+static int haswell_ext_cmd(struct xhda_codec *codec, unsigned int cmd) +{ + unsigned int nid = (cmd >> 20) & 0x7f; + + codec->rc = 0; + + /* Secret Haswell node on 0x8, used to turn on DP1.2 features */ + if (nid == 0x8) + return 0; + return -ENXIO; +} + static void fixup_haswellhdmi(struct xhda_codec *codec) { struct xhda_node *node; @@ -602,6 +614,8 @@ static void fixup_haswellhdmi(struct xhda_codec *codec) node->node[0] = 0x2; } } + + codec->extended_cmd = haswell_ext_cmd; }
struct fixup_list {

Signed-off-by: David Henningsson david.henningsson@canonical.com --- hda-spec.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/hda-spec.c b/hda-spec.c index fa21cf5..935dcc0 100644 --- a/hda-spec.c +++ b/hda-spec.c @@ -462,17 +462,26 @@ static int realtek_ext_cmd(struct xhda_codec *codec, unsigned int cmd) { unsigned int nid = (cmd >> 20) & 0x7f;
+ codec->rc = 0; + /* just ignore COEFs on ALC260 for non-existing NID 0x20 */ - if (codec->vendor_id == 0x10ec0260 && nid == 0x20) { - codec->rc = 0; + if (codec->vendor_id == 0x10ec0260 && nid == 0x20) + return 0; + + if (codec->vendor_id == 0x10ec0283 && nid == 0x53) + return 0; + + if (codec->vendor_id == 0x10ec0255 && nid == 0x57) + return 0; + + if (codec->vendor_id == 0x10ec0293 && nid == 0x57) return 0; - }
- if (nid != 0x51) - return -ENXIO; /* There might be a secret DSP connected to node 0x51 */ - codec->rc = 0; - return 0; + if (nid == 0x51) + return 0; + + return -ENXIO; }
/*

These verbs exist according to the driver, but we know nothing about them, except they are used to calibrate some EQ.
Signed-off-by: David Henningsson david.henningsson@canonical.com --- hda-spec.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/hda-spec.c b/hda-spec.c index 935dcc0..0f42a2d 100644 --- a/hda-spec.c +++ b/hda-spec.c @@ -113,24 +113,35 @@ static struct xhda_verb_table idt_92hd7xx_verbs[] = { };
/* - * IDT 92HD8xx + * IDT 92HD8xx and 92HD9xx */ static struct xhda_verb_table idt_92hd8xx_verbs[] = { { 0xf70, get_cached_verb, "get_gpio_polarity" }, { 0x770, set_cached_verb, "set_gpio_polarity" }, { 0xf71, get_cached_verb, "get_gpio_drive" }, { 0x771, set_cached_verb, "set_gpio_drive" }, + { 0x772, set_cached_verb, "set_eq_10" }, /* undocumented */ { 0xf74, get_cached_verb, "get_aux_audio" }, { 0x774, set_cached_verb, "set_aux_audio" }, { 0xf78, get_cached_verb, "get_dmic" }, { 0x778, set_cached_verb, "set_dmic" }, { 0xf80, get_cached_verb, "get_dac_mode" }, { 0x780, set_cached_verb, "set_dac_mode" }, + { 0x782, set_cached_verb, "set_eq_9" }, /* undocumented */ { 0xf84, get_cached_verb, "get_adc_mode" }, { 0x784, set_cached_verb, "set_adc_mode" }, { 0xf88, get_cached_verb, "get_eapd_mode" }, { 0x788, set_cached_verb, "set_eapd_mode1" }, { 0x789, set_cached_verb2, "set_eapd_mode2" }, + { 0x7a6, set_cached_verb, "set_eq_1" }, /* undocumented */ + { 0x7a7, set_cached_verb, "set_eq_2" }, /* undocumented */ + { 0x7a8, set_cached_verb, "set_eq_3" }, /* undocumented */ + { 0x7a9, set_cached_verb, "set_eq_4" }, /* undocumented */ + { 0x7aa, set_cached_verb, "set_eq_5" }, /* undocumented */ + { 0x7ab, set_cached_verb, "set_eq_6" }, /* undocumented */ + { 0x7ac, set_cached_verb, "set_eq_7" }, /* undocumented */ + { 0x7ad, set_cached_verb, "set_eq_8" }, /* undocumented */ + { 0x7b0, set_cached_verb, "set_eq_11" }, /* undocumented */ { 0xfc0, get_cached_verb, "get_port_use" }, { 0x7c0, set_cached_verb, "set_port_use" }, { 0x7d8, set_cached_verb, "set_vs_power" },

Signed-off-by: David Henningsson david.henningsson@canonical.com --- hda-spec.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/hda-spec.c b/hda-spec.c index 0f42a2d..5f1ac42 100644 --- a/hda-spec.c +++ b/hda-spec.c @@ -308,6 +308,7 @@ static struct verb_ext_list extensions[] = { { .id = 0x111d7674, .verbs = idt_92hd7xx_verbs }, { .id = 0x111d7675, .verbs = idt_92hd7xx_verbs }, { .id = 0x111d7676, .verbs = idt_92hd7xx_verbs }, + { .id = 0x111d7695, .verbs = idt_92hd7xx_verbs }, { .id = 0x111d76b0, .verbs = idt_92hd7xx_verbs }, { .id = 0x111d76b1, .verbs = idt_92hd7xx_verbs }, { .id = 0x111d76b2, .verbs = idt_92hd7xx_verbs },

At Mon, 22 Sep 2014 13:09:01 +0200, David Henningsson wrote:
After the recent addition of more codecs, the journey towards 0 errors starts over. Here we work around the latest secret stuff the vendors decided to add.
In particular, it would be interesting to have a little more info on the secret IDT EQ verbs, which I just labelled "set_eq_*".
Great, I applied all patches now. Thanks!
Takashi
David Henningsson (5): hda-spec: Add fixups for Haswell/Broadwell HDMI hda-spec: Add access to secret node 0x8 for Haswell/Broadwell HDMI hda-spec: Add more secret nodes for Realtek codecs hda-spec: Add secret eq verbs for IDT hda-spec: Add IDT 92HD95 to IDT verb codec list
hda-spec.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 85 insertions(+), 8 deletions(-)
-- 1.9.1
participants (2)
-
David Henningsson
-
Takashi Iwai