[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vdh-ssrmGgTc=gE9dWLhWDAw7_QHJKFeWKHpO-JqBdsEA@mail.gmail.com>
Date: Fri, 24 Jul 2020 13:51:49 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Vaibhav Gupta <vaibhavgupta40@...il.com>
Cc: Bjorn Helgaas <helgaas@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Bjorn Helgaas <bjorn@...gaas.com>,
Vaibhav Gupta <vaibhav.varodek@...il.com>,
Mark Brown <broonie@...nel.org>,
linux-spi <linux-spi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-kernel-mentees@...ts.linuxfoundation.org,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v1] spi: spi-topcliff-pch: use generic power management
On Mon, Jul 20, 2020 at 7:31 PM Vaibhav Gupta <vaibhavgupta40@...il.com> wrote:
>
> Drivers using legacy PM have to manage PCI states and device's PM states
> themselves. They also need to take care of configuration registers.
>
> With improved and powerful support of generic PM, PCI Core takes care of
> above mentioned, device-independent, jobs.
>
> This driver makes use of PCI helper functions like
> pci_save/restore_state(), pci_enable/disable_device(), pci_enable_wake()
> and pci_set_power_state() to do required operations. In generic mode, they
> are no longer needed.
>
> Change function parameter in both .suspend() and .resume() to
> "struct device*" type. Use dev_get_drvdata() to get drv data.
> Compile-tested only.
Yeah...
...
> +static int __maybe_unused pch_spi_suspend(struct device *dev)
> {
> + struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);
>
> + dev_dbg(dev, "%s ENTRY\n", __func__);
>
> pd_dev_save->board_dat->suspend_sts = true;
>
> + return 0;
> }
>
> +static int __maybe_unused pch_spi_resume(struct device *dev)
> {
> + struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);
>
> + dev_dbg(dev, "%s ENTRY\n", __func__);
>
> + device_wakeup_disable(dev);
Here I left a result. Care to explain (and perhaps send a follow up
fix) where is the counterpart to this call?
> + /* set suspend status to false */
> + pd_dev_save->board_dat->suspend_sts = false;
> + return 0;
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists