alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] hda-emu: Add more stuff in hda-spec
@ 2014-09-22 11:09 David Henningsson
  2014-09-22 11:09 ` [PATCH 1/5] hda-spec: Add fixups for Haswell/Broadwell HDMI David Henningsson
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: David Henningsson @ 2014-09-22 11:09 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] hda-spec: Add fixups for Haswell/Broadwell HDMI
  2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
@ 2014-09-22 11:09 ` David Henningsson
  2014-09-22 11:09 ` [PATCH 2/5] hda-spec: Add access to secret node 0x8 " David Henningsson
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Henningsson @ 2014-09-22 11:09 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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 },
+
 	{ }
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] hda-spec: Add access to secret node 0x8 for Haswell/Broadwell HDMI
  2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
  2014-09-22 11:09 ` [PATCH 1/5] hda-spec: Add fixups for Haswell/Broadwell HDMI David Henningsson
@ 2014-09-22 11:09 ` David Henningsson
  2014-09-22 11:09 ` [PATCH 3/5] hda-spec: Add more secret nodes for Realtek codecs David Henningsson
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Henningsson @ 2014-09-22 11:09 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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 {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] hda-spec: Add more secret nodes for Realtek codecs
  2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
  2014-09-22 11:09 ` [PATCH 1/5] hda-spec: Add fixups for Haswell/Broadwell HDMI David Henningsson
  2014-09-22 11:09 ` [PATCH 2/5] hda-spec: Add access to secret node 0x8 " David Henningsson
@ 2014-09-22 11:09 ` David Henningsson
  2014-09-22 11:09 ` [PATCH 4/5] hda-spec: Add secret eq verbs for IDT David Henningsson
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Henningsson @ 2014-09-22 11:09 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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;
 }
 
 /*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] hda-spec: Add secret eq verbs for IDT
  2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
                   ` (2 preceding siblings ...)
  2014-09-22 11:09 ` [PATCH 3/5] hda-spec: Add more secret nodes for Realtek codecs David Henningsson
@ 2014-09-22 11:09 ` David Henningsson
  2014-09-22 11:09 ` [PATCH 5/5] hda-spec: Add IDT 92HD95 to IDT verb codec list David Henningsson
  2014-09-22 12:51 ` [PATCH 0/5] hda-emu: Add more stuff in hda-spec Takashi Iwai
  5 siblings, 0 replies; 7+ messages in thread
From: David Henningsson @ 2014-09-22 11:09 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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" },
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] hda-spec: Add IDT 92HD95 to IDT verb codec list
  2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
                   ` (3 preceding siblings ...)
  2014-09-22 11:09 ` [PATCH 4/5] hda-spec: Add secret eq verbs for IDT David Henningsson
@ 2014-09-22 11:09 ` David Henningsson
  2014-09-22 12:51 ` [PATCH 0/5] hda-emu: Add more stuff in hda-spec Takashi Iwai
  5 siblings, 0 replies; 7+ messages in thread
From: David Henningsson @ 2014-09-22 11:09 UTC (permalink / raw)
  To: tiwai, alsa-devel; +Cc: David Henningsson

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 },
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] hda-emu: Add more stuff in hda-spec
  2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
                   ` (4 preceding siblings ...)
  2014-09-22 11:09 ` [PATCH 5/5] hda-spec: Add IDT 92HD95 to IDT verb codec list David Henningsson
@ 2014-09-22 12:51 ` Takashi Iwai
  5 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2014-09-22 12:51 UTC (permalink / raw)
  To: David Henningsson; +Cc: alsa-devel

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-22 12:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 11:09 [PATCH 0/5] hda-emu: Add more stuff in hda-spec David Henningsson
2014-09-22 11:09 ` [PATCH 1/5] hda-spec: Add fixups for Haswell/Broadwell HDMI David Henningsson
2014-09-22 11:09 ` [PATCH 2/5] hda-spec: Add access to secret node 0x8 " David Henningsson
2014-09-22 11:09 ` [PATCH 3/5] hda-spec: Add more secret nodes for Realtek codecs David Henningsson
2014-09-22 11:09 ` [PATCH 4/5] hda-spec: Add secret eq verbs for IDT David Henningsson
2014-09-22 11:09 ` [PATCH 5/5] hda-spec: Add IDT 92HD95 to IDT verb codec list David Henningsson
2014-09-22 12:51 ` [PATCH 0/5] hda-emu: Add more stuff in hda-spec Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).