All of lore.kernel.org
 help / color / mirror / Atom feed
* (no subject)
@ 2008-11-11  2:43 Yang, Libin
  2008-11-11  8:17 ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Yang, Libin @ 2008-11-11  2:43 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Hi Takashi,

This patch is to support detecting new AMD HD Audio devices with HDA PCI
class code. Would you please review it? Thanks a lot!
--------------------------------------------------------------------

Signed-off-by: Libin Yang <libin.yang@amd.com>

--- alsa-driver-1.0.18.orig/alsa-kernel/pci/hda/hda_intel.c
2008-10-29 20:41:35.000000000 +0800
+++ alsa-driver-1.0.18/alsa-kernel/pci/hda/hda_intel.c	2008-11-11
18:33:14.000000000 +0800
@@ -291,6 +291,7 @@
 /* Define VIA HD Audio Device ID*/
 #define VIA_HDAC_DEVICE_ID		0x3288
 
+#define PCI_CLASS_MULTIMEDIA_HDA	0x040300
 
 /*
  */
@@ -410,6 +411,7 @@
 	AZX_DRIVER_ULI,
 	AZX_DRIVER_NVIDIA,
 	AZX_DRIVER_TERA,
+	AZX_DRIVER_AMD_AUTO,
 	AZX_NUM_DRIVERS, /* keep this as last entry */
 };
 
@@ -423,6 +425,7 @@
 	[AZX_DRIVER_ULI] = "HDA ULI M5461",
 	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
 	[AZX_DRIVER_TERA] = "HDA Teradici", 
+	[AZX_DRIVER_AMD_AUTO] = "HDA AMD",
 };
 
 /*
@@ -1198,6 +1201,7 @@
 static unsigned int azx_default_codecs[AZX_NUM_DRIVERS] __devinitdata =
{
 	[AZX_DRIVER_ICH] = 3,
 	[AZX_DRIVER_ATI] = 3,
+	[AZX_DRIVER_AMD_AUTO] = 3,
 };
 
 static int __devinit azx_codec_create(struct azx *chip, const char
*model,
@@ -2146,6 +2150,7 @@
 			chip->playback_streams = ULI_NUM_PLAYBACK;
 			chip->capture_streams = ULI_NUM_CAPTURE;
 			break;
+		case AZX_DRIVER_AMD_AUTO:
 		case AZX_DRIVER_ATIHDMI:
 			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
 			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
@@ -2373,6 +2378,9 @@
 	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA
},
 	/* Teradici */
 	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
+	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
+	{ PCI_VENDOR_ID_ATI, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+	  PCI_CLASS_MULTIMEDIA_HDA, 0xffffff, AZX_DRIVER_AMD_AUTO },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, azx_ids);

Thanks & Regards,
Libin

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

* Re: (no subject)
  2008-11-11  2:43 (no subject) Yang, Libin
@ 2008-11-11  8:17 ` Takashi Iwai
  2008-11-11  8:39   ` HDA-Intel - Patch to support detecting HD Audio devices with PCI class code Yang, Libin
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2008-11-11  8:17 UTC (permalink / raw)
  To: Yang, Libin; +Cc: alsa-devel

At Tue, 11 Nov 2008 10:43:12 +0800,
Yang, Libin wrote:
> 
> Hi Takashi,
> 
> This patch is to support detecting new AMD HD Audio devices with HDA PCI
> class code. Would you please review it? Thanks a lot!

Thanks for the patch!  Some quick review comments below...


> --- alsa-driver-1.0.18.orig/alsa-kernel/pci/hda/hda_intel.c
> 2008-10-29 20:41:35.000000000 +0800
> +++ alsa-driver-1.0.18/alsa-kernel/pci/hda/hda_intel.c	2008-11-11
> 18:33:14.000000000 +0800
> @@ -291,6 +291,7 @@
>  /* Define VIA HD Audio Device ID*/
>  #define VIA_HDAC_DEVICE_ID		0x3288
>  
> +#define PCI_CLASS_MULTIMEDIA_HDA	0x040300

Put this into include/linux/pci_ids.h as a common definition.
And, IMO, it'd be better to name it *_HD_AUDIO than *_HDA.

>  
>  /*
>   */
> @@ -410,6 +411,7 @@
>  	AZX_DRIVER_ULI,
>  	AZX_DRIVER_NVIDIA,
>  	AZX_DRIVER_TERA,
> +	AZX_DRIVER_AMD_AUTO,

