lkml.org 
[lkml]   [2021]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 10/12] ASoC: amd: add vangogh pci driver pm ops
From
Date

> +static int snd_acp5x_suspend(struct device *dev)
> +{
> + int ret;
> + struct acp5x_dev_data *adata;
> +
> + adata = dev_get_drvdata(dev);
> + ret = acp5x_deinit(adata->acp5x_base);
> + if (ret)
> + dev_err(dev, "ACP de-init failed\n");
> + else
> + dev_dbg(dev, "ACP de-initialized\n");
> +
> + return ret;
> +}
> +
> +static int snd_acp5x_resume(struct device *dev)
> +{
> + int ret;
> + struct acp5x_dev_data *adata;
> +
> + adata = dev_get_drvdata(dev);
> + ret = acp5x_init(adata->acp5x_base);
> + if (ret) {
> + dev_err(dev, "ACP init failed\n");
> + return ret;
> + }
> + return 0;
> +}
> +
> +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?

also not clear why you don't have a .suspend here?

And to avoid warnings use __maybe_unused for those callbacks when PM is disabled?


\
 
 \ /
  Last update: 2021-07-07 18:36    [W:0.090 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site