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:
2 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;
Note: See TracChangeset for help on using the changeset viewer.