]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ASoC: SOF: Intel: hda-stream: store stream capabilities
authorKeyon Jie <yang.jie@linux.intel.com>
Tue, 30 Apr 2019 23:09:29 +0000 (18:09 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 3 May 2019 06:00:59 +0000 (15:00 +0900)
Add stream_max into struct sof_intel_hda_dev to store the total hda
stream number that the platform can support, and initialize it at
stream_init.

This can be used later e.g. for stream bitmask.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-stream.c
sound/soc/sof/intel/hda.h

index 47eff161c60e3d8f8e11bd7adb6f1d01e077b8f0..39f4212bde4babf2008f1220c6ed2b8b34d295d2 100644 (file)
@@ -500,6 +500,7 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)
        struct hdac_ext_stream *stream;
        struct hdac_stream *hstream;
        struct pci_dev *pci = to_pci_dev(sdev->dev);
+       struct sof_intel_hda_dev *sof_hda = bus_to_sof_hda(bus);
        int sd_offset;
        int i, num_playback, num_capture, num_total, ret;
        u32 gcap;
@@ -657,6 +658,9 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)
                list_add_tail(&hstream->list, &bus->stream_list);
        }
 
+       /* store total stream count (playback + capture) from GCAP */
+       sof_hda->stream_max = num_total;
+
        return 0;
 }
 
index 3799a351810613c6ab7d7908f685a4fd0e28460c..7cb2fb92c4eba25584344dd2c7ad3e1532796037 100644 (file)
@@ -383,6 +383,9 @@ struct sof_intel_hda_dev {
        /* if position update IPC needed */
        u32 no_ipc_position;
 
+       /* the maximum number of streams (playback + capture) supported */
+       u32 stream_max;
+
        int irq;
 
        /* DMIC device */