ALSA: hda - Don't initialize CORB/RIRB for single_cmd mode
authorTakashi Iwai <tiwai@suse.de>
Sat, 7 Nov 2009 08:49:04 +0000 (09:49 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 7 Nov 2009 08:49:04 +0000 (09:49 +0100)
So far, CORB/RIRB still remains even if the driver is switched to the
single_cmd mode.  The specification says that this should be disabled,
but I hoped this isn't the case; indeed most devices worked together with
CORB/RIRB.

However, Poulsbo (US15W) seems problematic with this setup, and it
requires to disable CORB/RIRB when single_cmd is used.

Now this patch disables CORB/RIRB initialization when the single_cmd
mode is used.  Also the unsolicited event is disabled because it can't
work without RIRB.

Reported-and-tested-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_intel.c

index e340792..6517f58 100644 (file)
@@ -722,9 +722,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
                   chip->last_cmd[addr]);
        chip->single_cmd = 1;
        bus->response_reset = 0;
                   chip->last_cmd[addr]);
        chip->single_cmd = 1;
        bus->response_reset = 0;
-       /* re-initialize CORB/RIRB */
+       /* release CORB/RIRB */
        azx_free_cmd_io(chip);
        azx_free_cmd_io(chip);
-       azx_init_cmd_io(chip);
+       /* disable unsolicited responses */
+       azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_UNSOL);
        return -1;
 }
 
        return -1;
 }
 
@@ -865,7 +866,9 @@ static int azx_reset(struct azx *chip)
        }
 
        /* Accept unsolicited responses */
        }
 
        /* Accept unsolicited responses */
-       azx_writel(chip, GCTL, azx_readl(chip, GCTL) | ICH6_GCTL_UNSOL);
+       if (!chip->single_cmd)
+               azx_writel(chip, GCTL, azx_readl(chip, GCTL) |
+                          ICH6_GCTL_UNSOL);
 
        /* detect codecs */
        if (!chip->codec_mask) {
 
        /* detect codecs */
        if (!chip->codec_mask) {
@@ -980,7 +983,8 @@ static void azx_init_chip(struct azx *chip)
        azx_int_enable(chip);
 
        /* initialize the codec command I/O */
        azx_int_enable(chip);
 
        /* initialize the codec command I/O */
-       azx_init_cmd_io(chip);
+       if (!chip->single_cmd)
+               azx_init_cmd_io(chip);
 
        /* program the position buffer */
        azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);
 
        /* program the position buffer */
        azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);