From: Marek Vasut <marex@denx.de>
To: Kamal Dasu <kdasu.kdev@gmail.com>,
linux-spi@vger.kernel.org, cyrille.pitchen@atmel.com,
broonie@kernel.org
Cc: linux-mtd@lists.infradead.org, f.fainelli@gmail.com,
bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH v3 2/2] mtd: m25p80: Added pm ops support
Date: Sat, 11 Feb 2017 13:10:35 +0100 [thread overview]
Message-ID: <0e0edea3-7dfe-bc10-eaa3-18330ae06874@denx.de> (raw)
In-Reply-To: <1486763369-31969-3-git-send-email-kdasu.kdev@gmail.com>
On 02/10/2017 10:49 PM, Kamal Dasu wrote:
> Added power management ops for resume to be able to resan spi-nor
> device and set it to right transfer modes in its probed state after
> poweron. Some SoC implementations might power down the spi-nor flash
> and loose its initial settings on suspend. A resume should retore the
> part to its probed state.
>
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> ---
> drivers/mtd/devices/m25p80.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index c4df3b1..be94fba 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -324,10 +324,26 @@ static int m25p_remove(struct spi_device *spi)
> };
> MODULE_DEVICE_TABLE(of, m25p_of_table);
>
> +#ifdef CONFIG_PM_SLEEP
> +static int m25p_suspend(struct device *dev)
> +{
> + return 0;
Can't you omit this function ?
> +}
> +
> +static int m25p_resume(struct device *dev)
> +{
> + struct m25p *flash = dev_get_drvdata(dev);
> +
> + return spi_nor_init(&flash->spi_nor);
> +}
> +#endif
> +static SIMPLE_DEV_PM_OPS(m25p_pm_ops, m25p_suspend, m25p_resume);
> +
> static struct spi_driver m25p80_driver = {
> .driver = {
> .name = "m25p80",
> .of_match_table = m25p_of_table,
> + .pm = &m25p_pm_ops,
> },
> .id_table = m25p_ids,
> .probe = m25p_probe,
>
--
Best regards,
Marek Vasut
prev parent reply other threads:[~2017-02-11 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 21:49 [PATCH v3 0/2] Added support for spi-nor device pm in m25p80 Kamal Dasu
2017-02-10 21:49 ` [PATCH v3 1/2] mtd: spi-nor: Added spi-nor reset function Kamal Dasu
2017-02-11 12:10 ` Marek Vasut
2017-02-10 21:49 ` [PATCH v3 2/2] mtd: m25p80: Added pm ops support Kamal Dasu
2017-02-11 12:10 ` Marek Vasut [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0e0edea3-7dfe-bc10-eaa3-18330ae06874@denx.de \
--to=marex@denx.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=broonie@kernel.org \
--cc=cyrille.pitchen@atmel.com \
--cc=f.fainelli@gmail.com \
--cc=kdasu.kdev@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox