Changeset 598 for GPL/trunk/alsa-kernel/pci/emu10k1
- Timestamp:
- Apr 3, 2017, 4:51:56 PM (9 years ago)
- Location:
- GPL/trunk
- Files:
-
- 11 edited
-
. (modified) (1 prop)
-
alsa-kernel/pci/emu10k1/emu10k1.c (modified) (3 diffs)
-
alsa-kernel/pci/emu10k1/emu10k1_main.c (modified) (1 diff)
-
alsa-kernel/pci/emu10k1/emu10k1x.c (modified) (4 diffs)
-
alsa-kernel/pci/emu10k1/emufx.c (modified) (5 diffs)
-
alsa-kernel/pci/emu10k1/emumixer.c (modified) (1 diff)
-
alsa-kernel/pci/emu10k1/emumpu401.c (modified) (1 diff)
-
alsa-kernel/pci/emu10k1/emupcm.c (modified) (5 diffs)
-
alsa-kernel/pci/emu10k1/emuproc.c (modified) (4 diffs)
-
alsa-kernel/pci/emu10k1/memory.c (modified) (2 diffs)
-
alsa-kernel/pci/emu10k1/p16v.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
-
Property svn:mergeinfo
set to
/GPL/branches/uniaud32-2.1.x merged eligible
-
Property svn:mergeinfo
set to
-
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1.c
r464 r598 59 59 static int enable_ir[SNDRV_CARDS]; 60 60 static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */ 61 #ifndef TARGET_OS2 62 static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; 63 #else 64 static uint delay_pcm_irq[SNDRV_CARDS] = {2,2,2,2,2,2,2,2}; 65 #endif 61 66 62 67 module_param_array(index, int, NULL, 0444); … … 80 85 module_param_array(subsystem, uint, NULL, 0444); 81 86 MODULE_PARM_DESC(subsystem, "Force card subsystem model."); 87 module_param_array(delay_pcm_irq, uint, NULL, 0444); 88 MODULE_PARM_DESC(delay_pcm_irq, "Delay PCM interrupt by specified number of samples (default 0)."); 82 89 /* 83 90 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 84 91 */ 85 static struct pci_device_id snd_emu10k1_ids[]= {92 static DEFINE_PCI_DEVICE_TABLE(snd_emu10k1_ids) = { 86 93 { PCI_VDEVICE(CREATIVE, 0x0002), 0 }, /* EMU10K1 */ 87 94 { PCI_VDEVICE(CREATIVE, 0x0004), 1 }, /* Audigy */ … … 134 141 goto error; 135 142 card->private_data = emu; 143 emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f; 136 144 if ((err = snd_emu10k1_pcm(emu, 0, NULL)) < 0) 137 145 goto error; -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_main.c
r522 r598 1797 1797 snd_printdd("Sound card name = %s, " 1798 1798 "vendor = 0x%x, device = 0x%x, subsystem = 0x%x. " 1799 "Forced to subsy tem = 0x%x\n", c->name,1799 "Forced to subsystem = 0x%x\n", c->name, 1800 1800 pci->vendor, pci->device, emu->serial, c->subsystem); 1801 1801 else -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1x.c
r522 r598 115 115 #define PLAYBACK_LIST_SIZE 0x01 /* Size of list in bytes << 16. E.g. 8 periods -> 0x00380000 */ 116 116 #define PLAYBACK_LIST_PTR 0x02 /* Pointer to the current period being played */ 117 #define PLAYBACK_DMA_ADDR 0x04 /* Playback DMA address s*/117 #define PLAYBACK_DMA_ADDR 0x04 /* Playback DMA address */ 118 118 #define PLAYBACK_PERIOD_SIZE 0x05 /* Playback period size */ 119 119 #define PLAYBACK_POINTER 0x06 /* Playback period pointer. Sample currently in DAC */ … … 185 185 * - channel 0 is the front channel 186 186 * - channel 1 is the rear channel 187 * - channel 2 is the center/lfe chan el187 * - channel 2 is the center/lfe channel 188 188 * Volume is controlled by the AC97 for the front and rear channels by 189 189 * the PCM Playback Volume, Sigmatel Surround Playback Volume and … … 1045 1045 continue; 1046 1046 1047 if ( (reg < 0x49) /* && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) DAZ */ && (channel_id <= 2))1047 if (reg < 0x49 && /* val <= 0xffffffff && DAZ */ channel_id <= 2) 1048 1048 snd_emu10k1x_ptr_write(emu, reg, channel_id, val); 1049 1049 } … … 1610 1610 1611 1611 // PCI IDs 1612 static struct pci_device_id snd_emu10k1x_ids[]= {1612 static DEFINE_PCI_DEVICE_TABLE(snd_emu10k1x_ids) = { 1613 1613 { PCI_VDEVICE(CREATIVE, 0x0006), 0 }, /* Dell OEM version (EMU10K1) */ 1614 1614 { 0, } -
GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c
r479 r598 36 36 #include <linux/init.h> 37 37 #include <linux/mutex.h> 38 #include <linux/moduleparam.h> 38 39 39 40 #include <sound/core.h> … … 51 52 #define EMU10K1_CENTER_LFE_FROM_FRONT 52 53 #endif 54 55 static bool high_res_gpr_volume; 56 module_param(high_res_gpr_volume, bool, 0444); 57 MODULE_PARM_DESC(high_res_gpr_volume, "GPR mixer controls use 31-bit range."); 53 58 54 59 /* … … 298 303 /* EMU10k1/EMU10k2 DSP control db gain */ 299 304 static const DECLARE_TLV_DB_SCALE(snd_emu10k1_db_scale1, -4000, 40, 1); 305 static const DECLARE_TLV_DB_LINEAR(snd_emu10k1_db_linear, TLV_DB_GAIN_MUTE, 0); 300 306 301 307 static const u32 onoff_table[2] = { … … 1074 1080 ctl->vcount = ctl->count = 1; 1075 1081 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; 1076 ctl->min = 0; 1077 ctl->max = 100; 1078 ctl->tlv = snd_emu10k1_db_scale1; 1079 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1082 if (high_res_gpr_volume) { 1083 ctl->min = 0; 1084 ctl->max = 0x7fffffff; 1085 ctl->tlv = snd_emu10k1_db_linear; 1086 ctl->translation = EMU10K1_GPR_TRANSLATION_NONE; 1087 } else { 1088 ctl->min = 0; 1089 ctl->max = 100; 1090 ctl->tlv = snd_emu10k1_db_scale1; 1091 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1092 } 1080 1093 } 1081 1094 … … 1089 1102 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; 1090 1103 ctl->gpr[1] = gpr + 1; ctl->value[1] = defval; 1091 ctl->min = 0; 1092 ctl->max = 100; 1093 ctl->tlv = snd_emu10k1_db_scale1; 1094 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1104 if (high_res_gpr_volume) { 1105 ctl->min = 0; 1106 ctl->max = 0x7fffffff; 1107 ctl->tlv = snd_emu10k1_db_linear; 1108 ctl->translation = EMU10K1_GPR_TRANSLATION_NONE; 1109 } else { 1110 ctl->min = 0; 1111 ctl->max = 100; 1112 ctl->tlv = snd_emu10k1_db_scale1; 1113 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1114 } 1095 1115 } 1096 1116 -
GPL/trunk/alsa-kernel/pci/emu10k1/emumixer.c
r410 r598 1819 1819 "Master Playback Volume", "Master Capture Volume", 1820 1820 "Wave Master Playback Volume", "Master Playback Volume", 1821 " PC Speaker Playback Switch", "PC SpeakerCapture Switch",1822 " PC Speaker Playback Volume", "PC SpeakerCapture Volume",1821 "Beep Playback Switch", "Beep Capture Switch", 1822 "Beep Playback Volume", "Beep Capture Volume", 1823 1823 "Phone Playback Switch", "Phone Capture Switch", 1824 1824 "Phone Playback Volume", "Phone Capture Volume", -
GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c
r399 r598 322 322 static void snd_emu10k1_midi_free(struct snd_rawmidi *rmidi) 323 323 { 324 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)rmidi->private_data;324 struct snd_emu10k1_midi *midi = rmidi->private_data; 325 325 midi->interrupt = NULL; 326 326 midi->rmidi = NULL; -
GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c
r464 r598 333 333 if (extra) { 334 334 start_addr += ccis; 335 end_addr += ccis ;335 end_addr += ccis + emu->delay_pcm_irq; 336 336 } 337 337 if (stereo && !extra) { … … 361 361 snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]); 362 362 snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24)); 363 snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24)); 363 snd_emu10k1_ptr_write(emu, PSST, voice, 364 (start_addr + (extra ? emu->delay_pcm_irq : 0)) | 365 (send_amount[2] << 24)); 364 366 if (emu->card_capabilities->emu_model) 365 367 pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ … … 733 735 } 734 736 737 static inline void snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu, 738 struct snd_emu10k1_pcm *epcm, 739 struct snd_pcm_substream *substream, 740 struct snd_pcm_runtime *runtime) 741 { 742 unsigned int ptr, period_pos; 743 744 /* try to sychronize the current position for the interrupt 745 source voice */ 746 period_pos = runtime->status->hw_ptr - runtime->hw_ptr_interrupt; 747 period_pos %= runtime->period_size; 748 ptr = snd_emu10k1_ptr_read(emu, CCCA, epcm->extra->number); 749 ptr &= ~0x00ffffff; 750 ptr |= epcm->ccca_start_addr + period_pos; 751 snd_emu10k1_ptr_write(emu, CCCA, epcm->extra->number, ptr); 752 } 753 735 754 static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream, 736 755 int cmd) … … 754 773 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 755 774 case SNDRV_PCM_TRIGGER_RESUME: 775 if (cmd == SNDRV_PCM_TRIGGER_PAUSE_RELEASE) 776 snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime); 756 777 mix = &emu->pcm_mixer[substream->number]; 757 778 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix); … … 870 891 /* 871 892 printk(KERN_DEBUG 872 "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n", 873 ptr, runtime->buffer_size, runtime->period_size); 893 "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n", 894 (long)ptr, (long)runtime->buffer_size, 895 (long)runtime->period_size); 874 896 */ 875 897 return ptr; -
GPL/trunk/alsa-kernel/pci/emu10k1/emuproc.c
r399 r598 342 342 #define A_TOTAL_SIZE_CODE (0x400*8) 343 343 344 static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry, 345 void *file_private_data, 346 struct file *file, char __user *buf, 347 unsigned long count, unsigned long pos) 348 { 349 long size; 344 static ssize_t snd_emu10k1_fx8010_read(struct snd_info_entry *entry, 345 void *file_private_data, 346 struct file *file, char __user *buf, 347 size_t count, loff_t pos) 348 { 350 349 struct snd_emu10k1 *emu = entry->private_data; 351 350 unsigned int offset; 352 351 int tram_addr = 0; 352 unsigned int *tmp; 353 long res; 354 unsigned int idx; 353 355 354 356 if (!strcmp(entry->name, "fx8010_tram_addr")) { … … 362 364 offset = emu->audigy ? A_FXGPREGBASE : FXGPREGBASE; 363 365 } 364 size = count; 365 if (pos + size > entry->size) 366 size = (long)entry->size - pos; 367 if (size > 0) { 368 unsigned int *tmp; 369 long res; 370 unsigned int idx; 371 if ((tmp = kmalloc(size + 8, GFP_KERNEL)) == NULL) 372 return -ENOMEM; 373 for (idx = 0; idx < ((pos & 3) + size + 3) >> 2; idx++) 374 if (tram_addr && emu->audigy) { 375 tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0) >> 11; 376 tmp[idx] |= snd_emu10k1_ptr_read(emu, 0x100 + idx + (pos >> 2), 0) << 20; 377 } else 378 tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0); 379 if (copy_to_user(buf, ((char *)tmp) + (pos & 3), size)) 380 res = -EFAULT; 381 else { 382 res = size; 366 367 tmp = kmalloc(count + 8, GFP_KERNEL); 368 if (!tmp) 369 return -ENOMEM; 370 for (idx = 0; idx < ((pos & 3) + count + 3) >> 2; idx++) { 371 unsigned int val; 372 val = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0); 373 if (tram_addr && emu->audigy) { 374 val >>= 11; 375 val |= snd_emu10k1_ptr_read(emu, 0x100 + idx + (pos >> 2), 0) << 20; 383 376 } 384 kfree(tmp); 385 return res; 386 } 387 return 0; 377 tmp[idx] = val; 378 } 379 if (copy_to_user(buf, ((char *)tmp) + (pos & 3), count)) 380 res = -EFAULT; 381 else 382 res = count; 383 kfree(tmp); 384 return res; 388 385 } 389 386 … … 452 449 if (sscanf(line, "%x %x", ®, &val) != 2) 453 450 continue; 454 if ( (reg < 0x40) && (reg >= 0) && (val <= 0xffffffff)) {451 if (reg < 0x40 && val <= 0xffffffff) { 455 452 spin_lock_irqsave(&emu->emu_lock, flags); 456 453 outl(val, emu->port + (reg & 0xfffffffc)); … … 528 525 if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3) 529 526 continue; 530 if ( (reg < 0xa0) && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) && (channel_id <= 3))527 if (reg < 0xa0 && val <= 0xffffffff && channel_id <= 3) 531 528 snd_ptr_write(emu, iobase, reg, channel_id, val); 532 529 } -
GPL/trunk/alsa-kernel/pci/emu10k1/memory.c
r522 r598 23 23 24 24 #include <linux/pci.h> 25 #include <linux/gfp.h> 25 26 #include <linux/time.h> 26 27 #include <linux/mutex.h> … … 310 311 return NULL; 311 312 313 idx = runtime->period_size >= runtime->buffer_size ? 314 (emu->delay_pcm_irq * 2) : 0; 312 315 mutex_lock(&hdr->block_mutex); 313 blk = search_empty(emu, runtime->dma_bytes );316 blk = search_empty(emu, runtime->dma_bytes + idx); 314 317 if (blk == NULL) { 315 318 mutex_unlock(&hdr->block_mutex); -
GPL/trunk/alsa-kernel/pci/emu10k1/p16v.h
r305 r598 97 97 #define PLAYBACK_LIST_PTR 0x02 /* Pointer to the current period being played */ 98 98 #define PLAYBACK_UNKNOWN3 0x03 /* Not used */ 99 #define PLAYBACK_DMA_ADDR 0x04 /* Playback DMA address s*/99 #define PLAYBACK_DMA_ADDR 0x04 /* Playback DMA address */ 100 100 #define PLAYBACK_PERIOD_SIZE 0x05 /* Playback period size. win2000 uses 0x04000000 */ 101 101 #define PLAYBACK_POINTER 0x06 /* Playback period pointer. Used with PLAYBACK_LIST_PTR to determine buffer position currently in DAC */
Note:
See TracChangeset
for help on using the changeset viewer.
