Ignore:
Timestamp:
Jan 4, 2021, 10:15:17 AM (5 years ago)
Author:
Paul Smedley
Message:

Update source to linux 5.10.4 level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/alsa-kernel/pci/intel8x0.c

    r625 r629  
    7070MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard.");
    7171module_param(ac97_clock, int, 0444);
    72 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = whitelist + auto-detect, 1 = force autodetect).");
     72MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = allowlist + auto-detect, 1 = force autodetect).");
    7373module_param(ac97_quirk, charp, 0444);
    7474MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
     
    397397        unsigned int ac97_sdin[3];
    398398        unsigned int max_codecs, ncodecs;
    399         unsigned int *codec_bit;
     399        const unsigned int *codec_bit;
    400400        unsigned int codec_isr_bits;
    401401        unsigned int codec_ready_bits;
     
    814814        case SNDRV_PCM_TRIGGER_RESUME:
    815815                ichdev->suspended = 0;
    816                 /* fall through */
     816                fallthrough;
    817817        case SNDRV_PCM_TRIGGER_START:
    818818        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
     
    822822        case SNDRV_PCM_TRIGGER_SUSPEND:
    823823                ichdev->suspended = 1;
    824                 /* fall through */
     824                fallthrough;
    825825        case SNDRV_PCM_TRIGGER_STOP:
    826826                val = 0;
     
    847847        struct ichdev *ichdev = get_ichdev(substream);
    848848        unsigned long port = ichdev->reg_offset;
    849         static int fiforeg[] = {
     849        static const int fiforeg[] = {
    850850                ICHREG(ALI_FIFOCR1), ICHREG(ALI_FIFOCR2), ICHREG(ALI_FIFOCR3)
    851851        };
     
    856856        case SNDRV_PCM_TRIGGER_RESUME:
    857857                ichdev->suspended = 0;
    858                 /* fall through */
     858                fallthrough;
    859859        case SNDRV_PCM_TRIGGER_START:
    860860        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
     
    873873        case SNDRV_PCM_TRIGGER_SUSPEND:
    874874                ichdev->suspended = 1;
    875                 /* fall through */
     875                fallthrough;
    876876        case SNDRV_PCM_TRIGGER_STOP:
    877877        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
     
    905905        int err;
    906906
    907         err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
    908         if (err < 0)
    909                 return err;
    910907        if (ichdev->pcm_open_flag) {
    911908                snd_ac97_pcm_close(ichdev->pcm);
     
    933930                ichdev->pcm_open_flag = 0;
    934931        }
    935         return snd_pcm_lib_free_pages(substream);
     932        return 0;
    936933}
    937934
     
    13181315        .open =         snd_intel8x0_playback_open,
    13191316        .close =        snd_intel8x0_playback_close,
    1320         .ioctl =        snd_pcm_lib_ioctl,
    13211317        .hw_params =    snd_intel8x0_hw_params,
    13221318        .hw_free =      snd_intel8x0_hw_free,
     
    13291325        .open =         snd_intel8x0_capture_open,
    13301326        .close =        snd_intel8x0_capture_close,
    1331         .ioctl =        snd_pcm_lib_ioctl,
    13321327        .hw_params =    snd_intel8x0_hw_params,
    13331328        .hw_free =      snd_intel8x0_hw_free,
     
    13401335        .open =         snd_intel8x0_mic_open,
    13411336        .close =        snd_intel8x0_mic_close,
    1342         .ioctl =        snd_pcm_lib_ioctl,
    13431337        .hw_params =    snd_intel8x0_hw_params,
    13441338        .hw_free =      snd_intel8x0_hw_free,
     
    13511345        .open =         snd_intel8x0_mic2_open,
    13521346        .close =        snd_intel8x0_mic2_close,
    1353         .ioctl =        snd_pcm_lib_ioctl,
    13541347        .hw_params =    snd_intel8x0_hw_params,
    13551348        .hw_free =      snd_intel8x0_hw_free,
     
    13621355        .open =         snd_intel8x0_capture2_open,
    13631356        .close =        snd_intel8x0_capture2_close,
    1364         .ioctl =        snd_pcm_lib_ioctl,
    13651357        .hw_params =    snd_intel8x0_hw_params,
    13661358        .hw_free =      snd_intel8x0_hw_free,
     
    13731365        .open =         snd_intel8x0_spdif_open,
    13741366        .close =        snd_intel8x0_spdif_close,
    1375         .ioctl =        snd_pcm_lib_ioctl,
    13761367        .hw_params =    snd_intel8x0_hw_params,
    13771368        .hw_free =      snd_intel8x0_hw_free,
     
    13841375        .open =         snd_intel8x0_playback_open,
    13851376        .close =        snd_intel8x0_playback_close,
    1386         .ioctl =        snd_pcm_lib_ioctl,
    13871377        .hw_params =    snd_intel8x0_hw_params,
    13881378        .hw_free =      snd_intel8x0_hw_free,
     
    13951385        .open =         snd_intel8x0_capture_open,
    13961386        .close =        snd_intel8x0_capture_close,
    1397         .ioctl =        snd_pcm_lib_ioctl,
    13981387        .hw_params =    snd_intel8x0_hw_params,
    13991388        .hw_free =      snd_intel8x0_hw_free,
     
    14061395        .open =         snd_intel8x0_mic_open,
    14071396        .close =        snd_intel8x0_mic_close,
    1408         .ioctl =        snd_pcm_lib_ioctl,
    14091397        .hw_params =    snd_intel8x0_hw_params,
    14101398        .hw_free =      snd_intel8x0_hw_free,
     
    14171405        .open =         snd_intel8x0_ali_ac97spdifout_open,
    14181406        .close =        snd_intel8x0_ali_ac97spdifout_close,
    1419         .ioctl =        snd_pcm_lib_ioctl,
    14201407        .hw_params =    snd_intel8x0_hw_params,
    14211408        .hw_free =      snd_intel8x0_hw_free,
     
    14291416        .open =         snd_intel8x0_ali_spdifin_open,
    14301417        .close =        snd_intel8x0_ali_spdifin_close,
    1431         .ioctl =        snd_pcm_lib_ioctl,
    14321418        .hw_params =    snd_intel8x0_hw_params,
    14331419        .hw_free =      snd_intel8x0_hw_free,
     
    14401426        .open =         snd_intel8x0_ali_spdifout_open,
    14411427        .close =        snd_intel8x0_ali_spdifout_close,
    1442         .ioctl =        snd_pcm_lib_ioctl,
    14431428        .hw_params =    snd_intel8x0_hw_params,
    14441429        .hw_free =      snd_intel8x0_hw_free,
     
    14621447
    14631448static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device,
    1464                              struct ich_pcm_table *rec)
     1449                             const struct ich_pcm_table *rec)
    14651450{
    14661451        struct snd_pcm *pcm;
     
    14911476        chip->pcm[device] = pcm;
    14921477
    1493         snd_pcm_lib_preallocate_pages_for_all(pcm, intel8x0_dma_type(chip),
    1494                                               snd_dma_pci_data(chip->pci),
    1495                                               rec->prealloc_size, rec->prealloc_max_size);
     1478        snd_pcm_set_managed_buffer_all(pcm, intel8x0_dma_type(chip),
     1479                                       &chip->pci->dev,
     1480                                       rec->prealloc_size, rec->prealloc_max_size);
    14961481
    14971482        if (rec->playback_ops &&
     
    15171502}
    15181503
    1519 static struct ich_pcm_table intel_pcms[] = {
     1504static const struct ich_pcm_table intel_pcms[] = {
    15201505        {
    15211506                .playback_ops = &snd_intel8x0_playback_ops,
     
    15541539};
    15551540
    1556 static struct ich_pcm_table nforce_pcms[] = {
     1541static const struct ich_pcm_table nforce_pcms[] = {
    15571542        {
    15581543                .playback_ops = &snd_intel8x0_playback_ops,
     
    15771562};
    15781563
    1579 static struct ich_pcm_table ali_pcms[] = {
     1564static const struct ich_pcm_table ali_pcms[] = {
    15801565        {
    15811566                .playback_ops = &snd_intel8x0_ali_playback_ops,
     
    16121597{
    16131598        int i, tblsize, device, err;
    1614         struct ich_pcm_table *tbl, *rec;
     1599        const struct ich_pcm_table *tbl, *rec;
    16151600
    16161601        switch (chip->device_type) {
     
    21572142        unsigned int i, codecs;
    21582143        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 = {
    21612146                .write = snd_intel8x0_codec_write,
    21622147                .read = snd_intel8x0_codec_read,
    21632148        };
    2164         static struct snd_ac97_bus_ops ali_bus_ops = {
     2149        static const struct snd_ac97_bus_ops ali_bus_ops = {
    21652150                .write = snd_intel8x0_ali_codec_write,
    21662151                .read = snd_intel8x0_ali_codec_read,
     
    23472332
    23482333#ifdef CONFIG_SND_AC97_POWER_SAVE
    2349 static struct snd_pci_quirk ich_chip_reset_mode[] = {
     2334static const struct snd_pci_quirk ich_chip_reset_mode[] = {
    23502335        SND_PCI_QUIRK(0x1014, 0x051f, "Thinkpad R32", 1),
    23512336        {0} /* end */
     
    26132598                free_irq(chip->irq, chip);
    26142599                chip->irq = -1;
     2600                card->sync_irq = -1;
    26152601        }
    26162602        return 0;
     
    26332619        }
    26342620        chip->irq = pci->irq;
    2635         synchronize_irq(chip->irq);
     2621        card->sync_irq = chip->irq;
    26362622
    26372623        /* re-initialize mixer stuff */
     
    28132799}
    28142800
    2815 static struct snd_pci_quirk intel8x0_clock_list[] = {
     2801static const struct snd_pci_quirk intel8x0_clock_list[] = {
    28162802        SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000),
    28172803        SND_PCI_QUIRK(0x1014, 0x0581, "AD1981B", 48000),
     
    28312817        if (!wl)
    28322818                return 0;
    2833         dev_info(chip->card->dev, "white list rate for %04x:%04x is %i\n",
     2819        dev_info(chip->card->dev, "allow list rate for %04x:%04x is %i\n",
    28342820               pci->subsystem_vendor, pci->subsystem_device, wl->value);
    28352821        chip->ac97_bus->clock = wl->value;
     
    28882874};
    28892875
    2890 static unsigned int ich_codec_bits[3] = {
     2876static const unsigned int ich_codec_bits[3] = {
    28912877        ICH_PCR, ICH_SCR, ICH_TCR
    28922878};
    2893 static unsigned int sis_codec_bits[3] = {
     2879static const unsigned int sis_codec_bits[3] = {
    28942880        ICH_PCR, ICH_SCR, ICH_SIS_TCR
    28952881};
     
    29362922        unsigned int int_sta_masks;
    29372923        struct ichdev *ichdev;
    2938         static struct snd_device_ops ops = {
     2924        static const struct snd_device_ops ops = {
    29392925                .dev_free =     snd_intel8x0_dev_free,
    29402926        };
    29412927
    2942         static unsigned int bdbars[] = {
     2928        static const unsigned int bdbars[] = {
    29432929                3, /* DEVICE_INTEL */
    29442930                6, /* DEVICE_INTEL_ICH4 */
     
    29472933                4, /* DEVICE_NFORCE */
    29482934        };
    2949         static struct ich_reg_info intel_regs[6] = {
     2935        static const struct ich_reg_info intel_regs[6] = {
    29502936                { ICH_PIINT, 0 },
    29512937                { ICH_POINT, 0x10 },
     
    29552941                { ICH_SPINT, 0x60 },
    29562942        };
    2957         static struct ich_reg_info nforce_regs[4] = {
     2943        static const struct ich_reg_info nforce_regs[4] = {
    29582944                { ICH_PIINT, 0 },
    29592945                { ICH_POINT, 0x10 },
     
    29612947                { ICH_NVSPINT, 0x70 },
    29622948        };
    2963         static struct ich_reg_info ali_regs[6] = {
     2949        static const struct ich_reg_info ali_regs[6] = {
    29642950                { ALI_INT_PCMIN, 0x40 },
    29652951                { ALI_INT_PCMOUT, 0x50 },
     
    29692955                { ALI_INT_SPDIFOUT, 0xb0 },
    29702956        };
    2971         struct ich_reg_info *tbl;
     2957        const struct ich_reg_info *tbl;
    29722958
    29732959        *r_intel8x0 = NULL;
     
    30723058        /* allocate buffer descriptor lists */
    30733059        /* 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,
    30753061                                chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2,
    30763062                                &chip->bdbars) < 0) {
     
    31323118        }
    31333119        chip->irq = pci->irq;
     3120        card->sync_irq = chip->irq;
    31343121
    31353122        if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
     
    31713158};
    31723159
    3173 static struct snd_pci_quirk spdif_aclink_defaults[] = {
     3160static const struct snd_pci_quirk spdif_aclink_defaults[] = {
    31743161        SND_PCI_QUIRK(0x147b, 0x1c1a, "ASUS KN8", 1),
    31753162        {0} /* end */
    31763163};
    31773164
    3178 /* look up white/black list for SPDIF over ac-link */
     3165/* look up allow/deny list for SPDIF over ac-link */
    31793166static int check_default_spdif_aclink(struct pci_dev *pci)
    31803167{
Note: See TracChangeset for help on using the changeset viewer.