Skip to contentSkip to conversation

ALSA: hda - show ICT/KAE control bits

PATCH Applied Wang Xingchao 2 participants 13 messages Aug 13, 2012 Sound

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ALSA: hda - show ICT/KAE control bits

Enable two debug options for S/PDIF Converter Control.
KAE: Keep Alive Enable; ICT: IEC Coding Type.

---
 sound/pci/hda/hda_codec.h |    4 ++++
 sound/pci/hda/hda_proc.c  |    4 ++++
 2 files changed, 8 insertions(+)
sound/pci/hda/hda_codec.h +4 -0
index c422d33..141b3b8 100644
@@ -386,6 +386,10 @@ enum {
 /* DIGITAL2 bits */
 #define AC_DIG2_CC			(0x7f<<0)
 
+/* DIGITAL3 bits */
+#define AC_DIG3_ICT			(0xf<<0)
+#define AC_DIG3_KAE			(1<<23)
+
 /* Pin widget control - 8bit */
 #define AC_PINCTL_EPT			(0x3<<0)
 #define AC_PINCTL_EPT_NATIVE		0
sound/pci/hda/hda_proc.c +4 -0
index 7e46258..a222aae 100644
@@ -419,9 +419,13 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
 		snd_iprintf(buffer, " Pro");
 	if (digi1 & AC_DIG1_LEVEL)
 		snd_iprintf(buffer, " GenLevel");
+	if (digi1 & AC_DIG3_KAE)
+		snd_iprintf(buffer, " KAE");
 	snd_iprintf(buffer, "\n");
 	snd_iprintf(buffer, "  Digital category: 0x%x\n",
 		    (digi1 >> 8) & AC_DIG2_CC);
+	snd_iprintf(buffer, "  IEC Coding Type: 0x%x\n",
+			(digi1 >> 16) & AC_DIG3_ICT);
 }
 
 static const char *get_pwr_state(u32 state)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/3 ALSA: hda - fix Copyright debug message

As spec said, 1 indicates no copyright is asserted.

---
 sound/pci/hda/hda_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index a222aae..bb9e8f9 100644
@@ -412,7 +412,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
 	if (digi1 & AC_DIG1_EMPHASIS)
 		snd_iprintf(buffer, " Preemphasis");
 	if (digi1 & AC_DIG1_COPYRIGHT)
-		snd_iprintf(buffer, " Copyright");
+		snd_iprintf(buffer, " Non-Copyright");
 	if (digi1 & AC_DIG1_NONAUDIO)
 		snd_iprintf(buffer, " Non-Audio");
 	if (digi1 & AC_DIG1_PROFESSIONAL)
Signature · 1 line
1.7.9.5
Applied
#2 lore raw

Re: [PATCH 2/3] ALSA: hda - fix Copyright debug message

At Mon, 13 Aug 2012 14:11:10 +0800,

Quoted 4 lines · Wang Xingchao

As spec said, 1 indicates no copyright is asserted.

Applied to for-linus branch (to be merge to 3.6 kernel). I also added Cc to stable, as this is an obvious bug to be fixed.

thanks,

Takashi

Quoted 25 lines
---
 sound/pci/hda/hda_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_proc.c +1 -1
index a222aae..bb9e8f9 100644
@@ -412,7 +412,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
 	if (digi1 & AC_DIG1_EMPHASIS)
 		snd_iprintf(buffer, " Preemphasis");
 	if (digi1 & AC_DIG1_COPYRIGHT)
-		snd_iprintf(buffer, " Copyright");
+		snd_iprintf(buffer, " Non-Copyright");
 	if (digi1 & AC_DIG1_NONAUDIO)
 		snd_iprintf(buffer, " Non-Audio");
 	if (digi1 & AC_DIG1_PROFESSIONAL)
Signature · 6 lines
1.7.9.5

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#3 lore raw

PATCH 3/3 ALSA: hda - Disable DigEn bit before stream-id change

In reply to Wang Xingchao

Follow the protection way in nvhdmi_8ch_7x_pcm_prepare().

---
 sound/pci/hda/patch_hdmi.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
sound/pci/hda/patch_hdmi.c +15 -0
index 641408d..aa414b9 100644
@@ -831,6 +831,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
 {
 	int pinctl;
 	int new_pinctl = 0;
+	struct hda_spdif_out *spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid);
 
 	if (snd_hda_query_pin_caps(codec, pin_nid) & AC_PINCAP_HBR) {
 		pinctl = snd_hda_codec_read(codec, pin_nid, 0,
@@ -859,7 +860,21 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
 		return -EINVAL;
 	}
 
+	/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
+	if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE))
+		snd_hda_codec_write(codec,
+				cvt_nid,
+				0,
+				AC_VERB_SET_DIGI_CONVERT_1,
+				spdif->ctls & ~AC_DIG1_ENABLE & 0xff);
 	snd_hda_codec_setup_stream(codec, cvt_nid, stream_tag, 0, format);
