Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a9995a3557ebf09721fd111744ff8b6e498797a6
Commit:     a9995a3557ebf09721fd111744ff8b6e498797a6
Parent:     a64c8cd6e22bbc6a101da5b827e720fff35a5ab9
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 12 21:30:46 2007 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Wed Mar 14 08:24:17 2007 +0100

    [ALSA] hda-intel - Fix codec probe with ATI contorllers
    
    ATI controllers may have up to 4 codecs while ICH up to 3.
    Thus the earlier fix to change AZX_MAX_CODECS to 3 cause a regression
    on some devices that have the audio codec at bit#3.
    Now max codecs is defined according to the driver type, either 3 or 4.
    Currently 4 is set only to ATI chips.  Other might need the same
    change, too.
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/hda_intel.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b9a8e23..13e4837 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -199,7 +199,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
 
 /* STATESTS int mask: SD2,SD1,SD0 */
 #define STATESTS_INT_MASK      0x07
-#define AZX_MAX_CODECS         3
 
 /* SD_CTL bits */
 #define SD_CTL_STREAM_RESET    0x01    /* stream reset bit */
@@ -966,6 +965,16 @@ static int azx_setup_controller(struct azx *chip, struct 
azx_dev *azx_dev)
  * Codec initialization
  */
 
+static unsigned int azx_max_codecs[] __devinitdata = {
+       [AZX_DRIVER_ICH] = 3,
+       [AZX_DRIVER_ATI] = 4,
+       [AZX_DRIVER_ATIHDMI] = 4,
+       [AZX_DRIVER_VIA] = 3,           /* FIXME: correct? */
+       [AZX_DRIVER_SIS] = 3,           /* FIXME: correct? */
+       [AZX_DRIVER_ULI] = 3,           /* FIXME: correct? */
+       [AZX_DRIVER_NVIDIA] = 3,        /* FIXME: correct? */
+};
+
 static int __devinit azx_codec_create(struct azx *chip, const char *model)
 {
        struct hda_bus_template bus_temp;
@@ -982,7 +991,7 @@ static int __devinit azx_codec_create(struct azx *chip, 
const char *model)
                return err;
 
        codecs = 0;
-       for (c = 0; c < AZX_MAX_CODECS; c++) {
+       for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) {
                if ((chip->codec_mask & (1 << c)) & probe_mask) {
                        err = snd_hda_codec_new(chip->bus, c, NULL);
                        if (err < 0)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to