Ignore:
Timestamp:
Apr 3, 2017, 4:51:56 PM (8 years ago)
Author:
David Azarewicz
Message:

Merged/reintegrated v2 branch into trunk. Trunk is now v2

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • TabularUnified GPL/trunk/alsa-kernel/pci/cmipci.c

    r479 r598  
    947947{
    948948        size_t ptr;
    949         unsigned int reg;
     949        unsigned int reg, rem, tries;
     950
    950951        if (!rec->running)
    951952                return 0;
    952953#if 1 // this seems better..
    953954        reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
    954         ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1);
    955         ptr >>= rec->shift;
     955        for (tries = 0; tries < 3; tries++) {
     956                rem = snd_cmipci_read_w(cm, reg);
     957                if (rem < rec->dma_size)
     958                        goto ok;
     959        }
     960        printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem);
     961        return SNDRV_PCM_POS_XRUN;
     962ok:
     963        ptr = (rec->dma_size - (rem + 1)) >> rec->shift;
    956964#else
    957965        reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1;
     
    23082316        CMIPCI_SB_SW_MONO("Mic Playback Switch", 0),
    23092317        CMIPCI_DOUBLE("Mic Capture Switch", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 0, 0, 1, 0, 0),
    2310         CMIPCI_SB_VOL_MONO("PC Speaker Playback Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
     2318        CMIPCI_SB_VOL_MONO("Beep Playback Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
    23112319        CMIPCI_MIXER_VOL_STEREO("Aux Playback Volume", CM_REG_AUX_VOL, 4, 0, 15),
    23122320        CMIPCI_MIXER_SW_STEREO("Aux Playback Switch", CM_REG_MIXER2, CM_VAUXLM_SHIFT, CM_VAUXRM_SHIFT, 0),
     
    23162324        CMIPCI_SB_VOL_MONO("Phone Playback Volume", CM_REG_EXTENT_IND, 5, 7),
    23172325        CMIPCI_DOUBLE("Phone Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 4, 4, 1, 0, 0),
    2318         CMIPCI_DOUBLE("PC Speaker Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 3, 3, 1, 0, 0),
     2326        CMIPCI_DOUBLE("Beep Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 3, 3, 1, 0, 0),
    23192327        CMIPCI_DOUBLE("Mic Boost Capture Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 0, 0, 1, 0, 0),
    23202328};
     
    25162524{
    25172525        struct cmipci *cm = snd_kcontrol_chip(kcontrol);
    2518         static char *texts[3] = { "Line-In", "Rear Output", "Bass Output" };
    2519         uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
    2520         uinfo->count = 1;
    2521         uinfo->value.enumerated.items = cm->chip_version >= 39 ? 3 : 2;
    2522         if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
    2523                 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
    2524         strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
    2525         return 0;
     2526        static const char *const texts[3] = {
     2527                "Line-In", "Rear Output", "Bass Output"
     2528        };
     2529
     2530        return snd_ctl_enum_info(uinfo, 1,
     2531                                 cm->chip_version >= 39 ? 3 : 2, texts);
    25262532}
    25272533
     
    25732579                                       struct snd_ctl_elem_info *uinfo)
    25742580{
    2575         static char *texts[2] = { "Mic-In", "Center/LFE Output" };
    2576         uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
    2577         uinfo->count = 1;
    2578         uinfo->value.enumerated.items = 2;
    2579         if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
    2580                 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
    2581         strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
    2582         return 0;
     2581        static const char *const texts[2] = { "Mic-In", "Center/LFE Output" };
     2582
     2583        return snd_ctl_enum_info(uinfo, 1, 2, texts);
    25832584}
    25842585
     
    28132814
    28142815
    2815 static struct pci_device_id snd_cmipci_ids[] = {
     2816static DEFINE_PCI_DEVICE_TABLE(snd_cmipci_ids) = {
    28162817        {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A), 0},
    28172818        {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B), 0},
     
    30353036        char modelstr[16];
    30363037        int pcm_index, pcm_spdif_index;
    3037         static struct pci_device_id intel_82437vx[] = {
     3038        static DEFINE_PCI_DEVICE_TABLE(intel_82437vx) = {
    30383039                { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX) },
    30393040                {0},
Note: See TracChangeset for help on using the changeset viewer.