Changeset 772 for GPL/trunk/alsa-kernel/pci/emu10k1/timer.c
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (4 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/emu10k1/timer.c
r703 r772 3 3 * Copyright (c) by Lee Revell <rlrevell@joe-job.com> 4 4 * Clemens Ladisch <clemens@ladisch.de> 5 * Oswald Buddenhagen <oswald.buddenhagen@gmx.de> 6 * 5 7 * Routines for control of EMU10K1 chips 6 *7 * BUGS:8 * --9 *10 * TODO:11 * --12 8 */ 13 9 … … 19 15 { 20 16 struct snd_emu10k1 *emu; 21 unsigned long flags;22 17 unsigned int delay; 23 18 … … 26 21 if (delay < 5 ) /* minimum time is 5 ticks */ 27 22 delay = 5; 28 spin_lock_irqsave(&emu->reg_lock, flags);29 23 snd_emu10k1_intr_enable(emu, INTE_INTERVALTIMERENB); 30 24 outw(delay & TIMER_RATE_MASK, emu->port + TIMER); 31 spin_unlock_irqrestore(&emu->reg_lock, flags);32 25 return 0; 33 26 } … … 36 29 { 37 30 struct snd_emu10k1 *emu; 38 unsigned long flags;39 31 40 32 emu = snd_timer_chip(timer); 41 spin_lock_irqsave(&emu->reg_lock, flags);42 33 snd_emu10k1_intr_disable(emu, INTE_INTERVALTIMERENB); 43 spin_unlock_irqrestore(&emu->reg_lock, flags);44 34 return 0; 35 } 36 37 static unsigned long snd_emu10k1_timer_c_resolution(struct snd_timer *timer) 38 { 39 struct snd_emu10k1 *emu = snd_timer_chip(timer); 40 41 if (emu->card_capabilities->emu_model && 42 emu->emu1010.word_clock == 44100) 43 return 22676; // 1 sample @ 44.1 kHz = 22.675736...us 44 else 45 return 20833; // 1 sample @ 48 kHz = 20.833...us 45 46 } 46 47 … … 48 49 unsigned long *num, unsigned long *den) 49 50 { 51 struct snd_emu10k1 *emu = snd_timer_chip(timer); 52 50 53 *num = 1; 51 *den = 48000; 54 if (emu->card_capabilities->emu_model) 55 *den = emu->emu1010.word_clock; 56 else 57 *den = 48000; 52 58 return 0; 53 59 } … … 55 61 static const struct snd_timer_hardware snd_emu10k1_timer_hw = { 56 62 .flags = SNDRV_TIMER_HW_AUTO, 57 .resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */58 63 .ticks = 1024, 59 64 .start = snd_emu10k1_timer_start, 60 65 .stop = snd_emu10k1_timer_stop, 66 .c_resolution = snd_emu10k1_timer_c_resolution, 61 67 .precise_resolution = snd_emu10k1_timer_precise_resolution, 62 68 };
Note:
See TracChangeset
for help on using the changeset viewer.