Changeset 629 for GPL/branches/uniaud32-next/alsa-kernel/pci/intel8x0.c
- Timestamp:
- Jan 4, 2021, 10:15:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/alsa-kernel/pci/intel8x0.c
r625 r629 70 70 MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard."); 71 71 module_param(ac97_clock, int, 0444); 72 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = whitelist + auto-detect, 1 = force autodetect).");72 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = allowlist + auto-detect, 1 = force autodetect)."); 73 73 module_param(ac97_quirk, charp, 0444); 74 74 MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); … … 397 397 unsigned int ac97_sdin[3]; 398 398 unsigned int max_codecs, ncodecs; 399 unsigned int *codec_bit;399 const unsigned int *codec_bit; 400 400 unsigned int codec_isr_bits; 401 401 unsigned int codec_ready_bits; … … 814 814 case SNDRV_PCM_TRIGGER_RESUME: 815 815 ichdev->suspended = 0; 816 /* fall through */816 fallthrough; 817 817 case SNDRV_PCM_TRIGGER_START: 818 818 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: … … 822 822 case SNDRV_PCM_TRIGGER_SUSPEND: 823 823 ichdev->suspended = 1; 824 /* fall through */824 fallthrough; 825 825 case SNDRV_PCM_TRIGGER_STOP: 826 826 val = 0; … … 847 847 struct ichdev *ichdev = get_ichdev(substream); 848 848 unsigned long port = ichdev->reg_offset; 849 static int fiforeg[] = {849 static const int fiforeg[] = { 850 850 ICHREG(ALI_FIFOCR1), ICHREG(ALI_FIFOCR2), ICHREG(ALI_FIFOCR3) 851 851 }; … … 856 856 case SNDRV_PCM_TRIGGER_RESUME: 857 857 ichdev->suspended = 0; 858 /* fall through */858 fallthrough; 859 859 case SNDRV_PCM_TRIGGER_START: 860 860 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: … … 873 873 case SNDRV_PCM_TRIGGER_SUSPEND: 874 874 ichdev->suspended = 1; 875 /* fall through */875 fallthrough; 876 876 case SNDRV_PCM_TRIGGER_STOP: 877 877 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: … … 905 905 int err; 906 906 907 err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));908 if (err < 0)909 return err;910 907 if (ichdev->pcm_open_flag) { 911 908 snd_ac97_pcm_close(ichdev->pcm); … … 933 930 ichdev->pcm_open_flag = 0; 934 931 } 935 return snd_pcm_lib_free_pages(substream);932 return 0; 936 933 } 937 934 … … 1318 1315 .open = snd_intel8x0_playback_open, 1319 1316 .close = snd_intel8x0_playback_close, 1320 .ioctl = snd_pcm_lib_ioctl,1321 1317 .hw_params = snd_intel8x0_hw_params, 1322 1318 .hw_free = snd_intel8x0_hw_free, … … 1329 1325 .open = snd_intel8x0_capture_open, 1330 1326 .close = snd_intel8x0_capture_close, 1331 .ioctl = snd_pcm_lib_ioctl,1332 1327 .hw_params = snd_intel8x0_hw_params, 1333 1328 .hw_free = snd_intel8x0_hw_free, … … 1340 1335 .open = snd_intel8x0_mic_open, 1341 1336 .close = snd_intel8x0_mic_close, 1342 .ioctl = snd_pcm_lib_ioctl,1343 1337 .hw_params = snd_intel8x0_hw_params, 1344 1338 .hw_free = snd_intel8x0_hw_free, … … 1351 1345 .open = snd_intel8x0_mic2_open, 1352 1346 .close = snd_intel8x0_mic2_close, 1353 .ioctl = snd_pcm_lib_ioctl,1354 1347 .hw_params = snd_intel8x0_hw_params, 1355 1348 .hw_free = snd_intel8x0_hw_free, … … 1362 1355 .open = snd_intel8x0_capture2_open, 1363 1356 .close = snd_intel8x0_capture2_close, 1364 .ioctl = snd_pcm_lib_ioctl,1365 1357 .hw_params = snd_intel8x0_hw_params, 1366 1358 .hw_free = snd_intel8x0_hw_free, … … 1373 1365 .open = snd_intel8x0_spdif_open, 1374 1366 .close = snd_intel8x0_spdif_close, 1375 .ioctl = snd_pcm_lib_ioctl,1376 1367 .hw_params = snd_intel8x0_hw_params, 1377 1368 .hw_free = snd_intel8x0_hw_free, … … 1384 1375 .open = snd_intel8x0_playback_open, 1385 1376 .close = snd_intel8x0_playback_close, 1386 .ioctl = snd_pcm_lib_ioctl,1387 1377 .hw_params = snd_intel8x0_hw_params, 1388 1378 .hw_free = snd_intel8x0_hw_free, … … 1395 1385 .open = snd_intel8x0_capture_open, 1396 1386 .close = snd_intel8x0_capture_close, 1397 .ioctl = snd_pcm_lib_ioctl,1398 1387 .hw_params = snd_intel8x0_hw_params, 1399 1388 .hw_free = snd_intel8x0_hw_free, … … 1406 1395 .open = snd_intel8x0_mic_open, 1407 1396 .close = snd_intel8x0_mic_close, 1408 .ioctl = snd_pcm_lib_ioctl,1409 1397 .hw_params = snd_intel8x0_hw_params, 1410 1398 .hw_free = snd_intel8x0_hw_free, … … 1417 1405 .open = snd_intel8x0_ali_ac97spdifout_open, 1418 1406 .close = snd_intel8x0_ali_ac97spdifout_close, 1419 .ioctl = snd_pcm_lib_ioctl,1420 1407 .hw_params = snd_intel8x0_hw_params, 1421 1408 .hw_free = snd_intel8x0_hw_free, … … 1429 1416 .open = snd_intel8x0_ali_spdifin_open, 1430 1417 .close = snd_intel8x0_ali_spdifin_close, 1431 .ioctl = snd_pcm_lib_ioctl,1432 1418 .hw_params = snd_intel8x0_hw_params, 1433 1419 .hw_free = snd_intel8x0_hw_free, … … 1440 1426 .open = snd_intel8x0_ali_spdifout_open, 1441 1427 .close = snd_intel8x0_ali_spdifout_close, 1442 .ioctl = snd_pcm_lib_ioctl,1443 1428 .hw_params = snd_intel8x0_hw_params, 1444 1429 .hw_free = snd_intel8x0_hw_free, … … 1462 1447 1463 1448 static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device, 1464 struct ich_pcm_table *rec)1449 const struct ich_pcm_table *rec) 1465 1450 { 1466 1451 struct snd_pcm *pcm; … … 1491 1476 chip->pcm[device] = pcm; 1492 1477 1493 snd_pcm_ lib_preallocate_pages_for_all(pcm, intel8x0_dma_type(chip),1494 snd_dma_pci_data(chip->pci),1495 1478 snd_pcm_set_managed_buffer_all(pcm, intel8x0_dma_type(chip), 1479 &chip->pci->dev, 1480 rec->prealloc_size, rec->prealloc_max_size); 1496 1481 1497 1482 if (rec->playback_ops && … … 1517 1502 } 1518 1503 1519 static struct ich_pcm_table intel_pcms[] = {1504 static const struct ich_pcm_table intel_pcms[] = { 1520 1505 { 1521 1506 .playback_ops = &snd_intel8x0_playback_ops, … … 1554 1539 }; 1555 1540 1556 static struct ich_pcm_table nforce_pcms[] = {1541 static const struct ich_pcm_table nforce_pcms[] = { 1557 1542 { 1558 1543 .playback_ops = &snd_intel8x0_playback_ops, … … 1577 1562 }; 1578 1563 1579 static struct ich_pcm_table ali_pcms[] = {1564 static const struct ich_pcm_table ali_pcms[] = { 1580 1565 { 1581 1566 .playback_ops = &snd_intel8x0_ali_playback_ops, … … 1612 1597 { 1613 1598 int i, tblsize, device, err; 1614 struct ich_pcm_table *tbl, *rec;1599 const struct ich_pcm_table *tbl, *rec; 1615 1600 1616 1601 switch (chip->device_type) { … … 2157 2142 unsigned int i, codecs; 2158 2143 unsigned int glob_sta = 0; 2159 struct snd_ac97_bus_ops *ops;2160 static struct snd_ac97_bus_ops standard_bus_ops = {2144 const struct snd_ac97_bus_ops *ops; 2145 static const struct snd_ac97_bus_ops standard_bus_ops = { 2161 2146 .write = snd_intel8x0_codec_write, 2162 2147 .read = snd_intel8x0_codec_read, 2163 2148 }; 2164 static struct snd_ac97_bus_ops ali_bus_ops = {2149 static const struct snd_ac97_bus_ops ali_bus_ops = { 2165 2150 .write = snd_intel8x0_ali_codec_write, 2166 2151 .read = snd_intel8x0_ali_codec_read, … … 2347 2332 2348 2333 #ifdef CONFIG_SND_AC97_POWER_SAVE 2349 static struct snd_pci_quirk ich_chip_reset_mode[] = {2334 static const struct snd_pci_quirk ich_chip_reset_mode[] = { 2350 2335 SND_PCI_QUIRK(0x1014, 0x051f, "Thinkpad R32", 1), 2351 2336 {0} /* end */ … … 2613 2598 free_irq(chip->irq, chip); 2614 2599 chip->irq = -1; 2600 card->sync_irq = -1; 2615 2601 } 2616 2602 return 0; … … 2633 2619 } 2634 2620 chip->irq = pci->irq; 2635 synchronize_irq(chip->irq);2621 card->sync_irq = chip->irq; 2636 2622 2637 2623 /* re-initialize mixer stuff */ … … 2813 2799 } 2814 2800 2815 static struct snd_pci_quirk intel8x0_clock_list[] = {2801 static const struct snd_pci_quirk intel8x0_clock_list[] = { 2816 2802 SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000), 2817 2803 SND_PCI_QUIRK(0x1014, 0x0581, "AD1981B", 48000), … … 2831 2817 if (!wl) 2832 2818 return 0; 2833 dev_info(chip->card->dev, " whitelist rate for %04x:%04x is %i\n",2819 dev_info(chip->card->dev, "allow list rate for %04x:%04x is %i\n", 2834 2820 pci->subsystem_vendor, pci->subsystem_device, wl->value); 2835 2821 chip->ac97_bus->clock = wl->value; … … 2888 2874 }; 2889 2875 2890 static unsigned int ich_codec_bits[3] = {2876 static const unsigned int ich_codec_bits[3] = { 2891 2877 ICH_PCR, ICH_SCR, ICH_TCR 2892 2878 }; 2893 static unsigned int sis_codec_bits[3] = {2879 static const unsigned int sis_codec_bits[3] = { 2894 2880 ICH_PCR, ICH_SCR, ICH_SIS_TCR 2895 2881 }; … … 2936 2922 unsigned int int_sta_masks; 2937 2923 struct ichdev *ichdev; 2938 static struct snd_device_ops ops = {2924 static const struct snd_device_ops ops = { 2939 2925 .dev_free = snd_intel8x0_dev_free, 2940 2926 }; 2941 2927 2942 static unsigned int bdbars[] = {2928 static const unsigned int bdbars[] = { 2943 2929 3, /* DEVICE_INTEL */ 2944 2930 6, /* DEVICE_INTEL_ICH4 */ … … 2947 2933 4, /* DEVICE_NFORCE */ 2948 2934 }; 2949 static struct ich_reg_info intel_regs[6] = {2935 static const struct ich_reg_info intel_regs[6] = { 2950 2936 { ICH_PIINT, 0 }, 2951 2937 { ICH_POINT, 0x10 }, … … 2955 2941 { ICH_SPINT, 0x60 }, 2956 2942 }; 2957 static struct ich_reg_info nforce_regs[4] = {2943 static const struct ich_reg_info nforce_regs[4] = { 2958 2944 { ICH_PIINT, 0 }, 2959 2945 { ICH_POINT, 0x10 }, … … 2961 2947 { ICH_NVSPINT, 0x70 }, 2962 2948 }; 2963 static struct ich_reg_info ali_regs[6] = {2949 static const struct ich_reg_info ali_regs[6] = { 2964 2950 { ALI_INT_PCMIN, 0x40 }, 2965 2951 { ALI_INT_PCMOUT, 0x50 }, … … 2969 2955 { ALI_INT_SPDIFOUT, 0xb0 }, 2970 2956 }; 2971 struct ich_reg_info *tbl;2957 const struct ich_reg_info *tbl; 2972 2958 2973 2959 *r_intel8x0 = NULL; … … 3072 3058 /* allocate buffer descriptor lists */ 3073 3059 /* the start of each lists must be aligned to 8 bytes */ 3074 if (snd_dma_alloc_pages(intel8x0_dma_type(chip), snd_dma_pci_data(pci),3060 if (snd_dma_alloc_pages(intel8x0_dma_type(chip), &pci->dev, 3075 3061 chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, 3076 3062 &chip->bdbars) < 0) { … … 3132 3118 } 3133 3119 chip->irq = pci->irq; 3120 card->sync_irq = chip->irq; 3134 3121 3135 3122 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { … … 3171 3158 }; 3172 3159 3173 static struct snd_pci_quirk spdif_aclink_defaults[] = {3160 static const struct snd_pci_quirk spdif_aclink_defaults[] = { 3174 3161 SND_PCI_QUIRK(0x147b, 0x1c1a, "ASUS KN8", 1), 3175 3162 {0} /* end */ 3176 3163 }; 3177 3164 3178 /* look up white/blacklist for SPDIF over ac-link */3165 /* look up allow/deny list for SPDIF over ac-link */ 3179 3166 static int check_default_spdif_aclink(struct pci_dev *pci) 3180 3167 {
Note:
See TracChangeset
for help on using the changeset viewer.