Commit 730cb320 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

ASoC: Intel: avs: Count low power streams

Streaming in S0iX differs from SX scenarios. Store the number of
so-called low-power streams to be able to differentiate between the two.
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-7-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent eb0699c4
...@@ -127,6 +127,7 @@ struct avs_dev { ...@@ -127,6 +127,7 @@ struct avs_dev {
struct list_head fw_list; struct list_head fw_list;
int *core_refs; /* reference count per core */ int *core_refs; /* reference count per core */
char **lib_names; char **lib_names;
int num_lp_paths;
struct completion fw_ready; struct completion fw_ready;
struct work_struct probe_work; struct work_struct probe_work;
......
...@@ -60,6 +60,8 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) ...@@ -60,6 +60,8 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction)
static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe, static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe,
const struct snd_soc_dai_ops *ops) const struct snd_soc_dai_ops *ops)
{ {
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
struct avs_dev *adev = to_avs_dev(dai->dev);
struct avs_tplg_path_template *template; struct avs_tplg_path_template *template;
struct avs_dma_data *data; struct avs_dma_data *data;
...@@ -78,6 +80,9 @@ static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_d ...@@ -78,6 +80,9 @@ static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_d
data->template = template; data->template = template;
snd_soc_dai_set_dma_data(dai, substream, data); snd_soc_dai_set_dma_data(dai, substream, data);
if (rtd->dai_link->ignore_suspend)
adev->num_lp_paths++;
return 0; return 0;
} }
...@@ -164,8 +169,13 @@ static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct ...@@ -164,8 +169,13 @@ static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct
static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
struct avs_dev *adev = to_avs_dev(dai->dev);
struct avs_dma_data *data; struct avs_dma_data *data;
if (rtd->dai_link->ignore_suspend)
adev->num_lp_paths--;
data = snd_soc_dai_get_dma_data(dai, substream); data = snd_soc_dai_get_dma_data(dai, substream);
snd_soc_dai_set_dma_data(dai, substream, NULL); snd_soc_dai_set_dma_data(dai, substream, NULL);
...@@ -479,8 +489,13 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so ...@@ -479,8 +489,13 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so
static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
struct avs_dev *adev = to_avs_dev(dai->dev);
struct avs_dma_data *data; struct avs_dma_data *data;
if (rtd->dai_link->ignore_suspend)
adev->num_lp_paths--;
data = snd_soc_dai_get_dma_data(dai, substream); data = snd_soc_dai_get_dma_data(dai, substream);
snd_soc_dai_set_dma_data(dai, substream, NULL); snd_soc_dai_set_dma_data(dai, substream, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment