Ignore:
Timestamp:
Aug 7, 2022, 6:11:12 PM (3 years ago)
Author:
David Azarewicz
Message:

Merge changes from next branch.

Location:
GPL/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/hda/ext/hdac_ext_stream.c

    r695 r717  
    107107EXPORT_SYMBOL_GPL(snd_hdac_stream_free_all);
    108108
    109 /**
    110  * snd_hdac_ext_stream_decouple - decouple the hdac stream
    111  * @bus: HD-audio core bus
    112  * @stream: HD-audio ext core stream object to initialize
    113  * @decouple: flag to decouple
    114  */
    115 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
    116                                 struct hdac_ext_stream *stream, bool decouple)
     109void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus,
     110                                         struct hdac_ext_stream *stream,
     111                                         bool decouple)
    117112{
    118113        struct hdac_stream *hstream = &stream->hstream;
     
    120115        int mask = AZX_PPCTL_PROCEN(hstream->index);
    121116
    122         spin_lock_irq(&bus->reg_lock);
    123117        val = readw(bus->ppcap + AZX_REG_PP_PPCTL) & mask;
    124118
     
    129123
    130124        stream->decoupled = decouple;
     125}
     126EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_decouple_locked);
     127
     128/**
     129 * snd_hdac_ext_stream_decouple - decouple the hdac stream
     130 * @bus: HD-audio core bus
     131 * @stream: HD-audio ext core stream object to initialize
     132 * @decouple: flag to decouple
     133 */
     134void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
     135                                  struct hdac_ext_stream *stream, bool decouple)
     136{
     137        spin_lock_irq(&bus->reg_lock);
     138        snd_hdac_ext_stream_decouple_locked(bus, stream, decouple);
    131139        spin_unlock_irq(&bus->reg_lock);
    132140}
     
    253261        }
    254262
     263        spin_lock_irq(&bus->reg_lock);
    255264        list_for_each_entry(stream, &bus->stream_list, list) {
    256265                struct hdac_ext_stream *hstream = container_of(stream,
     
    267276
    268277                if (!hstream->link_locked) {
    269                         snd_hdac_ext_stream_decouple(bus, hstream, true);
     278                        snd_hdac_ext_stream_decouple_locked(bus, hstream, true);
    270279                        res = hstream;
    271280                        break;
     
    273282        }
    274283        if (res) {
    275                 spin_lock_irq(&bus->reg_lock);
    276284                res->link_locked = 1;
    277285                res->link_substream = substream;
    278                 spin_unlock_irq(&bus->reg_lock);
    279         }
     286        }
     287        spin_unlock_irq(&bus->reg_lock);
    280288        return res;
    281289}
     
    293301        }
    294302
     303        spin_lock_irq(&bus->reg_lock);
    295304        list_for_each_entry(stream, &bus->stream_list, list) {
    296305                struct hdac_ext_stream *hstream = container_of(stream,
     
    302311                if (!stream->opened) {
    303312                        if (!hstream->decoupled)
    304                                 snd_hdac_ext_stream_decouple(bus, hstream, true);
     313                                snd_hdac_ext_stream_decouple_locked(bus, hstream, true);
    305314                        res = hstream;
    306315                        break;
     
    308317        }
    309318        if (res) {
    310                 spin_lock_irq(&bus->reg_lock);
    311319                res->hstream.opened = 1;
    312320                res->hstream.running = 0;
    313321                res->hstream.substream = substream;
    314                 spin_unlock_irq(&bus->reg_lock);
    315         }
     322        }
     323        spin_unlock_irq(&bus->reg_lock);
    316324
    317325        return res;
     
    379387
    380388        case HDAC_EXT_STREAM_TYPE_HOST:
     389                spin_lock_irq(&bus->reg_lock);
    381390                if (stream->decoupled && !stream->link_locked)
    382                         snd_hdac_ext_stream_decouple(bus, stream, false);
     391                        snd_hdac_ext_stream_decouple_locked(bus, stream, false);
     392                spin_unlock_irq(&bus->reg_lock);
    383393                snd_hdac_stream_release(&stream->hstream);
    384394                break;
    385395
    386396        case HDAC_EXT_STREAM_TYPE_LINK:
     397                spin_lock_irq(&bus->reg_lock);
    387398                if (stream->decoupled && !stream->hstream.opened)
    388                         snd_hdac_ext_stream_decouple(bus, stream, false);
    389                 spin_lock_irq(&bus->reg_lock);
     399                        snd_hdac_ext_stream_decouple_locked(bus, stream, false);
    390400                stream->link_locked = 0;
    391401                stream->link_substream = NULL;
  • GPL/trunk/alsa-kernel/hda/hdac_controller.c

    r695 r717  
    428428                goto skip_reset;
    429429
    430         /* clear STATESTS */
    431         snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK);
     430        /* clear STATESTS if not in reset */
     431        if (snd_hdac_chip_readb(bus, GCTL) & AZX_GCTL_RESET)
     432                snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK);
    432433
    433434        /* reset controller */
  • GPL/trunk/alsa-kernel/hda/hdac_device.c

    r629 r717  
    675675        { 0x17e8, "Chrontel" },
    676676        { 0x1854, "LG" },
     677        { 0x19e5, "Huawei" },
    677678        { 0x1aec, "Wolfson Microelectronics" },
    678679        { 0x1af4, "QEMU" },
  • GPL/trunk/alsa-kernel/hda/hdac_stream.c

    r695 r717  
    302302                (substream->stream + 1);
    303303
     304        spin_lock_irq(&bus->reg_lock);
    304305        list_for_each_entry(azx_dev, &bus->stream_list, list, struct hdac_stream) {
    305306                if (azx_dev->direction != substream->stream)
     
    315316        }
    316317        if (res) {
    317                 spin_lock_irq(&bus->reg_lock);
    318318                res->opened = 1;
    319319                res->running = 0;
    320320                res->assigned_key = key;
    321321                res->substream = substream;
    322                 spin_unlock_irq(&bus->reg_lock);
    323         }
     322        }
     323        spin_unlock_irq(&bus->reg_lock);
    324324        return res;
    325325}
     
    539539        cc->mask = CLOCKSOURCE_MASK(32);
    540540
     541#ifndef TARGET_OS2
     542        /*
     543         * Calculate the optimal mult/shift values. The counter wraps
     544         * around after ~178.9 seconds.
     545         */
     546        clocks_calc_mult_shift(&cc->mult, &cc->shift, 24000000,
     547                               NSEC_PER_SEC, 178);
     548#else
    541549        /*
    542550         * Converting from 24 MHz to ns means applying a 125/3 factor.
     
    551559        cc->mult = 125; /* saturation after 195 years */
    552560        cc->shift = 0;
    553 
     561#endif
    554562        nsec = 0; /* audio time is elapsed time since trigger */
    555563        timecounter_init(tc, cc, nsec);
Note: See TracChangeset for help on using the changeset viewer.