+	/* turn on again (if needed) */
+	if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE))
+		snd_hda_codec_write(codec,
+				cvt_nid,
+				0,
+				AC_VERB_SET_DIGI_CONVERT_1,
+				spdif->ctls & 0xff);
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
#4 lore raw

Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 14:11:11 +0800,

Quoted 2 lines · Wang Xingchao

Follow the protection way in nvhdmi_8ch_7x_pcm_prepare().

Could you clarify why this is needed?

I don't mean an objection, but just need to know if there is any other devices that need this fix. If there really is, better to put a bit more details in changelog or comment.

thanks,

Takashi

Quoted 43 lines
---
 sound/pci/hda/patch_hdmi.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
sound/pci/hda/patch_hdmi.c +15 -0
index 641408d..aa414b9 100644
@@ -831,6 +831,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
 {
 	int pinctl;
 	int new_pinctl = 0;
+	struct hda_spdif_out *spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid);
 
 	if (snd_hda_query_pin_caps(codec, pin_nid) & AC_PINCAP_HBR) {
 		pinctl = snd_hda_codec_read(codec, pin_nid, 0,
@@ -859,7 +860,21 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
 		return -EINVAL;
 	}
 
+	/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
+	if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE))
+		snd_hda_codec_write(codec,
+				cvt_nid,
+				0,
+				AC_VERB_SET_DIGI_CONVERT_1,
+				spdif->ctls & ~AC_DIG1_ENABLE & 0xff);
 	snd_hda_codec_setup_stream(codec, cvt_nid, stream_tag, 0, format);
+	/* turn on again (if needed) */
+	if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE))
+		snd_hda_codec_write(codec,
+				cvt_nid,
+				0,
+				AC_VERB_SET_DIGI_CONVERT_1,
+				spdif->ctls & 0xff);
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

Quoted 12 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 13, 2012 3:32 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 14:11:11 +0800,

Quoted 1 line · Wang Xingchao
Quoted 7 lines
Quoted 1 line

Follow the protection way in nvhdmi_8ch_7x_pcm_prepare().

Could you clarify why this is needed?

I don't mean an objection, but just need to know if there is any other devices that need this fix. If there really is, better to put a bit more details in changelog or comment.

No, it's not really a fix for the issue.
I just found the change when to investigate HDMI HBR issue and it does NOT help fix the issue. However I thought it's a fix to some other bug(seen from comments), so I think it's also needed as a common solution. Please correct me if I am wrong.

Thanks
--xingchao

#6 lore raw

Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 07:37:12 +0000,

Quoted 17 lines · Xingchao
Quoted 16 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 13, 2012 3:32 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 14:11:11 +0800,

Quoted 2 lines · Wang Xingchao

Follow the protection way in nvhdmi_8ch_7x_pcm_prepare().

Could you clarify why this is needed?

Quoted 8 lines
Quoted 3 lines

I don't mean an objection, but just need to know if there is any other devices that need this fix. If there really is, better to put a bit more details in changelog or comment.

No, it's not really a fix for the issue.
I just found the change when to investigate HDMI HBR issue and it does NOT help fix the issue. However I thought it's a fix to some other bug(seen from comments), so I think it's also needed as a common solution. Please correct me if I am wrong.

I guess this was copied from setup_dig_out_stream() in hda_codec.c. This was a workaround for SPDIF output on some old non-HDMI codecs. But most of recent codecs shouldn't need it. You see that it's protected by codec->spdif_status_reset check.

Takashi

#7 lore raw

Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 09:51:33 +0200,

Quoted 29 lines · Takashi Iwai

At Mon, 13 Aug 2012 07:37:12 +0000,

Quoted 17 lines · Xingchao
Quoted 16 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 13, 2012 3:32 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 14:11:11 +0800,

Quoted 2 lines · Wang Xingchao

Follow the protection way in nvhdmi_8ch_7x_pcm_prepare().

Could you clarify why this is needed?

Quoted 8 lines
Quoted 3 lines

I don't mean an objection, but just need to know if there is any other devices that need this fix. If there really is, better to put a bit more details in changelog or comment.

