Changeset 598 for GPL/trunk/alsa-kernel/pci/cmipci.c
- Timestamp:
- Apr 3, 2017, 4:51:56 PM (8 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk ¶
-
Property svn:mergeinfo
set to
/GPL/branches/uniaud32-2.1.x merged eligible
-
Property svn:mergeinfo
set to
-
TabularUnified GPL/trunk/alsa-kernel/pci/cmipci.c ¶
r479 r598 947 947 { 948 948 size_t ptr; 949 unsigned int reg; 949 unsigned int reg, rem, tries; 950 950 951 if (!rec->running) 951 952 return 0; 952 953 #if 1 // this seems better.. 953 954 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; 962 ok: 963 ptr = (rec->dma_size - (rem + 1)) >> rec->shift; 956 964 #else 957 965 reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1; … … 2308 2316 CMIPCI_SB_SW_MONO("Mic Playback Switch", 0), 2309 2317 CMIPCI_DOUBLE("Mic Capture Switch", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 0, 0, 1, 0, 0), 2310 CMIPCI_SB_VOL_MONO(" PC SpeakerPlayback Volume", SB_DSP4_SPEAKER_DEV, 6, 3),2318 CMIPCI_SB_VOL_MONO("Beep Playback Volume", SB_DSP4_SPEAKER_DEV, 6, 3), 2311 2319 CMIPCI_MIXER_VOL_STEREO("Aux Playback Volume", CM_REG_AUX_VOL, 4, 0, 15), 2312 2320 CMIPCI_MIXER_SW_STEREO("Aux Playback Switch", CM_REG_MIXER2, CM_VAUXLM_SHIFT, CM_VAUXRM_SHIFT, 0), … … 2316 2324 CMIPCI_SB_VOL_MONO("Phone Playback Volume", CM_REG_EXTENT_IND, 5, 7), 2317 2325 CMIPCI_DOUBLE("Phone Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 4, 4, 1, 0, 0), 2318 CMIPCI_DOUBLE(" PC SpeakerPlayback 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), 2319 2327 CMIPCI_DOUBLE("Mic Boost Capture Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 0, 0, 1, 0, 0), 2320 2328 }; … … 2516 2524 { 2517 2525 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); 2526 2532 } 2527 2533 … … 2573 2579 struct snd_ctl_elem_info *uinfo) 2574 2580 { 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); 2583 2584 } 2584 2585 … … 2813 2814 2814 2815 2815 static struct pci_device_id snd_cmipci_ids[]= {2816 static DEFINE_PCI_DEVICE_TABLE(snd_cmipci_ids) = { 2816 2817 {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A), 0}, 2817 2818 {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B), 0}, … … 3035 3036 char modelstr[16]; 3036 3037 int pcm_index, pcm_spdif_index; 3037 static struct pci_device_id intel_82437vx[]= {3038 static DEFINE_PCI_DEVICE_TABLE(intel_82437vx) = { 3038 3039 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX) }, 3039 3040 {0},
Note:
See TracChangeset
for help on using the changeset viewer.