]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ALSA/ASoC: hda: move/rename snd_hdac_ext_stop_streams to hdac_stream.c
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 16 Dec 2021 23:11:27 +0000 (17:11 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:39 +0000 (11:41 +0100)
[ Upstream commit d90623c1b63b5abd18d19a04f44d84ace7f6e6ce ]

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>
Stable-dep-of: 82b338c10a55 ("ASoC: Intel: Skylake: Fix driver hang during shutdown")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/sound/hdaudio.h
include/sound/hdaudio_ext.h
sound/hda/ext/hdac_ext_stream.c
sound/hda/hdac_stream.c
sound/soc/intel/skylake/skl.c

index 44e57bcc4a57930812afab0d878b0b9faf06a10e..53e081bcd8ec9a4dfa0f270476d7cef75d6414bd 100644 (file)
@@ -555,6 +555,7 @@ int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start);
 void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
 void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
+void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus);
 void snd_hdac_stream_reset(struct hdac_stream *azx_dev);
 void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set,
                                  unsigned int streams, unsigned int reg);
index 23dc8deac344ddab2ba779396218d21f2cbaae9f..91440476319a71e072d3ff0df51a6167a9596460 100644 (file)
@@ -92,7 +92,6 @@ void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus,
                                  struct hdac_ext_stream *azx_dev, bool decouple);
 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
                                struct hdac_ext_stream *azx_dev, bool decouple);
-void snd_hdac_ext_stop_streams(struct hdac_bus *bus);
 
 int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus,
                                 struct hdac_ext_stream *stream, u32 value);
index 04f4070fbf366925f610ce3fa7b1d10463270288..17b34bb9fecdf9042e0698a11099bca02deb0f3b 100644 (file)
@@ -475,23 +475,6 @@ int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_bus *bus,
 }
 EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_get_spbmaxfifo);
 
-
-/**
- * snd_hdac_ext_stop_streams - stop all stream if running
- * @bus: HD-audio core bus
- */
-void snd_hdac_ext_stop_streams(struct hdac_bus *bus)
-{
-       struct hdac_stream *stream;
-
-       if (bus->chip_init) {
-               list_for_each_entry(stream, &bus->stream_list, list)
-                       snd_hdac_stream_stop(stream);
-               snd_hdac_bus_stop_chip(bus);
-       }
-}
-EXPORT_SYMBOL_GPL(snd_hdac_ext_stop_streams);
-
 /**
  * snd_hdac_ext_stream_drsm_enable - enable DMA resume for a stream
  * @bus: HD-audio core bus
index b299b8b7f871a3ba7eb00cb003a71f329871f1c8..78d2674c7285bf04e1e145087e006b5e4f488ed6 100644 (file)
@@ -142,6 +142,22 @@ void snd_hdac_stream_stop(struct hdac_stream *azx_dev)
 }
 EXPORT_SYMBOL_GPL(snd_hdac_stream_stop);
 
+/**
+ * snd_hdac_stop_streams_and_chip - stop all streams and chip if running
+ * @bus: HD-audio core bus
+ */
+void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus)
+{
+       struct hdac_stream *stream;
+
+       if (bus->chip_init) {
+               list_for_each_entry(stream, &bus->stream_list, list)
+                       snd_hdac_stream_stop(stream);
+               snd_hdac_bus_stop_chip(bus);
+       }
+}
+EXPORT_SYMBOL_GPL(snd_hdac_stop_streams_and_chip);
+
 /**
  * snd_hdac_stream_reset - reset a stream
  * @azx_dev: HD-audio core stream to reset
index 2e5fbd2209235d11e7232a1a27ff6de001692ccb..dc6937a59443fb63e92a82b418801ddcc99b2b7c 100644 (file)
@@ -438,7 +438,7 @@ static int skl_free(struct hdac_bus *bus)
 
        skl->init_done = 0; /* to be sure */
 
-       snd_hdac_ext_stop_streams(bus);
+       snd_hdac_stop_streams_and_chip(bus);
 
        if (bus->irq >= 0)
                free_irq(bus->irq, (void *)bus);
@@ -1116,7 +1116,7 @@ static void skl_shutdown(struct pci_dev *pci)
        if (!skl->init_done)
                return;
 
-       snd_hdac_ext_stop_streams(bus);
+       snd_hdac_stop_streams_and_chip(bus);
        list_for_each_entry(s, &bus->stream_list, list) {
                stream = stream_to_hdac_ext_stream(s);
                snd_hdac_ext_stream_decouple(bus, stream, false);