Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA/ASoC: hda: move/rename snd_hdac_ext_stop_streams to hdac_stream.c

snd_hdac_ext_stop_streams() has really nothing to do with the
extension, it just loops over the bus streams.

Move it to the hdac_stream layer and rename to remove the 'ext'
prefix and add the precision that the chip will also be stopped.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211216231128.344321-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Pierre-Louis Bossart and committed by
Takashi Iwai
12054f0c dec242b6

+19 -20
+1
include/sound/hdaudio.h
··· 558 558 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start); 559 559 void snd_hdac_stream_clear(struct hdac_stream *azx_dev); 560 560 void snd_hdac_stream_stop(struct hdac_stream *azx_dev); 561 + void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus); 561 562 void snd_hdac_stream_reset(struct hdac_stream *azx_dev); 562 563 void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set, 563 564 unsigned int streams, unsigned int reg);
-1
include/sound/hdaudio_ext.h
··· 92 92 struct hdac_ext_stream *azx_dev, bool decouple); 93 93 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus, 94 94 struct hdac_ext_stream *azx_dev, bool decouple); 95 - void snd_hdac_ext_stop_streams(struct hdac_bus *bus); 96 95 97 96 int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus, 98 97 struct hdac_ext_stream *stream, u32 value);
-17
sound/hda/ext/hdac_ext_stream.c
··· 475 475 } 476 476 EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_get_spbmaxfifo); 477 477 478 - 479 - /** 480 - * snd_hdac_ext_stop_streams - stop all stream if running 481 - * @bus: HD-audio core bus 482 - */ 483 - void snd_hdac_ext_stop_streams(struct hdac_bus *bus) 484 - { 485 - struct hdac_stream *stream; 486 - 487 - if (bus->chip_init) { 488 - list_for_each_entry(stream, &bus->stream_list, list) 489 - snd_hdac_stream_stop(stream); 490 - snd_hdac_bus_stop_chip(bus); 491 - } 492 - } 493 - EXPORT_SYMBOL_GPL(snd_hdac_ext_stop_streams); 494 - 495 478 /** 496 479 * snd_hdac_ext_stream_drsm_enable - enable DMA resume for a stream 497 480 * @bus: HD-audio core bus
+16
sound/hda/hdac_stream.c
··· 143 143 EXPORT_SYMBOL_GPL(snd_hdac_stream_stop); 144 144 145 145 /** 146 + * snd_hdac_stop_streams_and_chip - stop all streams and chip if running 147 + * @bus: HD-audio core bus 148 + */ 149 + void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus) 150 + { 151 + struct hdac_stream *stream; 152 + 153 + if (bus->chip_init) { 154 + list_for_each_entry(stream, &bus->stream_list, list) 155 + snd_hdac_stream_stop(stream); 156 + snd_hdac_bus_stop_chip(bus); 157 + } 158 + } 159 + EXPORT_SYMBOL_GPL(snd_hdac_stop_streams_and_chip); 160 + 161 + /** 146 162 * snd_hdac_stream_reset - reset a stream 147 163 * @azx_dev: HD-audio core stream to reset 148 164 */
+2 -2
sound/soc/intel/skylake/skl.c
··· 439 439 440 440 skl->init_done = 0; /* to be sure */ 441 441 442 - snd_hdac_ext_stop_streams(bus); 442 + snd_hdac_stop_streams_and_chip(bus); 443 443 444 444 if (bus->irq >= 0) 445 445 free_irq(bus->irq, (void *)bus); ··· 1096 1096 if (!skl->init_done) 1097 1097 return; 1098 1098 1099 - snd_hdac_ext_stop_streams(bus); 1099 + snd_hdac_stop_streams_and_chip(bus); 1100 1100 list_for_each_entry(s, &bus->stream_list, list) { 1101 1101 stream = stream_to_hdac_ext_stream(s); 1102 1102 snd_hdac_ext_stream_decouple(bus, stream, false);