public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alsa: Intel HDA output and align Ids.
@ 2009-03-20 13:00 Pascal de Bruijn | Unilogic Networks B.V.
  2009-03-20 14:22 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Pascal de Bruijn | Unilogic Networks B.V. @ 2009-03-20 13:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: alsa-devel

Output Intel HDA Function Id in /proc/asound/cardX/codec#X
Align Vendor/Subsystem/Revision Ids to 8 characters, front-padded with zeros

As submitted to Kernel Bugzilla #12888

Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>

diff -Nurp linux-2.6.28.8-orig/sound/pci/hda/hda_codec.c linux-2.6.28.8-func/sound/pci/hda/hda_codec.c
--- linux-2.6.28.8-orig/sound/pci/hda/hda_codec.c	2009-03-17 01:50:03.000000000 +0100
+++ linux-2.6.28.8-func/sound/pci/hda/hda_codec.c	2009-03-17 10:39:45.000000000 +0100
@@ -519,9 +519,8 @@ static void __devinit setup_fg_nodes(str
 
 	total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
 	for (i = 0; i < total_nodes; i++, nid++) {
-		unsigned int func;
-		func = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE);
-		switch (func & 0xff) {
+		codec->function_id = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE) & 0xff;
+		switch (codec->function_id) {
 		case AC_GRP_AUDIO_FUNCTION:
 			codec->afg = nid;
 			break;
diff -Nurp linux-2.6.28.8-orig/sound/pci/hda/hda_codec.h linux-2.6.28.8-func/sound/pci/hda/hda_codec.h
--- linux-2.6.28.8-orig/sound/pci/hda/hda_codec.h	2009-03-17 01:50:03.000000000 +0100
+++ linux-2.6.28.8-func/sound/pci/hda/hda_codec.h	2009-03-17 10:39:45.000000000 +0100
@@ -693,6 +693,7 @@ struct hda_codec {
 	hda_nid_t mfg;	/* MFG node id */
 
 	/* ids */
+	u32 function_id;
 	u32 vendor_id;
 	u32 subsystem_id;
 	u32 revision_id;
diff -Nurp linux-2.6.28.8-orig/sound/pci/hda/hda_proc.c linux-2.6.28.8-func/sound/pci/hda/hda_proc.c
--- linux-2.6.28.8-orig/sound/pci/hda/hda_proc.c	2009-03-17 01:50:03.000000000 +0100
+++ linux-2.6.28.8-func/sound/pci/hda/hda_proc.c	2009-03-17 10:40:08.000000000 +0100
@@ -520,9 +520,10 @@ static void print_codec_info(struct snd_
 	snd_hda_get_codec_name(codec, buf, sizeof(buf));
 	snd_iprintf(buffer, "Codec: %s\n", buf);
 	snd_iprintf(buffer, "Address: %d\n", codec->addr);
-	snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id);
-	snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id);
-	snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
+	snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id);
+	snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
+	snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
+	snd_iprintf(buffer, "Revision Id: 0x%08x\n", codec->revision_id);
 
 	if (codec->mfg)
 		snd_iprintf(buffer, "Modem Function Group: 0x%x\n", codec->mfg);




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

* Re: [PATCH] alsa: Intel HDA output and align Ids.
  2009-03-20 13:00 Pascal de Bruijn | Unilogic Networks B.V.
@ 2009-03-20 14:22 ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-03-20 14:22 UTC (permalink / raw)
  To: Pascal de Bruijn | Unilogic Networks B.V.; +Cc: linux-kernel, alsa-devel

At Fri, 20 Mar 2009 14:00:56 +0100,
Pascal de Bruijn | Unilogic Networks B.V. wrote:
> 
> Output Intel HDA Function Id in /proc/asound/cardX/codec#X
> Align Vendor/Subsystem/Revision Ids to 8 characters, front-padded with zeros
> 
> As submitted to Kernel Bugzilla #12888
> 
> Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>

Thanks for the patch.
The changes look OK, but could you make a patch against the latest
2.6.29-rc tree, and fix a coding issue reported by checkpatch.pl?

Also, a bit more explanatory subject would be helpful...


Takashi

> 
> diff -Nurp linux-2.6.28.8-orig/sound/pci/hda/hda_codec.c linux-2.6.28.8-func/sound/pci/hda/hda_codec.c
> --- linux-2.6.28.8-orig/sound/pci/hda/hda_codec.c	2009-03-17 01:50:03.000000000 +0100
> +++ linux-2.6.28.8-func/sound/pci/hda/hda_codec.c	2009-03-17 10:39:45.000000000 +0100
> @@ -519,9 +519,8 @@ static void __devinit setup_fg_nodes(str
>  
>  	total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
>  	for (i = 0; i < total_nodes; i++, nid++) {
> -		unsigned int func;
> -		func = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE);
> -		switch (func & 0xff) {
> +		codec->function_id = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE) & 0xff;
> +		switch (codec->function_id) {
>  		case AC_GRP_AUDIO_FUNCTION:
>  			codec->afg = nid;
>  			break;
> diff -Nurp linux-2.6.28.8-orig/sound/pci/hda/hda_codec.h linux-2.6.28.8-func/sound/pci/hda/hda_codec.h
> --- linux-2.6.28.8-orig/sound/pci/hda/hda_codec.h	2009-03-17 01:50:03.000000000 +0100
> +++ linux-2.6.28.8-func/sound/pci/hda/hda_codec.h	2009-03-17 10:39:45.000000000 +0100
> @@ -693,6 +693,7 @@ struct hda_codec {
>  	hda_nid_t mfg;	/* MFG node id */
>  
>  	/* ids */
> +	u32 function_id;
>  	u32 vendor_id;
>  	u32 subsystem_id;
>  	u32 revision_id;
> diff -Nurp linux-2.6.28.8-orig/sound/pci/hda/hda_proc.c linux-2.6.28.8-func/sound/pci/hda/hda_proc.c
> --- linux-2.6.28.8-orig/sound/pci/hda/hda_proc.c	2009-03-17 01:50:03.000000000 +0100
> +++ linux-2.6.28.8-func/sound/pci/hda/hda_proc.c	2009-03-17 10:40:08.000000000 +0100
> @@ -520,9 +520,10 @@ static void print_codec_info(struct snd_
>  	snd_hda_get_codec_name(codec, buf, sizeof(buf));
>  	snd_iprintf(buffer, "Codec: %s\n", buf);
>  	snd_iprintf(buffer, "Address: %d\n", codec->addr);
> -	snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id);
> -	snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id);
> -	snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
> +	snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id);
> +	snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
> +	snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
> +	snd_iprintf(buffer, "Revision Id: 0x%08x\n", codec->revision_id);
>  
>  	if (codec->mfg)
>  		snd_iprintf(buffer, "Modem Function Group: 0x%x\n", codec->mfg);
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

* [PATCH] alsa: Intel HDA output and align Ids.
@ 2009-03-23 10:15 Pascal de Bruijn | Unilogic Networks B.V.
  2009-03-23 10:59 ` [alsa-devel] " Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Pascal de Bruijn | Unilogic Networks B.V. @ 2009-03-23 10:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: alsa-devel

This patch does two things:
 Output Intel HDA Function Id in /proc/asound/cardX/codec#X
 Align Vendor/Subsystem/Revision Ids to 8 characters, front-padded with zeros

Before:
 Vendor Id: 0x11d41884
 Subsystem Id: 0x103c281a
 Revision Id: 0x100100

After:
 Function Id: 0x1
 Vendor Id: 0x11d41884
 Subsystem Id: 0x103c281a
 Revision Id: 0x0100100

As report on the Kernel Bugzilla #12888

Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>

diff -Nurp linux-2.6.29-rc8-orig/sound/pci/hda/hda_codec.c linux-2.6.29-rc8-func/sound/pci/hda/hda_codec.c
--- linux-2.6.29-rc8-orig/sound/pci/hda/hda_codec.c	2009-03-20 16:05:15.000000000 +0100
+++ linux-2.6.29-rc8-func/sound/pci/hda/hda_codec.c	2009-03-23 10:37:30.000000000 +0100
@@ -647,9 +647,9 @@ static void /*__devinit*/ setup_fg_nodes
 
 	total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid);
 	for (i = 0; i < total_nodes; i++, nid++) {
-		unsigned int func;
-		func = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE);
-		switch (func & 0xff) {
+		codec->function_id = snd_hda_param_read(codec, nid,
+						AC_PAR_FUNCTION_TYPE) & 0xff;
+		switch (codec->function_id) {
 		case AC_GRP_AUDIO_FUNCTION:
 			codec->afg = nid;
 			break;
diff -Nurp linux-2.6.29-rc8-orig/sound/pci/hda/hda_codec.h linux-2.6.29-rc8-func/sound/pci/hda/hda_codec.h
--- linux-2.6.29-rc8-orig/sound/pci/hda/hda_codec.h	2009-03-20 16:05:15.000000000 +0100
+++ linux-2.6.29-rc8-func/sound/pci/hda/hda_codec.h	2009-03-20 16:10:07.000000000 +0100
@@ -739,6 +739,7 @@ struct hda_codec {
 	hda_nid_t mfg;	/* MFG node id */
 
 	/* ids */
+	u32 function_id;
 	u32 vendor_id;
 	u32 subsystem_id;
 	u32 revision_id;
diff -Nurp linux-2.6.29-rc8-orig/sound/pci/hda/hda_proc.c linux-2.6.29-rc8-func/sound/pci/hda/hda_proc.c
--- linux-2.6.29-rc8-orig/sound/pci/hda/hda_proc.c	2009-03-20 16:05:15.000000000 +0100
+++ linux-2.6.29-rc8-func/sound/pci/hda/hda_proc.c	2009-03-20 16:10:07.000000000 +0100
@@ -467,8 +467,9 @@ static void print_codec_info(struct snd_
 	snd_iprintf(buffer, "Codec: %s\n",
 		    codec->name ? codec->name : "Not Set");
 	snd_iprintf(buffer, "Address: %d\n", codec->addr);
-	snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id);
-	snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id);
+	snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id);
+	snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
+	snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
 	snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
 
 	if (codec->mfg)



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

* Re: [alsa-devel] [PATCH] alsa: Intel HDA output and align Ids.
  2009-03-23 10:15 [PATCH] alsa: Intel HDA output and align Ids Pascal de Bruijn | Unilogic Networks B.V.
@ 2009-03-23 10:59 ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-03-23 10:59 UTC (permalink / raw)
  To: Pascal de Bruijn | Unilogic Networks B.V.; +Cc: linux-kernel, alsa-devel

At Mon, 23 Mar 2009 11:15:59 +0100,
Pascal de Bruijn | Unilogic Networks B.V. wrote:
> 
> This patch does two things:
>  Output Intel HDA Function Id in /proc/asound/cardX/codec#X
>  Align Vendor/Subsystem/Revision Ids to 8 characters, front-padded with zeros
> 
> Before:
>  Vendor Id: 0x11d41884
>  Subsystem Id: 0x103c281a
>  Revision Id: 0x100100
> 
> After:
>  Function Id: 0x1
>  Vendor Id: 0x11d41884
>  Subsystem Id: 0x103c281a
>  Revision Id: 0x0100100
> 
> As report on the Kernel Bugzilla #12888
> 
> Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net>

Applied now.  Thanks!


Takashi

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

end of thread, other threads:[~2009-03-23 10:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-23 10:15 [PATCH] alsa: Intel HDA output and align Ids Pascal de Bruijn | Unilogic Networks B.V.
2009-03-23 10:59 ` [alsa-devel] " Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2009-03-20 13:00 Pascal de Bruijn | Unilogic Networks B.V.
2009-03-20 14:22 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox