mirror of https://gitee.com/openkylin/linux.git
ASoC: SOF: Filter out unneeded core power up/downs
Exclude cores that are already powered on/off correctly. This allows to simplify dsp_power_up/down() implementations and avoid unexpected error. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210128093850.1041387-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
42077f08b3
commit
30876e2a06
|
@ -78,7 +78,8 @@ static inline int snd_sof_dsp_core_power_up(struct snd_sof_dev *sdev,
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (sof_ops(sdev)->core_power_up) {
|
core_mask &= ~sdev->enabled_cores_mask;
|
||||||
|
if (sof_ops(sdev)->core_power_up && core_mask) {
|
||||||
ret = sof_ops(sdev)->core_power_up(sdev, core_mask);
|
ret = sof_ops(sdev)->core_power_up(sdev, core_mask);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
sdev->enabled_cores_mask |= core_mask;
|
sdev->enabled_cores_mask |= core_mask;
|
||||||
|
@ -92,7 +93,8 @@ static inline int snd_sof_dsp_core_power_down(struct snd_sof_dev *sdev,
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (sof_ops(sdev)->core_power_down) {
|
core_mask &= sdev->enabled_cores_mask;
|
||||||
|
if (sof_ops(sdev)->core_power_down && core_mask) {
|
||||||
ret = sof_ops(sdev)->core_power_down(sdev, core_mask);
|
ret = sof_ops(sdev)->core_power_down(sdev, core_mask);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
sdev->enabled_cores_mask &= ~core_mask;
|
sdev->enabled_cores_mask &= ~core_mask;
|
||||||
|
|
Loading…
Reference in New Issue