]>
Commit | Line | Data |
---|---|---|
a323acb3 GKH |
1 | From 14d34f166c57e77e3d7f9bc8b43d349186d922c1 Mon Sep 17 00:00:00 2001 |
2 | From: Takashi Iwai <tiwai@suse.de> | |
3 | Date: Thu, 21 Oct 2010 09:03:25 +0200 | |
4 | Subject: ALSA: hda - Add some workarounds for Creative IBG | |
5 | ||
6 | From: Takashi Iwai <tiwai@suse.de> | |
7 | ||
8 | commit 14d34f166c57e77e3d7f9bc8b43d349186d922c1 upstream. | |
9 | ||
10 | Creative HD-audio controller chips require some workarounds: | |
11 | - Additional delay before RIRB response | |
12 | - Set the initial RIRB counter to 0xc0 | |
13 | ||
14 | The latter seems to be done in general in Windows driver, so we may | |
15 | use this value later for all types if it's confirmed to work better. | |
16 | ||
17 | Reported-by: Wai Yew CHAY <wychay@ctl.creative.com> | |
18 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | sound/pci/hda/hda_intel.c | 16 ++++++++++++---- | |
23 | 1 file changed, 12 insertions(+), 4 deletions(-) | |
24 | ||
25 | --- a/sound/pci/hda/hda_intel.c | |
26 | +++ b/sound/pci/hda/hda_intel.c | |
27 | @@ -458,6 +458,7 @@ enum { | |
28 | AZX_DRIVER_ULI, | |
29 | AZX_DRIVER_NVIDIA, | |
30 | AZX_DRIVER_TERA, | |
31 | + AZX_DRIVER_CTX, | |
32 | AZX_DRIVER_GENERIC, | |
33 | AZX_NUM_DRIVERS, /* keep this as last entry */ | |
34 | }; | |
35 | @@ -473,6 +474,7 @@ static char *driver_short_names[] __devi | |
36 | [AZX_DRIVER_ULI] = "HDA ULI M5461", | |
37 | [AZX_DRIVER_NVIDIA] = "HDA NVidia", | |
38 | [AZX_DRIVER_TERA] = "HDA Teradici", | |
39 | + [AZX_DRIVER_CTX] = "HDA Creative", | |
40 | [AZX_DRIVER_GENERIC] = "HD-Audio Generic", | |
41 | }; | |
42 | ||
43 | @@ -563,7 +565,10 @@ static void azx_init_cmd_io(struct azx * | |
44 | /* reset the rirb hw write pointer */ | |
45 | azx_writew(chip, RIRBWP, ICH6_RIRBWP_RST); | |
46 | /* set N=1, get RIRB response interrupt for new entry */ | |
47 | - azx_writew(chip, RINTCNT, 1); | |
48 | + if (chip->driver_type == AZX_DRIVER_CTX) | |
49 | + azx_writew(chip, RINTCNT, 0xc0); | |
50 | + else | |
51 | + azx_writew(chip, RINTCNT, 1); | |
52 | /* enable rirb dma and response irq */ | |
53 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); | |
54 | spin_unlock_irq(&chip->reg_lock); | |
55 | @@ -1136,8 +1141,11 @@ static irqreturn_t azx_interrupt(int irq | |
56 | /* clear rirb int */ | |
57 | status = azx_readb(chip, RIRBSTS); | |
58 | if (status & RIRB_INT_MASK) { | |
59 | - if (status & RIRB_INT_RESPONSE) | |
60 | + if (status & RIRB_INT_RESPONSE) { | |
61 | + if (chip->driver_type == AZX_DRIVER_CTX) | |
62 | + udelay(80); | |
63 | azx_update_rirb(chip); | |
64 | + } | |
65 | azx_writeb(chip, RIRBSTS, RIRB_INT_MASK); | |
66 | } | |
67 | ||
68 | @@ -2799,10 +2807,10 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) | |
69 | { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_ANY_ID), | |
70 | .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, | |
71 | .class_mask = 0xffffff, | |
72 | - .driver_data = AZX_DRIVER_GENERIC }, | |
73 | + .driver_data = AZX_DRIVER_CTX }, | |
74 | #else | |
75 | /* this entry seems still valid -- i.e. without emu20kx chip */ | |
76 | - { PCI_DEVICE(0x1102, 0x0009), .driver_data = AZX_DRIVER_GENERIC }, | |
77 | + { PCI_DEVICE(0x1102, 0x0009), .driver_data = AZX_DRIVER_CTX }, | |
78 | #endif | |
79 | /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */ | |
80 | { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID), |