Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/emu10k1/timer.c

    r703 r772  
    33 *  Copyright (c) by Lee Revell <rlrevell@joe-job.com>
    44 *                   Clemens Ladisch <clemens@ladisch.de>
     5 *                   Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
     6 *
    57 *  Routines for control of EMU10K1 chips
    6  *
    7  *  BUGS:
    8  *    --
    9  *
    10  *  TODO:
    11  *    --
    128 */
    139
     
    1915{
    2016        struct snd_emu10k1 *emu;
    21         unsigned long flags;
    2217        unsigned int delay;
    2318
     
    2621        if (delay < 5 ) /* minimum time is 5 ticks */
    2722                delay = 5;
    28         spin_lock_irqsave(&emu->reg_lock, flags);
    2923        snd_emu10k1_intr_enable(emu, INTE_INTERVALTIMERENB);
    3024        outw(delay & TIMER_RATE_MASK, emu->port + TIMER);
    31         spin_unlock_irqrestore(&emu->reg_lock, flags);
    3225        return 0;
    3326}
     
    3629{
    3730        struct snd_emu10k1 *emu;
    38         unsigned long flags;
    3931
    4032        emu = snd_timer_chip(timer);
    41         spin_lock_irqsave(&emu->reg_lock, flags);
    4233        snd_emu10k1_intr_disable(emu, INTE_INTERVALTIMERENB);
    43         spin_unlock_irqrestore(&emu->reg_lock, flags);
    4434        return 0;
     35}
     36
     37static 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
    4546}
    4647
     
    4849                                               unsigned long *num, unsigned long *den)
    4950{
     51        struct snd_emu10k1 *emu = snd_timer_chip(timer);
     52
    5053        *num = 1;
    51         *den = 48000;
     54        if (emu->card_capabilities->emu_model)
     55                *den = emu->emu1010.word_clock;
     56        else
     57                *den = 48000;
    5258        return 0;
    5359}
     
    5561static const struct snd_timer_hardware snd_emu10k1_timer_hw = {
    5662        .flags = SNDRV_TIMER_HW_AUTO,
    57         .resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */
    5863        .ticks = 1024,
    5964        .start = snd_emu10k1_timer_start,
    6065        .stop = snd_emu10k1_timer_stop,
     66        .c_resolution = snd_emu10k1_timer_c_resolution,
    6167        .precise_resolution = snd_emu10k1_timer_precise_resolution,
    6268};
Note: See TracChangeset for help on using the changeset viewer.