No, it's not really a fix for the issue.
I just found the change when to investigate HDMI HBR issue and it does NOT help fix the issue. However I thought it's a fix to some other bug(seen from comments), so I think it's also needed as a common solution. Please correct me if I am wrong.

Quoted 4 lines

I guess this was copied from setup_dig_out_stream() in hda_codec.c. This was a workaround for SPDIF output on some old non-HDMI codecs. But most of recent codecs shouldn't need it. You see that it's protected by codec->spdif_status_reset check.

BTW, you might have forgotten to set codec->spdif_status_reset = 1 during your test? Otherwise the code there isn't activated.

Though, this doesn't explain why it worked for nvidia and not for Intel. The IEC958 status temporary toggle code isn't active even for Nvidia, too.

Takashi

#8 lore raw

Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

Quoted 42 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 13, 2012 4:05 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

At Mon, 13 Aug 2012 09:51:33 +0200,

Quoted 26 lines · Takashi Iwai

At Mon, 13 Aug 2012 07:37:12 +0000,

Quoted 23 lines · Xingchao
Quoted 13 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 13, 2012 3:32 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [PATCH 3/3] ALSA: hda - Disable DigEn bit before stream-id change

Quoted 1 line · Wang Xingchao
Quoted 7 lines
Quoted 1 line

Follow the protection way in nvhdmi_8ch_7x_pcm_prepare().

Could you clarify why this is needed?

I don't mean an objection, but just need to know if there is any other devices that need this fix. If there really is, better to put a bit more details in changelog or comment.

No, it's not really a fix for the issue.
I just found the change when to investigate HDMI HBR issue and it does

NOT help fix the issue.

Quoted 2 lines
Quoted 2 lines

However I thought it's a fix to some other bug(seen from comments), so I think it's also needed as a common solution. Please correct me if I am

wrong.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

I guess this was copied from setup_dig_out_stream() in hda_codec.c. This was a workaround for SPDIF output on some old non-HDMI codecs. But most of recent codecs shouldn't need it. You see that it's protected by codec->spdif_status_reset check.

BTW, you might have forgotten to set codec->spdif_status_reset = 1 during your test? Otherwise the code there isn't activated.

Oh, thanks for clarification, will test that again. :)

Quoted 3 lines

Though, this doesn't explain why it worked for nvidia and not for Intel. The IEC958 status temporary toggle code isn't active even for Nvidia, too.

Thanks
--xingchao

#9 lore raw
In reply to Wang Xingchao

At Mon, 13 Aug 2012 14:11:09 +0800,

Quoted 15 lines · Wang Xingchao

Enable two debug options for S/PDIF Converter Control.
KAE: Keep Alive Enable; ICT: IEC Coding Type.

---
 sound/pci/hda/hda_codec.h |    4 ++++
 sound/pci/hda/hda_proc.c  |    4 ++++
 2 files changed, 8 insertions(+)
sound/pci/hda/hda_codec.h +0 -0
index c422d33..141b3b8 100644