We can create a more generic entry, say, AZX_DRIVER_GENERIC.


> @@ -423,6 +425,7 @@
>  	[AZX_DRIVER_ULI] = "HDA ULI M5461",
>  	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
>  	[AZX_DRIVER_TERA] = "HDA Teradici", 
> +	[AZX_DRIVER_AMD_AUTO] = "HDA AMD",

And, make it [AZX_DRIVER_GENERIC] = "HD-Audio Generic" or so.


>  static unsigned int azx_default_codecs[AZX_NUM_DRIVERS] __devinitdata =
> {
>  	[AZX_DRIVER_ICH] = 3,
>  	[AZX_DRIVER_ATI] = 3,
> +	[AZX_DRIVER_AMD_AUTO] = 3,

I thought you'll have up to 4 codecs?


>  static int __devinit azx_codec_create(struct azx *chip, const char
> *model,
> @@ -2146,6 +2150,7 @@
>  			chip->playback_streams = ULI_NUM_PLAYBACK;
>  			chip->capture_streams = ULI_NUM_CAPTURE;
>  			break;
> +		case AZX_DRIVER_AMD_AUTO:

AZX_DRIVER_GENERIC can go to "default".

>  		case AZX_DRIVER_ATIHDMI:
>  			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
>  			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
> @@ -2373,6 +2378,9 @@
>  	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA
> },
>  	/* Teradici */
>  	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
> +	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
> +	{ PCI_VENDOR_ID_ATI, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
> +	  PCI_CLASS_MULTIMEDIA_HDA, 0xffffff, AZX_DRIVER_AMD_AUTO },

Use PCI_DEVICE() macro and C99 style initialization, such as,

	{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
	  .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO,
	  .class_mask = 0xffffff,
	  .driver_data = AZX_DRIVER_GENERIC },

thanks,

Takashi

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

* Re: HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
  2008-11-11  8:17 ` Takashi Iwai
@ 2008-11-11  8:39   ` Yang, Libin
  2008-11-11  8:43     ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Yang, Libin @ 2008-11-11  8:39 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Thanks for the comments and I will refine the patch.

> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@suse.de]
> Sent: Tuesday, November 11, 2008 4:17 PM
> To: Yang, Libin
> Cc: alsa-devel@alsa-project.org
> Subject: Re:
> 
> At Tue, 11 Nov 2008 10:43:12 +0800,
> Yang, Libin wrote:
> >
> > Hi Takashi,
> >
> > This patch is to support detecting new AMD HD Audio devices with HDA
PCI
> > class code. Would you please review it? Thanks a lot!
> 
> Thanks for the patch!  Some quick review comments below...
> 
> 
> > --- alsa-driver-1.0.18.orig/alsa-kernel/pci/hda/hda_intel.c
> > 2008-10-29 20:41:35.000000000 +0800
> > +++ alsa-driver-1.0.18/alsa-kernel/pci/hda/hda_intel.c
2008-11-11
> > 18:33:14.000000000 +0800
> > @@ -291,6 +291,7 @@
> >  /* Define VIA HD Audio Device ID*/
> >  #define VIA_HDAC_DEVICE_ID		0x3288
> >
> > +#define PCI_CLASS_MULTIMEDIA_HDA	0x040300
> 
> Put this into include/linux/pci_ids.h as a common definition.
> And, IMO, it'd be better to name it *_HD_AUDIO than *_HDA.
> 
> >
> >  /*
> >   */
> > @@ -410,6 +411,7 @@
> >  	AZX_DRIVER_ULI,
> >  	AZX_DRIVER_NVIDIA,
> >  	AZX_DRIVER_TERA,
> > +	AZX_DRIVER_AMD_AUTO,
> 
> We can create a more generic entry, say, AZX_DRIVER_GENERIC.
> 
> 
> > @@ -423,6 +425,7 @@
> >  	[AZX_DRIVER_ULI] = "HDA ULI M5461",
> >  	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
> >  	[AZX_DRIVER_TERA] = "HDA Teradici",
> > +	[AZX_DRIVER_AMD_AUTO] = "HDA AMD",
> 
> And, make it [AZX_DRIVER_GENERIC] = "HD-Audio Generic" or so.
> 
> 
> >  static unsigned int azx_default_codecs[AZX_NUM_DRIVERS]
__devinitdata =
> > {
> >  	[AZX_DRIVER_ICH] = 3,
> >  	[AZX_DRIVER_ATI] = 3,
> > +	[AZX_DRIVER_AMD_AUTO] = 3,
> 
> I thought you'll have up to 4 codecs?
> 
> 
> >  static int __devinit azx_codec_create(struct azx *chip, const char
> > *model,
> > @@ -2146,6 +2150,7 @@
> >  			chip->playback_streams = ULI_NUM_PLAYBACK;
> >  			chip->capture_streams = ULI_NUM_CAPTURE;
> >  			break;
> > +		case AZX_DRIVER_AMD_AUTO:
> 
> AZX_DRIVER_GENERIC can go to "default".
> 
> >  		case AZX_DRIVER_ATIHDMI:
> >  			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
> >  			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
> > @@ -2373,6 +2378,9 @@
> >  	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA
> > },
> >  	/* Teradici */
> >  	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
> > +	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
> > +	{ PCI_VENDOR_ID_ATI, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
> > +	  PCI_CLASS_MULTIMEDIA_HDA, 0xffffff, AZX_DRIVER_AMD_AUTO },
> 
> Use PCI_DEVICE() macro and C99 style initialization, such as,
> 
> 	{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
> 	  .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO,
> 	  .class_mask = 0xffffff,
> 	  .driver_data = AZX_DRIVER_GENERIC },
> 
> thanks,
> 
> Takashi

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

* Re: HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
  2008-11-11  8:39   ` HDA-Intel - Patch to support detecting HD Audio devices with PCI class code Yang, Libin
@ 2008-11-11  8:43     ` Takashi Iwai
  2008-11-13 10:01       ` Yang, Libin
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2008-11-11  8:43 UTC (permalink / raw)
  To: Yang, Libin; +Cc: alsa-devel

At Tue, 11 Nov 2008 16:39:27 +0800,
Yang, Libin wrote:
> 
> Thanks for the comments and I will refine the patch.

Thanks.  One thing I forgot to mention.

> > >  static unsigned int azx_default_codecs[AZX_NUM_DRIVERS]
> __devinitdata =
> > > {
> > >  	[AZX_DRIVER_ICH] = 3,
> > >  	[AZX_DRIVER_ATI] = 3,
> > > +	[AZX_DRIVER_AMD_AUTO] = 3,
> > 
> > I thought you'll have up to 4 codecs?

This array is completely changed in the recent code.
There is only one entry (TERRA) as an exception.

Please create a patch based on the latest sound tree,
    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
either master branch or topic/hda branch.


thanks,

Takashi

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

* Re: HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
  2008-11-11  8:43     ` Takashi Iwai
@ 2008-11-13 10:01       ` Yang, Libin
  2008-11-13 10:09         ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Yang, Libin @ 2008-11-13 10:01 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Hi Takashi,

The following patch is updated. Would you please review it? Thanks a
lot.
------------------------------------------------------------------------
-

The patch uses HD Audio PCI class code to detect AMD HD Audio cards.

Signed-off-by: Libin Yang <libin.yang@amd.com>

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 8f6c1df..8ca441c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -292,6 +292,8 @@ enum {
 /* Define VIA HD Audio Device ID*/
 #define VIA_HDAC_DEVICE_ID		0x3288
 
+/* HD Audio class code */
+#define PCI_CLASS_MULTIMEDIA_HD_AUDIO	0x0403
 
 /*
  */
@@ -415,6 +417,7 @@ enum {
 	AZX_DRIVER_ULI,
 	AZX_DRIVER_NVIDIA,
 	AZX_DRIVER_TERA,
+	AZX_DRIVER_GENERIC,
 	AZX_NUM_DRIVERS, /* keep this as last entry */
 };
 
@@ -428,6 +431,7 @@ static char *driver_short_names[] __devinitdata = {
 	[AZX_DRIVER_ULI] = "HDA ULI M5461",
 	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
 	[AZX_DRIVER_TERA] = "HDA Teradici", 
+	[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
 };
 
 /*
@@ -2203,6 +2207,7 @@ static int __devinit azx_create(struct snd_card
*card, struct pci_dev *pci,
 			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
 			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
 			break;
+		case AZX_DRIVER_GENERIC:
 		default:
 			chip->playback_streams = ICH6_NUM_PLAYBACK;
 			chip->capture_streams = ICH6_NUM_CAPTURE;
@@ -2427,6 +2432,11 @@ static struct pci_device_id azx_ids[] = {
 	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA
},
 	/* Teradici */
 	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
+	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
+	{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
+	  .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
+	  .class_mask = 0xffffff,
+	  .driver_data = AZX_DRIVER_GENERIC },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, azx_ids);


> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@suse.de]
> Sent: Tuesday, November 11, 2008 4:43 PM
> To: Yang, Libin
> Cc: alsa-devel@alsa-project.org
> Subject: Re: HDA-Intel - Patch to support detecting HD Audio devices
with
> PCI class code
> 
> At Tue, 11 Nov 2008 16:39:27 +0800,
> Yang, Libin wrote:
> >
> > Thanks for the comments and I will refine the patch.
> 
> Thanks.  One thing I forgot to mention.
> 
> > > >  static unsigned int azx_default_codecs[AZX_NUM_DRIVERS]
> > __devinitdata =
> > > > {
> > > >  	[AZX_DRIVER_ICH] = 3,
> > > >  	[AZX_DRIVER_ATI] = 3,
> > > > +	[AZX_DRIVER_AMD_AUTO] = 3,
> > >
> > > I thought you'll have up to 4 codecs?
> 
> This array is completely changed in the recent code.
> There is only one entry (TERRA) as an exception.
> 
> Please create a patch based on the latest sound tree,
>     git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> either master branch or topic/hda branch.
> 
> 
> thanks,
> 
> Takashi

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

* Re: HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
  2008-11-13 10:01       ` Yang, Libin
@ 2008-11-13 10:09         ` Takashi Iwai
  2008-11-17  3:44           ` Yang, Libin
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2008-11-13 10:09 UTC (permalink / raw)
  To: Yang, Libin; +Cc: alsa-devel

At Thu, 13 Nov 2008 18:01:00 +0800,
Yang, Libin wrote:
> 
> Hi Takashi,
> 
> The following patch is updated. Would you please review it? Thanks a
> lot.
> ------------------------------------------------------------------------
> -
> 
> The patch uses HD Audio PCI class code to detect AMD HD Audio cards.
> 
> Signed-off-by: Libin Yang <libin.yang@amd.com>

Thanks, applied now.

(BTW, your embedded patch seems broken likely by MUA.  Please fix
 the setting or use attachments if it's difficult.)


Takashi

> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 8f6c1df..8ca441c 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -292,6 +292,8 @@ enum {
>  /* Define VIA HD Audio Device ID*/
>  #define VIA_HDAC_DEVICE_ID		0x3288
>  
> +/* HD Audio class code */
> +#define PCI_CLASS_MULTIMEDIA_HD_AUDIO	0x0403
>  
>  /*
>   */
> @@ -415,6 +417,7 @@ enum {
>  	AZX_DRIVER_ULI,
>  	AZX_DRIVER_NVIDIA,
>  	AZX_DRIVER_TERA,
> +	AZX_DRIVER_GENERIC,
>  	AZX_NUM_DRIVERS, /* keep this as last entry */
>  };
>  
> @@ -428,6 +431,7 @@ static char *driver_short_names[] __devinitdata = {
>  	[AZX_DRIVER_ULI] = "HDA ULI M5461",
>  	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
>  	[AZX_DRIVER_TERA] = "HDA Teradici", 
> +	[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
>  };
>  
>  /*
> @@ -2203,6 +2207,7 @@ static int __devinit azx_create(struct snd_card
> *card, struct pci_dev *pci,
>  			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
>  			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
>  			break;
> +		case AZX_DRIVER_GENERIC:
>  		default:
>  			chip->playback_streams = ICH6_NUM_PLAYBACK;
>  			chip->capture_streams = ICH6_NUM_CAPTURE;
> @@ -2427,6 +2432,11 @@ static struct pci_device_id azx_ids[] = {
>  	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA
> },
>  	/* Teradici */
>  	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
> +	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
> +	{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
> +	  .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
> +	  .class_mask = 0xffffff,
> +	  .driver_data = AZX_DRIVER_GENERIC },
>  	{ 0, }
>  };
>  MODULE_DEVICE_TABLE(pci, azx_ids);
> 
> 
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai@suse.de]
> > Sent: Tuesday, November 11, 2008 4:43 PM
> > To: Yang, Libin
> > Cc: alsa-devel@alsa-project.org
> > Subject: Re: HDA-Intel - Patch to support detecting HD Audio devices
> with
> > PCI class code
> > 
> > At Tue, 11 Nov 2008 16:39:27 +0800,
> > Yang, Libin wrote:
> > >
> > > Thanks for the comments and I will refine the patch.
> > 
> > Thanks.  One thing I forgot to mention.
> > 
> > > > >  static unsigned int azx_default_codecs[AZX_NUM_DRIVERS]
> > > __devinitdata =
> > > > > {
> > > > >  	[AZX_DRIVER_ICH] = 3,
> > > > >  	[AZX_DRIVER_ATI] = 3,
> > > > > +	[AZX_DRIVER_AMD_AUTO] = 3,
> > > >
> > > > I thought you'll have up to 4 codecs?
> > 
> > This array is completely changed in the recent code.
> > There is only one entry (TERRA) as an exception.
> > 
> > Please create a patch based on the latest sound tree,
> >     git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> > either master branch or topic/hda branch.
> > 
> > 
> > thanks,
> > 
> > Takashi
> 
> 

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

* Re: HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
  2008-11-13 10:09         ` Takashi Iwai
@ 2008-11-17  3:44           ` Yang, Libin
  2008-11-17  8:41             ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Yang, Libin @ 2008-11-17  3:44 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

> >
> > The patch uses HD Audio PCI class code to detect AMD HD Audio cards.
> >
> > Signed-off-by: Libin Yang <libin.yang@amd.com>
> 
> Thanks, applied now.
> 
> (BTW, your embedded patch seems broken likely by MUA.  Please fix
>  the setting or use attachments if it's difficult.)

OK. Thank you for your suggestion. Use the attachment this time.

Thanks & Regards,
Libin



[-- Attachment #2: HDA_class_AMD.patch --]
[-- Type: application/octet-stream, Size: 1704 bytes --]

The patch uses HD Audio PCI class code to detect AMD HD Audio cards.

Signed-off-by: Libin Yang <libin.yang@amd.com>

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 8f6c1df..8ca441c 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -292,6 +292,8 @@ enum {
 /* Define VIA HD Audio Device ID*/
 #define VIA_HDAC_DEVICE_ID		0x3288
 
+/* HD Audio class code */
+#define PCI_CLASS_MULTIMEDIA_HD_AUDIO	0x0403
 
 /*
  */
@@ -415,6 +417,7 @@ enum {
 	AZX_DRIVER_ULI,
 	AZX_DRIVER_NVIDIA,
 	AZX_DRIVER_TERA,
+	AZX_DRIVER_GENERIC,
 	AZX_NUM_DRIVERS, /* keep this as last entry */
 };
 
@@ -428,6 +431,7 @@ static char *driver_short_names[] __devinitdata = {
 	[AZX_DRIVER_ULI] = "HDA ULI M5461",
 	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
 	[AZX_DRIVER_TERA] = "HDA Teradici", 
+	[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
 };
 
 /*
@@ -2203,6 +2207,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
 			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
 			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
 			break;
+		case AZX_DRIVER_GENERIC:
 		default:
 			chip->playback_streams = ICH6_NUM_PLAYBACK;
 			chip->capture_streams = ICH6_NUM_CAPTURE;
@@ -2427,6 +2432,11 @@ static struct pci_device_id azx_ids[] = {
 	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA },
 	/* Teradici */
 	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
+	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
+	{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
+	  .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
+	  .class_mask = 0xffffff,
+	  .driver_data = AZX_DRIVER_GENERIC },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, azx_ids);

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
  2008-11-17  3:44           ` Yang, Libin
@ 2008-11-17  8:41             ` Takashi Iwai
  0 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2008-11-17  8:41 UTC (permalink / raw)
  To: Yang, Libin; +Cc: alsa-devel

At Mon, 17 Nov 2008 11:44:32 +0800,
Yang, Libin wrote:
> 
> > >
> > > The patch uses HD Audio PCI class code to detect AMD HD Audio cards.
> > >
> > > Signed-off-by: Libin Yang <libin.yang@amd.com>
> > 
> > Thanks, applied now.
> > 
> > (BTW, your embedded patch seems broken likely by MUA.  Please fix
> >  the setting or use attachments if it's difficult.)
> 
> OK. Thank you for your suggestion. Use the attachment this time.

Err, I already applied your patch :)
It was just a reminder for the next time.

Thanks anyway.

Takashi

> 
> Thanks & Regards,
> Libin
> 
> 
> [2 HDA_class_AMD.patch <application/octet-stream (base64)>]
> 

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

* HDA-Intel - Patch to support detecting HD Audio devices with PCI class code
@ 2008-11-11  3:30 Yang, Libin
  0 siblings, 0 replies; 9+ messages in thread
From: Yang, Libin @ 2008-11-11  3:30 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Yang, Libin, alsa-devel

Sorry, adding the title...

Thanks & Regards,
Libin

> -----Original Message-----
> From: Yang, Libin
> Sent: Tuesday, November 11, 2008 10:43 AM
> To: 'Takashi Iwai'
> Cc: 'alsa-devel@alsa-project.org'
> Subject:
> 
> Hi Takashi,
> 
> This patch is to support detecting new AMD HD Audio devices with HDA
PCI
> class code. Would you please review it? Thanks a lot!
> --------------------------------------------------------------------
> 
> Signed-off-by: Libin Yang <libin.yang@amd.com>
> 
> --- alsa-driver-1.0.18.orig/alsa-kernel/pci/hda/hda_intel.c
2008-10-29
> 20:41:35.000000000 +0800
> +++ alsa-driver-1.0.18/alsa-kernel/pci/hda/hda_intel.c
2008-11-11
> 18:33:14.000000000 +0800
> @@ -291,6 +291,7 @@
>  /* Define VIA HD Audio Device ID*/
>  #define VIA_HDAC_DEVICE_ID		0x3288
> 
> +#define PCI_CLASS_MULTIMEDIA_HDA	0x040300
> 
>  /*
>   */
> @@ -410,6 +411,7 @@
>  	AZX_DRIVER_ULI,
>  	AZX_DRIVER_NVIDIA,
>  	AZX_DRIVER_TERA,
> +	AZX_DRIVER_AMD_AUTO,
>  	AZX_NUM_DRIVERS, /* keep this as last entry */
>  };
> 
> @@ -423,6 +425,7 @@
>  	[AZX_DRIVER_ULI] = "HDA ULI M5461",
>  	[AZX_DRIVER_NVIDIA] = "HDA NVidia",
>  	[AZX_DRIVER_TERA] = "HDA Teradici",
> +	[AZX_DRIVER_AMD_AUTO] = "HDA AMD",
>  };
> 
>  /*
> @@ -1198,6 +1201,7 @@
>  static unsigned int azx_default_codecs[AZX_NUM_DRIVERS] __devinitdata
= {
>  	[AZX_DRIVER_ICH] = 3,
>  	[AZX_DRIVER_ATI] = 3,
> +	[AZX_DRIVER_AMD_AUTO] = 3,
>  };
> 
>  static int __devinit azx_codec_create(struct azx *chip, const char
*model,
> @@ -2146,6 +2150,7 @@
>  			chip->playback_streams = ULI_NUM_PLAYBACK;
>  			chip->capture_streams = ULI_NUM_CAPTURE;
>  			break;
> +		case AZX_DRIVER_AMD_AUTO:
>  		case AZX_DRIVER_ATIHDMI:
>  			chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
>  			chip->capture_streams = ATIHDMI_NUM_CAPTURE;
> @@ -2373,6 +2378,9 @@
>  	{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA
},
>  	/* Teradici */
>  	{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
> +	/* AMD Generic, PCI class code and Vendor ID for HD Audio */
> +	{ PCI_VENDOR_ID_ATI, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
> +	  PCI_CLASS_MULTIMEDIA_HDA, 0xffffff, AZX_DRIVER_AMD_AUTO },
>  	{ 0, }
>  };
>  MODULE_DEVICE_TABLE(pci, azx_ids);
> 
> Thanks & Regards,
> Libin

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

end of thread, other threads:[~2008-11-17  8:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-11  2:43 (no subject) Yang, Libin
2008-11-11  8:17 ` Takashi Iwai
2008-11-11  8:39   ` HDA-Intel - Patch to support detecting HD Audio devices with PCI class code Yang, Libin
2008-11-11  8:43     ` Takashi Iwai
2008-11-13 10:01       ` Yang, Libin
2008-11-13 10:09         ` Takashi Iwai
2008-11-17  3:44           ` Yang, Libin
2008-11-17  8:41             ` Takashi Iwai
2008-11-11  3:30 Yang, Libin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.