Re: [PATCH 10/12] ASoC: amd: add vangogh pci driver pm ops

From: Mukunda,Vijendar
Date: Thu Jul 15 2021 - 19:31:54 EST


On 7/14/21 9:53 PM, Mark Brown wrote:
> On Tue, Jul 13, 2021 at 12:06:38PM +0530, Mukunda,Vijendar wrote:
>> On 7/8/21 5:11 PM, Mukunda,Vijendar wrote:
>>> On 7/7/21 10:04 PM, Pierre-Louis Bossart wrote:
>
>>>>> +static const struct dev_pm_ops acp5x_pm = {
>>>>> + .runtime_suspend = snd_acp5x_suspend,
>>>>> + .runtime_resume = snd_acp5x_resume,
>>>>> + .resume = snd_acp5x_resume,
>
>>>> use SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS?
>
>> suspend and resume callbacks implementation is same for runtime pm ops
>> and system level pm ops in ACP PCI driver i.e in suspend callback acp
>> de-init sequence will be invoked and in resume callback acp init
>> sequence will be invoked.
>
>> As per our understanding if we safeguard code with CONFIG_PM_SLEEP
>> macro, then runtime pm ops won't work.
>
> That's not what Pierre is suggesting though?
>
>> Do we need to duplicate the same code as mentioned below?
>
>> static const struct dev_pm_ops acp5x_pm = {
>> SET_RUNTIME_PM_OPS(snd_acp5x_runtime_suspend,
>> snd_acp5x_runtime_resume, NULL)
>> SET_SYSTEM_SLEEP_PM_OPS(snd_acp5x_suspend, snd_acp5x_resume)
>> };
>
> Using the SET_ macros doesn't require that you duplicate the functions,
> it literally just means changing the way the ops are assigned.
>
Will make the changes and post the new version.