diff options
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 157 |
1 files changed, 123 insertions, 34 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 288ab0764830..15107df1f490 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -71,7 +71,9 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," | |||
71 | "{Intel, ESB2}," | 71 | "{Intel, ESB2}," |
72 | "{ATI, SB450}," | 72 | "{ATI, SB450}," |
73 | "{VIA, VT8251}," | 73 | "{VIA, VT8251}," |
74 | "{VIA, VT8237A}}"); | 74 | "{VIA, VT8237A}," |
75 | "{SiS, SIS966}," | ||
76 | "{ULI, M5461}}"); | ||
75 | MODULE_DESCRIPTION("Intel HDA driver"); | 77 | MODULE_DESCRIPTION("Intel HDA driver"); |
76 | 78 | ||
77 | #define SFX "hda-intel: " | 79 | #define SFX "hda-intel: " |
@@ -141,9 +143,24 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
141 | */ | 143 | */ |
142 | 144 | ||
143 | /* max number of SDs */ | 145 | /* max number of SDs */ |
144 | #define MAX_ICH6_DEV 8 | 146 | /* ICH, ATI and VIA have 4 playback and 4 capture */ |
147 | #define ICH6_CAPTURE_INDEX 0 | ||
148 | #define ICH6_NUM_CAPTURE 4 | ||
149 | #define ICH6_PLAYBACK_INDEX 4 | ||
150 | #define ICH6_NUM_PLAYBACK 4 | ||
151 | |||
152 | /* ULI has 6 playback and 5 capture */ | ||
153 | #define ULI_CAPTURE_INDEX 0 | ||
154 | #define ULI_NUM_CAPTURE 5 | ||
155 | #define ULI_PLAYBACK_INDEX 5 | ||
156 | #define ULI_NUM_PLAYBACK 6 | ||
157 | |||
158 | /* this number is statically defined for simplicity */ | ||
159 | #define MAX_AZX_DEV 16 | ||
160 | |||
145 | /* max number of fragments - we may use more if allocating more pages for BDL */ | 161 | /* max number of fragments - we may use more if allocating more pages for BDL */ |
146 | #define AZX_MAX_FRAG (PAGE_SIZE / (MAX_ICH6_DEV * 16)) | 162 | #define BDL_SIZE PAGE_ALIGN(8192) |
163 | #define AZX_MAX_FRAG (BDL_SIZE / (MAX_AZX_DEV * 16)) | ||
147 | /* max buffer size - no h/w limit, you can increase as you like */ | 164 | /* max buffer size - no h/w limit, you can increase as you like */ |
148 | #define AZX_MAX_BUF_SIZE (1024*1024*1024) | 165 | #define AZX_MAX_BUF_SIZE (1024*1024*1024) |
149 | /* max number of PCM devics per card */ | 166 | /* max number of PCM devics per card */ |
@@ -200,7 +217,6 @@ enum { | |||
200 | }; | 217 | }; |
201 | 218 | ||
202 | /* Defines for ATI HD Audio support in SB450 south bridge */ | 219 | /* Defines for ATI HD Audio support in SB450 south bridge */ |
203 | #define ATI_SB450_HDAUDIO_PCI_DEVICE_ID 0x437b | ||
204 | #define ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR 0x42 | 220 | #define ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR 0x42 |
205 | #define ATI_SB450_HDAUDIO_ENABLE_SNOOP 0x02 | 221 | #define ATI_SB450_HDAUDIO_ENABLE_SNOOP 0x02 |
206 | 222 | ||
@@ -258,6 +274,14 @@ struct snd_azx { | |||
258 | snd_card_t *card; | 274 | snd_card_t *card; |
259 | struct pci_dev *pci; | 275 | struct pci_dev *pci; |
260 | 276 | ||
277 | /* chip type specific */ | ||
278 | int driver_type; | ||
279 | int playback_streams; | ||
280 | int playback_index_offset; | ||
281 | int capture_streams; | ||
282 | int capture_index_offset; | ||
283 | int num_streams; | ||
284 | |||
261 | /* pci resources */ | 285 | /* pci resources */ |
262 | unsigned long addr; | 286 | unsigned long addr; |
263 | void __iomem *remap_addr; | 287 | void __iomem *remap_addr; |
@@ -267,8 +291,8 @@ struct snd_azx { | |||
267 | spinlock_t reg_lock; | 291 | spinlock_t reg_lock; |
268 | struct semaphore open_mutex; | 292 | struct semaphore open_mutex; |
269 | 293 | ||
270 | /* streams */ | 294 | /* streams (x num_streams) */ |
271 | azx_dev_t azx_dev[MAX_ICH6_DEV]; | 295 | azx_dev_t *azx_dev; |
272 | 296 | ||
273 | /* PCM */ | 297 | /* PCM */ |
274 | unsigned int pcm_devs; | 298 | unsigned int pcm_devs; |
@@ -292,6 +316,23 @@ struct snd_azx { | |||
292 | unsigned int initialized: 1; | 316 | unsigned int initialized: 1; |
293 | }; | 317 | }; |
294 | 318 | ||
319 | /* driver types */ | ||
320 | enum { | ||
321 | AZX_DRIVER_ICH, | ||
322 | AZX_DRIVER_ATI, | ||
323 | AZX_DRIVER_VIA, | ||
324 | AZX_DRIVER_SIS, | ||
325 | AZX_DRIVER_ULI, | ||
326 | }; | ||
327 | |||
328 | static char *driver_short_names[] __devinitdata = { | ||
329 | [AZX_DRIVER_ICH] = "HDA Intel", | ||
330 | [AZX_DRIVER_ATI] = "HDA ATI SB", | ||
331 | [AZX_DRIVER_VIA] = "HDA VIA VT82xx", | ||
332 | [AZX_DRIVER_SIS] = "HDA SIS966", | ||
333 | [AZX_DRIVER_ULI] = "HDA ULI M5461" | ||
334 | }; | ||
335 | |||
295 | /* | 336 | /* |
296 | * macros for easy use | 337 | * macros for easy use |
297 | */ | 338 | */ |
@@ -360,6 +401,8 @@ static void azx_init_cmd_io(azx_t *chip) | |||
360 | azx_writel(chip, CORBLBASE, (u32)chip->corb.addr); | 401 | azx_writel(chip, CORBLBASE, (u32)chip->corb.addr); |
361 | azx_writel(chip, CORBUBASE, upper_32bit(chip->corb.addr)); | 402 | azx_writel(chip, CORBUBASE, upper_32bit(chip->corb.addr)); |
362 | 403 | ||
404 | /* set the corb size to 256 entries (ULI requires explicitly) */ | ||
405 | azx_writeb(chip, CORBSIZE, 0x02); | ||
363 | /* set the corb write pointer to 0 */ | 406 | /* set the corb write pointer to 0 */ |
364 | azx_writew(chip, CORBWP, 0); | 407 | azx_writew(chip, CORBWP, 0); |
365 | /* reset the corb hw read pointer */ | 408 | /* reset the corb hw read pointer */ |
@@ -373,6 +416,8 @@ static void azx_init_cmd_io(azx_t *chip) | |||
373 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); | 416 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); |
374 | azx_writel(chip, RIRBUBASE, upper_32bit(chip->rirb.addr)); | 417 | azx_writel(chip, RIRBUBASE, upper_32bit(chip->rirb.addr)); |
375 | 418 | ||
419 | /* set the rirb size to 256 entries (ULI requires explicitly) */ | ||
420 | azx_writeb(chip, RIRBSIZE, 0x02); | ||
376 | /* reset the rirb hw write pointer */ | 421 | /* reset the rirb hw write pointer */ |
377 | azx_writew(chip, RIRBWP, ICH6_RBRWP_CLR); | 422 | azx_writew(chip, RIRBWP, ICH6_RBRWP_CLR); |
378 | /* set N=1, get RIRB response interrupt for new entry */ | 423 | /* set N=1, get RIRB response interrupt for new entry */ |
@@ -596,7 +641,7 @@ static void azx_int_disable(azx_t *chip) | |||
596 | int i; | 641 | int i; |
597 | 642 | ||
598 | /* disable interrupts in stream descriptor */ | 643 | /* disable interrupts in stream descriptor */ |
599 | for (i = 0; i < MAX_ICH6_DEV; i++) { | 644 | for (i = 0; i < chip->num_streams; i++) { |
600 | azx_dev_t *azx_dev = &chip->azx_dev[i]; | 645 | azx_dev_t *azx_dev = &chip->azx_dev[i]; |
601 | azx_sd_writeb(azx_dev, SD_CTL, | 646 | azx_sd_writeb(azx_dev, SD_CTL, |
602 | azx_sd_readb(azx_dev, SD_CTL) & ~SD_INT_MASK); | 647 | azx_sd_readb(azx_dev, SD_CTL) & ~SD_INT_MASK); |
@@ -616,7 +661,7 @@ static void azx_int_clear(azx_t *chip) | |||
616 | int i; | 661 | int i; |
617 | 662 | ||
618 | /* clear stream status */ | 663 | /* clear stream status */ |
619 | for (i = 0; i < MAX_ICH6_DEV; i++) { | 664 | for (i = 0; i < chip->num_streams; i++) { |
620 | azx_dev_t *azx_dev = &chip->azx_dev[i]; | 665 | azx_dev_t *azx_dev = &chip->azx_dev[i]; |
621 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); | 666 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); |
622 | } | 667 | } |
@@ -686,8 +731,7 @@ static void azx_init_chip(azx_t *chip) | |||
686 | } | 731 | } |
687 | 732 | ||
688 | /* For ATI SB450 azalia HD audio, we need to enable snoop */ | 733 | /* For ATI SB450 azalia HD audio, we need to enable snoop */ |
689 | if (chip->pci->vendor == PCI_VENDOR_ID_ATI && | 734 | if (chip->driver_type == AZX_DRIVER_ATI) { |
690 | chip->pci->device == ATI_SB450_HDAUDIO_PCI_DEVICE_ID) { | ||
691 | pci_read_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, | 735 | pci_read_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, |
692 | &ati_misc_cntl2); | 736 | &ati_misc_cntl2); |
693 | pci_write_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, | 737 | pci_write_config_byte(chip->pci, ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, |
@@ -714,7 +758,7 @@ static irqreturn_t azx_interrupt(int irq, void* dev_id, struct pt_regs *regs) | |||
714 | return IRQ_NONE; | 758 | return IRQ_NONE; |
715 | } | 759 | } |
716 | 760 | ||
717 | for (i = 0; i < MAX_ICH6_DEV; i++) { | 761 | for (i = 0; i < chip->num_streams; i++) { |
718 | azx_dev = &chip->azx_dev[i]; | 762 | azx_dev = &chip->azx_dev[i]; |
719 | if (status & azx_dev->sd_int_sta_mask) { | 763 | if (status & azx_dev->sd_int_sta_mask) { |
720 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); | 764 | azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); |
@@ -879,9 +923,15 @@ static int __devinit azx_codec_create(azx_t *chip, const char *model) | |||
879 | /* assign a stream for the PCM */ | 923 | /* assign a stream for the PCM */ |
880 | static inline azx_dev_t *azx_assign_device(azx_t *chip, int stream) | 924 | static inline azx_dev_t *azx_assign_device(azx_t *chip, int stream) |
881 | { | 925 | { |
882 | int dev, i; | 926 | int dev, i, nums; |
883 | dev = stream == SNDRV_PCM_STREAM_PLAYBACK ? 4 : 0; | 927 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
884 | for (i = 0; i < 4; i++, dev++) | 928 | dev = chip->playback_index_offset; |
929 | nums = chip->playback_streams; | ||
930 | } else { | ||
931 | dev = chip->capture_index_offset; | ||
932 | nums = chip->capture_streams; | ||
933 | } | ||
934 | for (i = 0; i < nums; i++, dev++) | ||
885 | if (! chip->azx_dev[dev].opened) { | 935 | if (! chip->azx_dev[dev].opened) { |
886 | chip->azx_dev[dev].opened = 1; | 936 | chip->azx_dev[dev].opened = 1; |
887 | return &chip->azx_dev[dev]; | 937 | return &chip->azx_dev[dev]; |
@@ -899,8 +949,8 @@ static snd_pcm_hardware_t azx_pcm_hw = { | |||
899 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 949 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
900 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 950 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
901 | SNDRV_PCM_INFO_MMAP_VALID | | 951 | SNDRV_PCM_INFO_MMAP_VALID | |
902 | SNDRV_PCM_INFO_PAUSE | | 952 | SNDRV_PCM_INFO_PAUSE /*|*/ |
903 | SNDRV_PCM_INFO_RESUME), | 953 | /*SNDRV_PCM_INFO_RESUME*/), |
904 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 954 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
905 | .rates = SNDRV_PCM_RATE_48000, | 955 | .rates = SNDRV_PCM_RATE_48000, |
906 | .rate_min = 48000, | 956 | .rate_min = 48000, |
@@ -1049,6 +1099,7 @@ static int azx_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | |||
1049 | azx_dev->running = 1; | 1099 | azx_dev->running = 1; |
1050 | break; | 1100 | break; |
1051 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 1101 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
1102 | case SNDRV_PCM_TRIGGER_SUSPEND: | ||
1052 | case SNDRV_PCM_TRIGGER_STOP: | 1103 | case SNDRV_PCM_TRIGGER_STOP: |
1053 | azx_stream_stop(chip, azx_dev); | 1104 | azx_stream_stop(chip, azx_dev); |
1054 | azx_dev->running = 0; | 1105 | azx_dev->running = 0; |
@@ -1058,6 +1109,7 @@ static int azx_pcm_trigger(snd_pcm_substream_t *substream, int cmd) | |||
1058 | } | 1109 | } |
1059 | spin_unlock(&chip->reg_lock); | 1110 | spin_unlock(&chip->reg_lock); |
1060 | if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH || | 1111 | if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH || |
1112 | cmd == SNDRV_PCM_TRIGGER_SUSPEND || | ||
1061 | cmd == SNDRV_PCM_TRIGGER_STOP) { | 1113 | cmd == SNDRV_PCM_TRIGGER_STOP) { |
1062 | int timeout = 5000; | 1114 | int timeout = 5000; |
1063 | while (azx_sd_readb(azx_dev, SD_CTL) & SD_CTL_DMA_START && --timeout) | 1115 | while (azx_sd_readb(azx_dev, SD_CTL) & SD_CTL_DMA_START && --timeout) |
@@ -1136,6 +1188,7 @@ static int __devinit create_codec_pcm(azx_t *chip, struct hda_codec *codec, | |||
1136 | snd_dma_pci_data(chip->pci), | 1188 | snd_dma_pci_data(chip->pci), |
1137 | 1024 * 64, 1024 * 128); | 1189 | 1024 * 64, 1024 * 128); |
1138 | chip->pcm[pcm_dev] = pcm; | 1190 | chip->pcm[pcm_dev] = pcm; |
1191 | chip->pcm_devs = pcm_dev + 1; | ||
1139 | 1192 | ||
1140 | return 0; | 1193 | return 0; |
1141 | } | 1194 | } |
@@ -1186,7 +1239,7 @@ static int __devinit azx_init_stream(azx_t *chip) | |||
1186 | /* initialize each stream (aka device) | 1239 | /* initialize each stream (aka device) |
1187 | * assign the starting bdl address to each stream (device) and initialize | 1240 | * assign the starting bdl address to each stream (device) and initialize |
1188 | */ | 1241 | */ |
1189 | for (i = 0; i < MAX_ICH6_DEV; i++) { | 1242 | for (i = 0; i < chip->num_streams; i++) { |
1190 | unsigned int off = sizeof(u32) * (i * AZX_MAX_FRAG * 4); | 1243 | unsigned int off = sizeof(u32) * (i * AZX_MAX_FRAG * 4); |
1191 | azx_dev_t *azx_dev = &chip->azx_dev[i]; | 1244 | azx_dev_t *azx_dev = &chip->azx_dev[i]; |
1192 | azx_dev->bdl = (u32 *)(chip->bdl.area + off); | 1245 | azx_dev->bdl = (u32 *)(chip->bdl.area + off); |
@@ -1245,7 +1298,7 @@ static int azx_free(azx_t *chip) | |||
1245 | if (chip->initialized) { | 1298 | if (chip->initialized) { |
1246 | int i; | 1299 | int i; |
1247 | 1300 | ||
1248 | for (i = 0; i < MAX_ICH6_DEV; i++) | 1301 | for (i = 0; i < chip->num_streams; i++) |
1249 | azx_stream_stop(chip, &chip->azx_dev[i]); | 1302 | azx_stream_stop(chip, &chip->azx_dev[i]); |
1250 | 1303 | ||
1251 | /* disable interrupts */ | 1304 | /* disable interrupts */ |
@@ -1261,10 +1314,10 @@ static int azx_free(azx_t *chip) | |||
1261 | 1314 | ||
1262 | /* wait a little for interrupts to finish */ | 1315 | /* wait a little for interrupts to finish */ |
1263 | msleep(1); | 1316 | msleep(1); |
1264 | |||
1265 | iounmap(chip->remap_addr); | ||
1266 | } | 1317 | } |
1267 | 1318 | ||
1319 | if (chip->remap_addr) | ||
1320 | iounmap(chip->remap_addr); | ||
1268 | if (chip->irq >= 0) | 1321 | if (chip->irq >= 0) |
1269 | free_irq(chip->irq, (void*)chip); | 1322 | free_irq(chip->irq, (void*)chip); |
1270 | 1323 | ||
@@ -1276,6 +1329,7 @@ static int azx_free(azx_t *chip) | |||
1276 | snd_dma_free_pages(&chip->posbuf); | 1329 | snd_dma_free_pages(&chip->posbuf); |
1277 | pci_release_regions(chip->pci); | 1330 | pci_release_regions(chip->pci); |
1278 | pci_disable_device(chip->pci); | 1331 | pci_disable_device(chip->pci); |
1332 | kfree(chip->azx_dev); | ||
1279 | kfree(chip); | 1333 | kfree(chip); |
1280 | 1334 | ||
1281 | return 0; | 1335 | return 0; |
@@ -1290,7 +1344,8 @@ static int azx_dev_free(snd_device_t *device) | |||
1290 | * constructor | 1344 | * constructor |
1291 | */ | 1345 | */ |
1292 | static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, | 1346 | static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, |
1293 | int posfix, azx_t **rchip) | 1347 | int posfix, int driver_type, |
1348 | azx_t **rchip) | ||
1294 | { | 1349 | { |
1295 | azx_t *chip; | 1350 | azx_t *chip; |
1296 | int err = 0; | 1351 | int err = 0; |
@@ -1316,9 +1371,20 @@ static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, | |||
1316 | chip->card = card; | 1371 | chip->card = card; |
1317 | chip->pci = pci; | 1372 | chip->pci = pci; |
1318 | chip->irq = -1; | 1373 | chip->irq = -1; |
1374 | chip->driver_type = driver_type; | ||
1319 | 1375 | ||
1320 | chip->position_fix = posfix; | 1376 | chip->position_fix = posfix; |
1321 | 1377 | ||
1378 | #if BITS_PER_LONG != 64 | ||
1379 | /* Fix up base address on ULI M5461 */ | ||
1380 | if (chip->driver_type == AZX_DRIVER_ULI) { | ||
1381 | u16 tmp3; | ||
1382 | pci_read_config_word(pci, 0x40, &tmp3); | ||
1383 | pci_write_config_word(pci, 0x40, tmp3 | 0x10); | ||
1384 | pci_write_config_dword(pci, PCI_BASE_ADDRESS_1, 0); | ||
1385 | } | ||
1386 | #endif | ||
1387 | |||
1322 | if ((err = pci_request_regions(pci, "ICH HD audio")) < 0) { | 1388 | if ((err = pci_request_regions(pci, "ICH HD audio")) < 0) { |
1323 | kfree(chip); | 1389 | kfree(chip); |
1324 | pci_disable_device(pci); | 1390 | pci_disable_device(pci); |
@@ -1344,16 +1410,37 @@ static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, | |||
1344 | pci_set_master(pci); | 1410 | pci_set_master(pci); |
1345 | synchronize_irq(chip->irq); | 1411 | synchronize_irq(chip->irq); |
1346 | 1412 | ||
1413 | switch (chip->driver_type) { | ||
1414 | case AZX_DRIVER_ULI: | ||
1415 | chip->playback_streams = ULI_NUM_PLAYBACK; | ||
1416 | chip->capture_streams = ULI_NUM_CAPTURE; | ||
1417 | chip->playback_index_offset = ULI_PLAYBACK_INDEX; | ||
1418 | chip->capture_index_offset = ULI_CAPTURE_INDEX; | ||
1419 | break; | ||
1420 | default: | ||
1421 | chip->playback_streams = ICH6_NUM_PLAYBACK; | ||
1422 | chip->capture_streams = ICH6_NUM_CAPTURE; | ||
1423 | chip->playback_index_offset = ICH6_PLAYBACK_INDEX; | ||
1424 | chip->capture_index_offset = ICH6_CAPTURE_INDEX; | ||
1425 | break; | ||
1426 | } | ||
1427 | chip->num_streams = chip->playback_streams + chip->capture_streams; | ||
1428 | chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev), GFP_KERNEL); | ||
1429 | if (! chip->azx_dev) { | ||
1430 | snd_printk(KERN_ERR "cannot malloc azx_dev\n"); | ||
1431 | goto errout; | ||
1432 | } | ||
1433 | |||
1347 | /* allocate memory for the BDL for each stream */ | 1434 | /* allocate memory for the BDL for each stream */ |
1348 | if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), | 1435 | if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), |
1349 | PAGE_SIZE, &chip->bdl)) < 0) { | 1436 | BDL_SIZE, &chip->bdl)) < 0) { |
1350 | snd_printk(KERN_ERR SFX "cannot allocate BDL\n"); | 1437 | snd_printk(KERN_ERR SFX "cannot allocate BDL\n"); |
1351 | goto errout; | 1438 | goto errout; |
1352 | } | 1439 | } |
1353 | if (chip->position_fix == POS_FIX_POSBUF) { | 1440 | if (chip->position_fix == POS_FIX_POSBUF) { |
1354 | /* allocate memory for the position buffer */ | 1441 | /* allocate memory for the position buffer */ |
1355 | if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), | 1442 | if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), |
1356 | MAX_ICH6_DEV * 8, &chip->posbuf)) < 0) { | 1443 | chip->num_streams * 8, &chip->posbuf)) < 0) { |
1357 | snd_printk(KERN_ERR SFX "cannot allocate posbuf\n"); | 1444 | snd_printk(KERN_ERR SFX "cannot allocate posbuf\n"); |
1358 | goto errout; | 1445 | goto errout; |
1359 | } | 1446 | } |
@@ -1382,6 +1469,10 @@ static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, | |||
1382 | goto errout; | 1469 | goto errout; |
1383 | } | 1470 | } |
1384 | 1471 | ||
1472 | strcpy(card->driver, "HDA-Intel"); | ||
1473 | strcpy(card->shortname, driver_short_names[chip->driver_type]); | ||
1474 | sprintf(card->longname, "%s at 0x%lx irq %i", card->shortname, chip->addr, chip->irq); | ||
1475 | |||
1385 | *rchip = chip; | 1476 | *rchip = chip; |
1386 | return 0; | 1477 | return 0; |
1387 | 1478 | ||
@@ -1410,15 +1501,12 @@ static int __devinit azx_probe(struct pci_dev *pci, const struct pci_device_id * | |||
1410 | return -ENOMEM; | 1501 | return -ENOMEM; |
1411 | } | 1502 | } |
1412 | 1503 | ||
1413 | if ((err = azx_create(card, pci, position_fix[dev], &chip)) < 0) { | 1504 | if ((err = azx_create(card, pci, position_fix[dev], pci_id->driver_data, |
1505 | &chip)) < 0) { | ||
1414 | snd_card_free(card); | 1506 | snd_card_free(card); |
1415 | return err; | 1507 | return err; |
1416 | } | 1508 | } |
1417 | 1509 | ||
1418 | strcpy(card->driver, "HDA-Intel"); | ||
1419 | strcpy(card->shortname, "HDA Intel"); | ||
1420 | sprintf(card->longname, "%s at 0x%lx irq %i", card->shortname, chip->addr, chip->irq); | ||
1421 | |||
1422 | /* create codec instances */ | 1510 | /* create codec instances */ |
1423 | if ((err = azx_codec_create(chip, model[dev])) < 0) { | 1511 | if ((err = azx_codec_create(chip, model[dev])) < 0) { |
1424 | snd_card_free(card); | 1512 | snd_card_free(card); |
@@ -1459,12 +1547,13 @@ static void __devexit azx_remove(struct pci_dev *pci) | |||
1459 | 1547 | ||
1460 | /* PCI IDs */ | 1548 | /* PCI IDs */ |
1461 | static struct pci_device_id azx_ids[] = { | 1549 | static struct pci_device_id azx_ids[] = { |
1462 | { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICH6 */ | 1550 | { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */ |
1463 | { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICH7 */ | 1551 | { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */ |
1464 | { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ESB2 */ | 1552 | { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */ |
1465 | { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ATI SB450 */ | 1553 | { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ |
1466 | { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* VIA VT8251/VT8237A */ | 1554 | { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ |
1467 | { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ALI 5461? */ | 1555 | { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ |
1556 | { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ | ||
1468 | { 0, } | 1557 | { 0, } |
1469 | }; | 1558 | }; |
1470 | MODULE_DEVICE_TABLE(pci, azx_ids); | 1559 | MODULE_DEVICE_TABLE(pci, azx_ids); |