sound/pci/hda/hda_codec.h enum { · line 391

Quoted 6 lines
sound/pci/hda/hda_codec.h +3 -0
@@ -386,6 +386,10 @@ enum {
 /* DIGITAL2 bits */
 #define AC_DIG2_CC			(0x7f<<0)
 
+/* DIGITAL3 bits */
+#define AC_DIG3_ICT			(0xf<<0)
+#define AC_DIG3_KAE			(1<<23)

For DIG3, it should be 1<<7. (dig3 begins from bit 16.)

sound/pci/hda/hda_proc.c static void print_digital_conv(struct snd_info_buffer *buffer, · line 421

Quoted 12 lines
sound/pci/hda/hda_codec.h +1 -0
+
 /* Pin widget control - 8bit */
 #define AC_PINCTL_EPT			(0x3<<0)
 #define AC_PINCTL_EPT_NATIVE		0
sound/pci/hda/hda_proc.c +0 -0
index 7e46258..a222aae 100644
@@ -419,9 +419,13 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
 		snd_iprintf(buffer, " Pro");
 	if (digi1 & AC_DIG1_LEVEL)
 		snd_iprintf(buffer, " GenLevel");

Comparing dig1 and dig3 bitmask looks strange.
For clarity, better to have

	unsigned char dig3;
	...
	dig3 = dig1 >> 16;
	if (dig3 & AC_DIG3_KAE)
		snd_iprintf(buffer, " KAE");
	...
	snd_iprintf(buffer, "  IEC Coding Type: 0x%x\n",
			dig3 & AC_DIG3_ICT);

Takashi

#10 lore raw
Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Takashi Iwai
Sent: Monday, August 13, 2012 3:38 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [alsa-devel] [PATCH 1/3] ALSA: hda - show ICT/KAE control bits

At Mon, 13 Aug 2012 14:11:09 +0800,

Quoted 18 lines · Wang Xingchao

Enable two debug options for S/PDIF Converter Control.
KAE: Keep Alive Enable; ICT: IEC Coding Type.

---
 sound/pci/hda/hda_codec.h |    4 ++++
 sound/pci/hda/hda_proc.c  |    4 ++++
 2 files changed, 8 insertions(+)
sound/pci/hda/hda_codec.h +0 -0
index c422d33..141b3b8 100644
@@ -386,6 +386,10 @@ enum {
 /* DIGITAL2 bits */
 #define AC_DIG2_CC			(0x7f<<0)
 
Quoted 5 lines

sound/pci/hda/hda_codec.h enum { · line 391

Quoted 3 lines
sound/pci/hda/hda_codec.h +3 -0
+/* DIGITAL3 bits */
+#define AC_DIG3_ICT			(0xf<<0)
+#define AC_DIG3_KAE			(1<<23)

For DIG3, it should be 1<<7. (dig3 begins from bit 16.)

Okay.

Quoted 11 lines

sound/pci/hda/hda_proc.c static void print_digital_conv(struct snd_info_buffer

Quoted 10 lines
sound/pci/hda/hda_codec.h +1 -0
+
 /* Pin widget control - 8bit */
 #define AC_PINCTL_EPT			(0x3<<0)
 #define AC_PINCTL_EPT_NATIVE		0
sound/pci/hda/hda_proc.c index renamed from sound/pci/hda/hda_proc.c +0 -0

7e46258..a222aae 100644

sound/pci/hda/hda_proc.c +0 -0
@@ -419,9 +419,13 @@ static void print_digital_conv(struct snd_info_buffer

*buffer,

Quoted 5 lines

sound/pci/hda/hda_proc.c static void print_digital_conv(struct snd_info_buffer *buffer, · line 421

Quoted 3 lines
sound/pci/hda/hda_proc.c +0 -0
 		snd_iprintf(buffer, " Pro");
 	if (digi1 & AC_DIG1_LEVEL)
 		snd_iprintf(buffer, " GenLevel");

Comparing dig1 and dig3 bitmask looks strange.

What about also add digi2 to specify AC_DIG1_LEVEL and CC? They are bit 7:14.

Quoted 10 lines

For clarity, better to have

	unsigned char dig3;
	...
	dig3 = dig1 >> 16;
	if (dig3 & AC_DIG3_KAE)
		snd_iprintf(buffer, " KAE");
	...
	snd_iprintf(buffer, "  IEC Coding Type: 0x%x\n",
			dig3 & AC_DIG3_ICT);

Okay, I will fix that in next version.
Thanks your review, Takashi. :)

thanks
--xingchao

#11 lore raw

At Mon, 13 Aug 2012 07:49:40 +0000,

Quoted 49 lines · Xingchao
Quoted 31 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Takashi Iwai
Sent: Monday, August 13, 2012 3:38 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [alsa-devel] [PATCH 1/3] ALSA: hda - show ICT/KAE control bits

At Mon, 13 Aug 2012 14:11:09 +0800,

Quoted 18 lines · Wang Xingchao

Enable two debug options for S/PDIF Converter Control.
KAE: Keep Alive Enable; ICT: IEC Coding Type.

---
 sound/pci/hda/hda_codec.h |    4 ++++
 sound/pci/hda/hda_proc.c  |    4 ++++
 2 files changed, 8 insertions(+)
sound/pci/hda/hda_codec.h +0 -0
index c422d33..141b3b8 100644
@@ -386,6 +386,10 @@ enum {
 /* DIGITAL2 bits */
 #define AC_DIG2_CC			(0x7f<<0)
 
Quoted 5 lines

sound/pci/hda/hda_codec.h enum { · line 391

Quoted 3 lines
sound/pci/hda/hda_codec.h +3 -0
+/* DIGITAL3 bits */
+#define AC_DIG3_ICT			(0xf<<0)
+#define AC_DIG3_KAE			(1<<23)

For DIG3, it should be 1<<7. (dig3 begins from bit 16.)

Okay.

Quoted 11 lines

sound/pci/hda/hda_proc.c static void print_digital_conv(struct snd_info_buffer

Quoted 10 lines
sound/pci/hda/hda_codec.h +1 -0
+
 /* Pin widget control - 8bit */
 #define AC_PINCTL_EPT			(0x3<<0)
 #define AC_PINCTL_EPT_NATIVE		0
sound/pci/hda/hda_proc.c index renamed from sound/pci/hda/hda_proc.c +0 -0

7e46258..a222aae 100644

sound/pci/hda/hda_proc.c +0 -0
@@ -419,9 +419,13 @@ static void print_digital_conv(struct snd_info_buffer

*buffer,

Quoted 7 lines
Quoted 5 lines

sound/pci/hda/hda_proc.c static void print_digital_conv(struct snd_info_buffer *buffer, · line 421

Quoted 3 lines
sound/pci/hda/hda_proc.c +0 -0
 		snd_iprintf(buffer, " Pro");
 	if (digi1 & AC_DIG1_LEVEL)
 		snd_iprintf(buffer, " GenLevel");

Comparing dig1 and dig3 bitmask looks strange.

What about also add digi2 to specify AC_DIG1_LEVEL and CC? They are bit 7:14.

These are DIG1_LEVEL is dig1.
DIG2_CC isn't _compared_ with dig1. But it would be clearer if it's deduced from dig2, yes.

Quoted 12 lines
Quoted 11 lines

For clarity, better to have

	unsigned char dig3;
	...
	dig3 = dig1 >> 16;
	if (dig3 & AC_DIG3_KAE)
		snd_iprintf(buffer, " KAE");
	...
	snd_iprintf(buffer, "  IEC Coding Type: 0x%x\n",
			dig3 & AC_DIG3_ICT);
Quoted 2 lines

Okay, I will fix that in next version.
Thanks your review, Takashi. :)

thanks,

Takashi

#12 lore raw
Quoted 67 lines

-----Original Message-----
From: Takashi Iwai [mailto:[email protected]]
Sent: Monday, August 13, 2012 3:54 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [alsa-devel] [PATCH 1/3] ALSA: hda - show ICT/KAE control bits

At Mon, 13 Aug 2012 07:49:40 +0000,

Quoted 56 lines · Xingchao
Quoted 33 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Takashi Iwai
Sent: Monday, August 13, 2012 3:38 PM
To: Wang, Xingchao
Cc: [email protected]
Subject: Re: [alsa-devel] [PATCH 1/3] ALSA: hda - show ICT/KAE control bits

At Mon, 13 Aug 2012 14:11:09 +0800,

Quoted 18 lines · Wang Xingchao

Enable two debug options for S/PDIF Converter Control.
KAE: Keep Alive Enable; ICT: IEC Coding Type.

---
 sound/pci/hda/hda_codec.h |    4 ++++
 sound/pci/hda/hda_proc.c  |    4 ++++
 2 files changed, 8 insertions(+)
sound/pci/hda/hda_codec.h +0 -0
index c422d33..141b3b8 100644
@@ -386,6 +386,10 @@ enum {
 /* DIGITAL2 bits */
 #define AC_DIG2_CC			(0x7f<<0)
 
Quoted 5 lines

sound/pci/hda/hda_codec.h enum { · line 391

Quoted 3 lines
sound/pci/hda/hda_codec.h +3 -0
+/* DIGITAL3 bits */
+#define AC_DIG3_ICT			(0xf<<0)
+#define AC_DIG3_KAE			(1<<23)

For DIG3, it should be 1<<7. (dig3 begins from bit 16.)

Okay.

Quoted 16 lines
Quoted 11 lines
sound/pci/hda/hda_codec.h +1 -0
+
 /* Pin widget control - 8bit */
 #define AC_PINCTL_EPT			(0x3<<0)
 #define AC_PINCTL_EPT_NATIVE		0
sound/pci/hda/hda_proc.c +0 -0
index 7e46258..a222aae 100644
@@ -419,9 +419,13 @@ static void print_digital_conv(struct

snd_info_buffer

*buffer,

Quoted 3 lines
sound/pci/hda/hda_proc.c +0 -0
 		snd_iprintf(buffer, " Pro");
 	if (digi1 & AC_DIG1_LEVEL)
 		snd_iprintf(buffer, " GenLevel");
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Comparing dig1 and dig3 bitmask looks strange.

What about also add digi2 to specify AC_DIG1_LEVEL and CC? They are bit

7:14.

These are DIG1_LEVEL is dig1.
DIG2_CC isn't _compared_ with dig1. But it would be clearer if it's deduced from dig2, yes.

Yeah, I made the v2 change.

Thanks
--xingchao