Re: [PATCH] mmc: core: move suspend/resume to dev_pm_ops and add hibernation support
From: Shubhrajyoti Datta <hidden>
Date: 2012-01-11 06:26:53
Also in:
linux-mmc
Hi Barry, On Wed, Jan 11, 2012 at 8:24 AM, Barry Song [off-list ref] wrote:
2012/1/9 Shubhrajyoti Datta [off-list ref]:quoted
Hi Bin, On Mon, Jan 9, 2012 at 11:52 AM, Barry Song [off-list ref] wrote:quoted
From: Bin Shi <redacted> This patch moves suspend/resume to dev_pm_ops and add hibernation support. It was tested on CSR SiRFprimaII cortex-a9 platform. A sd partition is used as swsusp partition. Signed-off-by: Bin Shi <redacted> Signed-off-by: Barry Song <redacted> --- drivers/mmc/core/bus.c | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-)diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 6be4924..bab50f7 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c@@ -122,14 +122,14 @@ static int mmc_bus_remove(struct device *dev)return 0; } -static int mmc_bus_suspend(struct device *dev, pm_message_t state) +static int mmc_bus_suspend(struct device *dev) { struct mmc_driver *drv = to_mmc_driver(dev->driver); struct mmc_card *card = mmc_dev_to_card(dev); int ret = 0; if (dev->driver && drv->suspend) - ret = drv->suspend(card, state); + ret = drv->suspend(card, PMSG_SUSPEND); return ret; }@@ -144,6 +144,17 @@ static int mmc_bus_resume(struct device *dev)return ret; } +static int mmc_bus_freeze(struct device *dev) +{ + struct mmc_driver *drv = to_mmc_driver(dev->driver); + struct mmc_card *card = mmc_dev_to_card(dev); + int ret = 0; + + if (dev->driver && drv->suspend) + ret = drv->suspend(card, PMSG_FREEZE);Not a comment , rather a doubt Any particular reason to differenciate freeze and suspend?Shubhrajyoti, there is no real difference for our system. this is just to keep back-compatible with old mmc_driver.suspend() since the function accepts a PMSG_xxx as param. i think all things go well if we add freeze/thaw/restore in Dmitry Shmidt's "[PATCH V4] mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is used"
Thanks for the explanation.
-barry