[alsa-devel] [PATCH 5/9] ASoC: SOF: Move DSP power state transitions to platform-specific ops

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Thu Jan 30 14:34:06 CET 2020


>> @@ -495,13 +645,27 @@ int hda_dsp_resume(struct snd_sof_dev *sdev)
>>       }
>>       /* init hda controller. DSP cores will be powered up during fw 
>> boot */
>> -    return hda_resume(sdev, false);
>> +    ret = hda_resume(sdev, false);
>> +    if (ret < 0)
>> +        return ret;
>> +
>> +    hda_dsp_set_power_state(sdev, &target_state);
> 
> Return value  of hda_dsp_set_power_state() seems to be checked or 
> directly returned in other functions, any reason to not do it here?

Good point Amadeusz, not sure why. And looking at the code, I am not 
sure either why we don't use the abstraction w/ .set_power_state() ?

intel/apl.c:    .set_power_state        = hda_dsp_set_power_state,
intel/cnl.c:    .set_power_state        = hda_dsp_set_power_state,


git grep snd_sof_dsp_set_power_state
sof/ipc.c:      ret = snd_sof_dsp_set_power_state(ipc->sdev, &target_state);
sof/ops.h:snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,

If the code can be platform-specific, we shouldn't make a direct call 
but go through the platform indirection. it's fine for now since the 
same routine is used in all cases but it's not scalable/future-proof.

Ranjani?



More information about the Alsa-devel mailing list