linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] isa: Change driver to use dev_pm_ops infrastructure
@ 2013-08-10 15:20 Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:au1xmmc change " Shuah Khan
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: gregkh; +Cc: Shuah Khan, linux-kernel, shuahkhan

Change isa bus to register dev_pm_ops via bus_type.pm. Add freeze ops for
PM_EVENT_FREEZE handling.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/base/isa.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/base/isa.c b/drivers/base/isa.c
index 91dba65..0f5943f 100644
--- a/drivers/base/isa.c
+++ b/drivers/base/isa.c
@@ -63,7 +63,7 @@ static void isa_bus_shutdown(struct device *dev)
 		isa_driver->shutdown(dev, to_isa_dev(dev)->id);
 }
 
-static int isa_bus_suspend(struct device *dev, pm_message_t state)
+static int __isa_bus_suspend(struct device *dev, pm_message_t state)
 {
 	struct isa_driver *isa_driver = dev->platform_data;
 
@@ -73,6 +73,16 @@ static int isa_bus_suspend(struct device *dev, pm_message_t state)
 	return 0;
 }
 
+static int isa_bus_suspend(struct device *dev)
+{
+	return __isa_bus_suspend(dev, PMSG_SUSPEND);
+}
+
+static int isa_bus_freeze(struct device *dev)
+{
+	return __isa_bus_suspend(dev, PMSG_FREEZE);
+}
+
 static int isa_bus_resume(struct device *dev)
 {
 	struct isa_driver *isa_driver = dev->platform_data;
@@ -83,14 +93,19 @@ static int isa_bus_resume(struct device *dev)
 	return 0;
 }
 
+static const struct dev_pm_ops isa_bus_dev_pm_ops = {
+	.suspend = isa_bus_suspend,
+	.freeze = isa_bus_freeze,
+	.resume = isa_bus_resume,
+};
+
 static struct bus_type isa_bus_type = {
 	.name		= "isa",
 	.match		= isa_bus_match,
 	.probe		= isa_bus_probe,
 	.remove		= isa_bus_remove,
 	.shutdown	= isa_bus_shutdown,
-	.suspend	= isa_bus_suspend,
-	.resume		= isa_bus_resume
+	.pm		= &isa_bus_dev_pm_ops,
 };
 
 static void isa_dev_release(struct device *dev)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:au1xmmc change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh " Shuah Khan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: manuel.lauss, cjb; +Cc: Shuah Khan, linux-mmc, linux-kernel, shuahkhan

Change au1xmmc platform driver to register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/au1xmmc.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index df9becd..0bafd7f 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -1154,11 +1154,12 @@ static int au1xmmc_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
+static int au1xmmc_suspend(struct device *dev)
 {
-	struct au1xmmc_host *host = platform_get_drvdata(pdev);
+	struct au1xmmc_host *host;
 	int ret;
 
+	host = platform_get_drvdata(to_platform_device(dev));
 	ret = mmc_suspend_host(host->mmc);
 	if (ret)
 		return ret;
@@ -1172,10 +1173,11 @@ static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t state)
 	return 0;
 }
 
-static int au1xmmc_resume(struct platform_device *pdev)
+static int au1xmmc_resume(struct device *dev)
 {
-	struct au1xmmc_host *host = platform_get_drvdata(pdev);
+	struct au1xmmc_host *host;
 
+	host = platform_get_drvdata(to_platform_device(dev));
 	au1xmmc_reset_controller(host);
 
 	return mmc_resume_host(host->mmc);
@@ -1185,14 +1187,15 @@ static int au1xmmc_resume(struct platform_device *pdev)
 #define au1xmmc_resume NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(au1xmmc_dev_pm_ops, au1xmmc_suspend, au1xmmc_resume);
+
 static struct platform_driver au1xmmc_driver = {
 	.probe         = au1xmmc_probe,
 	.remove        = au1xmmc_remove,
-	.suspend       = au1xmmc_suspend,
-	.resume        = au1xmmc_resume,
 	.driver        = {
 		.name  = DRIVER_NAME,
 		.owner = THIS_MODULE,
+		.pm    = &au1xmmc_dev_pm_ops,
 	},
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:bfin_sdh change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:au1xmmc change " Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-12  2:33   ` Zhang, Sonic
  2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq() Shuah Khan
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: sonic.zhang, cjb
  Cc: Shuah Khan, uclinux-dist-devel, linux-mmc, linux-kernel, shuahkhan

Change bfin sdh platform driver to register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/bfin_sdh.c |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c
index 94fae2f..7b3e12f 100644
--- a/drivers/mmc/host/bfin_sdh.c
+++ b/drivers/mmc/host/bfin_sdh.c
@@ -638,10 +638,11 @@ static int sdh_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int sdh_suspend(struct platform_device *dev, pm_message_t state)
+static int sdh_suspend(struct device *dev)
 {
-	struct mmc_host *mmc = platform_get_drvdata(dev);
-	struct bfin_sd_host *drv_data = get_sdh_data(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct mmc_host *mmc = platform_get_drvdata(pdev);
+	struct bfin_sd_host *drv_data = get_sdh_data(pdev);
 	int ret = 0;
 
 	if (mmc)
@@ -652,15 +653,16 @@ static int sdh_suspend(struct platform_device *dev, pm_message_t state)
 	return ret;
 }
 
-static int sdh_resume(struct platform_device *dev)
+static int sdh_resume(struct device *dev)
 {
-	struct mmc_host *mmc = platform_get_drvdata(dev);
-	struct bfin_sd_host *drv_data = get_sdh_data(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct mmc_host *mmc = platform_get_drvdata(pdev);
+	struct bfin_sd_host *drv_data = get_sdh_data(pdev);
 	int ret = 0;
 
 	ret = peripheral_request_list(drv_data->pin_req, DRIVER_NAME);
 	if (ret) {
-		dev_err(&dev->dev, "unable to request peripheral pins\n");
+		dev_err(dev, "unable to request peripheral pins\n");
 		return ret;
 	}
 
@@ -676,13 +678,14 @@ static int sdh_resume(struct platform_device *dev)
 # define sdh_resume  NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(sdh_dev_pm_ops, sdh_suspend, sdh_resume);
+
 static struct platform_driver sdh_driver = {
 	.probe   = sdh_probe,
 	.remove  = sdh_remove,
-	.suspend = sdh_suspend,
-	.resume  = sdh_resume,
 	.driver  = {
 		.name = DRIVER_NAME,
+		.pm = &sdh_dev_pm_ops,
 	},
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq()
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:au1xmmc change " Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh " Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-12  2:32   ` Zhang, Sonic
  2013-08-10 15:20 ` [PATCH] mmc:cb710_mmc change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: sonic.zhang, cjb
  Cc: Shuah Khan, uclinux-dist-devel, linux-mmc, linux-kernel, shuahkhan

Fix the following build warning in sdh_dma_irq()
drivers/mmc/host/bfin_sdh.c:466:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘int’ [-Wformat]
       dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04x\n", __func__,
                get_dma_curr_irqstat(host->dma_ch));

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/bfin_sdh.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c
index 7b3e12f..61157c4 100644
--- a/drivers/mmc/host/bfin_sdh.c
+++ b/drivers/mmc/host/bfin_sdh.c
@@ -463,7 +463,7 @@ static irqreturn_t sdh_dma_irq(int irq, void *devid)
 {
 	struct sdh_host *host = devid;
 
-	dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04lx\n", __func__,
+	dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04x\n", __func__,
 		get_dma_curr_irqstat(host->dma_ch));
 	clear_dma_irqstat(host->dma_ch);
 	SSYNC();
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:cb710_mmc change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (2 preceding siblings ...)
  2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq() Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:msmsdcc " Shuah Khan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: mirq-linux, cjb; +Cc: Shuah Khan, linux-mmc, linux-kernel, shuahkhan

Change cb710_mmc platform driver register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/cb710-mmc.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 9d6e2b8..e79ac0d 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -664,8 +664,9 @@ static const struct mmc_host_ops cb710_mmc_host = {
 
 #ifdef CONFIG_PM
 
-static int cb710_mmc_suspend(struct platform_device *pdev, pm_message_t state)
+static int cb710_mmc_suspend(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
 	struct mmc_host *mmc = cb710_slot_to_mmc(slot);
 	int err;
@@ -678,8 +679,9 @@ static int cb710_mmc_suspend(struct platform_device *pdev, pm_message_t state)
 	return 0;
 }
 
-static int cb710_mmc_resume(struct platform_device *pdev)
+static int cb710_mmc_resume(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct cb710_slot *slot = cb710_pdev_to_slot(pdev);
 	struct mmc_host *mmc = cb710_slot_to_mmc(slot);
 
@@ -688,6 +690,8 @@ static int cb710_mmc_resume(struct platform_device *pdev)
 	return mmc_resume_host(mmc);
 }
 
+static SIMPLE_DEV_PM_OPS(cb710_mmc_dev_pm_ops, cb710_mmc_suspend,
+			 cb710_mmc_resume);
 #endif /* CONFIG_PM */
 
 static int cb710_mmc_init(struct platform_device *pdev)
@@ -775,8 +779,7 @@ static struct platform_driver cb710_mmc_driver = {
 	.probe = cb710_mmc_init,
 	.remove = cb710_mmc_exit,
 #ifdef CONFIG_PM
-	.suspend = cb710_mmc_suspend,
-	.resume = cb710_mmc_resume,
+	.driver.pm = &cb710_mmc_dev_pm_ops,
 #endif
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:msmsdcc change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (3 preceding siblings ...)
  2013-08-10 15:20 ` [PATCH] mmc:cb710_mmc change driver to use dev_pm_ops infrastructure Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:mvsdio " Shuah Khan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: davidb, dwalker, bryanh, cjb
  Cc: Shuah Khan, linux-arm-msm, linux-mmc, linux-kernel, shuahkhan

Change msmsdcc platform driver to register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/msm_sdcc.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index b900de4..017c9d7 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1434,9 +1434,9 @@ do_resume_work(struct work_struct *work)
 
 
 static int
-msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
+msmsdcc_suspend(struct device *dev)
 {
-	struct mmc_host *mmc = mmc_get_drvdata(dev);
+	struct mmc_host *mmc = mmc_get_drvdata(to_platform_device(dev));
 	int rc = 0;
 
 	if (mmc) {
@@ -1456,9 +1456,9 @@ msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
 }
 
 static int
-msmsdcc_resume(struct platform_device *dev)
+msmsdcc_resume(struct device *dev)
 {
-	struct mmc_host *mmc = mmc_get_drvdata(dev);
+	struct mmc_host *mmc = mmc_get_drvdata(to_platform_device(dev));
 
 	if (mmc) {
 		struct msmsdcc_host *host = mmc_priv(mmc);
@@ -1482,12 +1482,13 @@ msmsdcc_resume(struct platform_device *dev)
 #define msmsdcc_resume 0
 #endif
 
+static SIMPLE_DEV_PM_OPS(msmdcc_dev_pm_ops, msmsdcc_suspend, msmsdcc_resume);
+
 static struct platform_driver msmsdcc_driver = {
 	.probe		= msmsdcc_probe,
-	.suspend	= msmsdcc_suspend,
-	.resume		= msmsdcc_resume,
 	.driver		= {
 		.name	= "msm_sdcc",
+		.pm	= &msmdcc_dev_pm_ops,
 	},
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:mvsdio change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (4 preceding siblings ...)
  2013-08-10 15:20 ` [PATCH] mmc:msmsdcc " Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:rtsx_pci_sdmmc " Shuah Khan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: nico, cjb, thomas.petazzoni, jason, andrew, jg1.han, linux-mmc,
	linux-kernel
  Cc: Shuah Khan, shuahkhan

Change mvsd platform driver to register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/mvsdio.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 4ddd83f..800a7fd 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -838,9 +838,9 @@ static int __exit mvsd_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int mvsd_suspend(struct platform_device *dev, pm_message_t state)
+static int mvsd_suspend(struct device *dev)
 {
-	struct mmc_host *mmc = platform_get_drvdata(dev);
+	struct mmc_host *mmc = platform_get_drvdata(to_platform_device(dev));
 	int ret = 0;
 
 	if (mmc)
@@ -849,9 +849,9 @@ static int mvsd_suspend(struct platform_device *dev, pm_message_t state)
 	return ret;
 }
 
-static int mvsd_resume(struct platform_device *dev)
+static int mvsd_resume(struct device *dev)
 {
-	struct mmc_host *mmc = platform_get_drvdata(dev);
+	struct mmc_host *mmc = platform_get_drvdata(to_platform_device(dev));
 	int ret = 0;
 
 	if (mmc)
@@ -870,13 +870,14 @@ static const struct of_device_id mvsdio_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, mvsdio_dt_ids);
 
+static SIMPLE_DEV_PM_OPS(mvsd_dev_pm_ops, mvsd_suspend, mvsd_resume);
+
 static struct platform_driver mvsd_driver = {
 	.remove		= __exit_p(mvsd_remove),
-	.suspend	= mvsd_suspend,
-	.resume		= mvsd_resume,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = mvsdio_dt_ids,
+		.pm = &mvsd_dev_pm_ops,
 	},
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:rtsx_pci_sdmmc change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (5 preceding siblings ...)
  2013-08-10 15:20 ` [PATCH] mmc:mvsdio " Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-10 15:20 ` [PATCH] mmc:tmio_mmc " Shuah Khan
  2013-08-10 18:52 ` [PATCH] isa: Change " Greg KH
  8 siblings, 0 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: cjb, wei_wang, sameo, arnd, jg1.han
  Cc: Shuah Khan, linux-mmc, linux-kernel, shuahkhan

Change rtsx_pci_sdmmc platform driver to register pm ops using dev_pm_ops
instead of legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 82a35b9..fc52f28 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1166,9 +1166,9 @@ static const struct mmc_host_ops realtek_pci_sdmmc_ops = {
 };
 
 #ifdef CONFIG_PM
-static int rtsx_pci_sdmmc_suspend(struct platform_device *pdev,
-		pm_message_t state)
+static int rtsx_pci_sdmmc_suspend(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct realtek_pci_sdmmc *host = platform_get_drvdata(pdev);
 	struct mmc_host *mmc = host->mmc;
 	int err;
@@ -1182,8 +1182,9 @@ static int rtsx_pci_sdmmc_suspend(struct platform_device *pdev,
 	return 0;
 }
 
-static int rtsx_pci_sdmmc_resume(struct platform_device *pdev)
+static int rtsx_pci_sdmmc_resume(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct realtek_pci_sdmmc *host = platform_get_drvdata(pdev);
 	struct mmc_host *mmc = host->mmc;
 
@@ -1331,15 +1332,17 @@ static struct platform_device_id rtsx_pci_sdmmc_ids[] = {
 };
 MODULE_DEVICE_TABLE(platform, rtsx_pci_sdmmc_ids);
 
+static SIMPLE_DEV_PM_OPS(rtsx_pci_sdmmc_dev_pm_ops, rtsx_pci_sdmmc_suspend,
+			 rtsx_pci_sdmmc_resume);
+
 static struct platform_driver rtsx_pci_sdmmc_driver = {
 	.probe		= rtsx_pci_sdmmc_drv_probe,
 	.remove		= rtsx_pci_sdmmc_drv_remove,
 	.id_table       = rtsx_pci_sdmmc_ids,
-	.suspend	= rtsx_pci_sdmmc_suspend,
-	.resume		= rtsx_pci_sdmmc_resume,
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= DRV_NAME_RTSX_PCI_SDMMC,
+		.pm	= &rtsx_pci_sdmmc_dev_pm_ops,
 	},
 };
 module_platform_driver(rtsx_pci_sdmmc_driver);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mmc:tmio_mmc change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (6 preceding siblings ...)
  2013-08-10 15:20 ` [PATCH] mmc:rtsx_pci_sdmmc " Shuah Khan
@ 2013-08-10 15:20 ` Shuah Khan
  2013-08-26  8:48   ` Guennadi Liakhovetski
  2013-08-10 18:52 ` [PATCH] isa: Change " Greg KH
  8 siblings, 1 reply; 14+ messages in thread
From: Shuah Khan @ 2013-08-10 15:20 UTC (permalink / raw)
  To: g.liakhovetski, ian, cjb; +Cc: Shuah Khan, linux-mmc, linux-kernel, shuahkhan

Change tmio_mmc platform driver to register pm ops using dev_pm_ops instead of
legacy pm_ops infrastructure.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/mmc/host/tmio_mmc.c |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8860d4d..3e3c730 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -24,31 +24,33 @@
 #include "tmio_mmc.h"
 
 #ifdef CONFIG_PM
-static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
+static int tmio_mmc_suspend(struct device *dev)
 {
-	const struct mfd_cell *cell = mfd_get_cell(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	const struct mfd_cell *cell = mfd_get_cell(pdev);
 	int ret;
 
-	ret = tmio_mmc_host_suspend(&dev->dev);
+	ret = tmio_mmc_host_suspend(dev);
 
 	/* Tell MFD core it can disable us now.*/
 	if (!ret && cell->disable)
-		cell->disable(dev);
+		cell->disable(pdev);
 
 	return ret;
 }
 
-static int tmio_mmc_resume(struct platform_device *dev)
+static int tmio_mmc_resume(struct device *dev)
 {
-	const struct mfd_cell *cell = mfd_get_cell(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	const struct mfd_cell *cell = mfd_get_cell(pdev);
 	int ret = 0;
 
 	/* Tell the MFD core we are ready to be enabled */
 	if (cell->resume)
-		ret = cell->resume(dev);
+		ret = cell->resume(pdev);
 
 	if (!ret)
-		ret = tmio_mmc_host_resume(&dev->dev);
+		ret = tmio_mmc_host_resume(dev);
 
 	return ret;
 }
@@ -123,17 +125,19 @@ static int tmio_mmc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static SIMPLE_DEV_PM_OPS(tmio_mmc_dev_pm_ops, tmio_mmc_suspend,
+			  tmio_mmc_resume);
+
 /* ------------------- device registration ----------------------- */
 
 static struct platform_driver tmio_mmc_driver = {
 	.driver = {
 		.name = "tmio-mmc",
 		.owner = THIS_MODULE,
+		.pm = &tmio_mmc_dev_pm_ops,
 	},
 	.probe = tmio_mmc_probe,
 	.remove = tmio_mmc_remove,
-	.suspend = tmio_mmc_suspend,
-	.resume = tmio_mmc_resume,
 };
 
 module_platform_driver(tmio_mmc_driver);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] isa: Change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
                   ` (7 preceding siblings ...)
  2013-08-10 15:20 ` [PATCH] mmc:tmio_mmc " Shuah Khan
@ 2013-08-10 18:52 ` Greg KH
  2013-08-12 17:02   ` Shuah Khan
  8 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2013-08-10 18:52 UTC (permalink / raw)
  To: Shuah Khan; +Cc: linux-kernel, shuahkhan

On Sat, Aug 10, 2013 at 09:20:46AM -0600, Shuah Khan wrote:
> Change isa bus to register dev_pm_ops via bus_type.pm. Add freeze ops for
> PM_EVENT_FREEZE handling.

why?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq()
  2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq() Shuah Khan
@ 2013-08-12  2:32   ` Zhang, Sonic
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang, Sonic @ 2013-08-12  2:32 UTC (permalink / raw)
  To: Shuah Khan, cjb; +Cc: uclinux-dist-devel, linux-mmc, linux-kernel, shuahkhan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1618 bytes --]

Acked-by: Sonic Zhang<sonic.zhang@analog.com>

>-----Original Message-----
>From: Shuah Khan [mailto:shuah.kh@samsung.com]
>Sent: Saturday, August 10, 2013 11:21 PM
>To: Zhang, Sonic; cjb@laptop.org
>Cc: Shuah Khan; uclinux-dist-devel@blackfin.uclinux.org; linux-mmc@vger.kernel.org;
>linux-kernel@vger.kernel.org; shuahkhan@gmail.com
>Subject: [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq()
>
>Fix the following build warning in sdh_dma_irq()
>drivers/mmc/host/bfin_sdh.c:466:2: warning: format   %lx   expects argument of type
>long unsigned int  , but argument 5 has type   int   [-Wformat]
>       dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04x\n", __func__,
>                get_dma_curr_irqstat(host->dma_ch));
>
>Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
>---
> drivers/mmc/host/bfin_sdh.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c index
>7b3e12f..61157c4 100644
>--- a/drivers/mmc/host/bfin_sdh.c
>+++ b/drivers/mmc/host/bfin_sdh.c
>@@ -463,7 +463,7 @@ static irqreturn_t sdh_dma_irq(int irq, void *devid)  {
>       struct sdh_host *host = devid;
>
>-      dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04lx\n", __func__,
>+      dev_dbg(mmc_dev(host->mmc), "%s enter, irq_stat: 0x%04x\n", __func__,
>               get_dma_curr_irqstat(host->dma_ch));
>       clear_dma_irqstat(host->dma_ch);
>       SSYNC();
>--
>1.7.10.4
>

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH] mmc:bfin_sdh change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh " Shuah Khan
@ 2013-08-12  2:33   ` Zhang, Sonic
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang, Sonic @ 2013-08-12  2:33 UTC (permalink / raw)
  To: Shuah Khan, cjb; +Cc: uclinux-dist-devel, linux-mmc, linux-kernel, shuahkhan

Acked-by: Sonic Zhang<sonic.zhang@analog.com>

>-----Original Message-----
>From: Shuah Khan [mailto:shuah.kh@samsung.com]
>Sent: Saturday, August 10, 2013 11:21 PM
>To: Zhang, Sonic; cjb@laptop.org
>Cc: Shuah Khan; uclinux-dist-devel@blackfin.uclinux.org; linux-mmc@vger.kernel.org;
>linux-kernel@vger.kernel.org; shuahkhan@gmail.com
>Subject: [PATCH] mmc:bfin_sdh change driver to use dev_pm_ops infrastructure
>
>Change bfin sdh platform driver to register pm ops using dev_pm_ops instead of
>legacy pm_ops infrastructure.
>
>Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
>---
> drivers/mmc/host/bfin_sdh.c |   21 ++++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)
>
>diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c index
>94fae2f..7b3e12f 100644
>--- a/drivers/mmc/host/bfin_sdh.c
>+++ b/drivers/mmc/host/bfin_sdh.c
>@@ -638,10 +638,11 @@ static int sdh_remove(struct platform_device *pdev)  }
>
> #ifdef CONFIG_PM
>-static int sdh_suspend(struct platform_device *dev, pm_message_t state)
>+static int sdh_suspend(struct device *dev)
> {
>-      struct mmc_host *mmc = platform_get_drvdata(dev);
>-      struct bfin_sd_host *drv_data = get_sdh_data(dev);
>+      struct platform_device *pdev = to_platform_device(dev);
>+      struct mmc_host *mmc = platform_get_drvdata(pdev);
>+      struct bfin_sd_host *drv_data = get_sdh_data(pdev);
>       int ret = 0;
>
>       if (mmc)
>@@ -652,15 +653,16 @@ static int sdh_suspend(struct platform_device *dev,
>pm_message_t state)
>       return ret;
> }
>
>-static int sdh_resume(struct platform_device *dev)
>+static int sdh_resume(struct device *dev)
> {
>-      struct mmc_host *mmc = platform_get_drvdata(dev);
>-      struct bfin_sd_host *drv_data = get_sdh_data(dev);
>+      struct platform_device *pdev = to_platform_device(dev);
>+      struct mmc_host *mmc = platform_get_drvdata(pdev);
>+      struct bfin_sd_host *drv_data = get_sdh_data(pdev);
>       int ret = 0;
>
>       ret = peripheral_request_list(drv_data->pin_req, DRIVER_NAME);
>       if (ret) {
>-              dev_err(&dev->dev, "unable to request peripheral pins\n");
>+              dev_err(dev, "unable to request peripheral pins\n");
>               return ret;
>       }
>
>@@ -676,13 +678,14 @@ static int sdh_resume(struct platform_device *dev)  #
>define sdh_resume  NULL  #endif
>
>+static SIMPLE_DEV_PM_OPS(sdh_dev_pm_ops, sdh_suspend, sdh_resume);
>+
> static struct platform_driver sdh_driver = {
>       .probe   = sdh_probe,
>       .remove  = sdh_remove,
>-      .suspend = sdh_suspend,
>-      .resume  = sdh_resume,
>       .driver  = {
>               .name = DRIVER_NAME,
>+              .pm = &sdh_dev_pm_ops,
>       },
> };
>
>--
>1.7.10.4
>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] isa: Change driver to use dev_pm_ops infrastructure
  2013-08-10 18:52 ` [PATCH] isa: Change " Greg KH
@ 2013-08-12 17:02   ` Shuah Khan
  0 siblings, 0 replies; 14+ messages in thread
From: Shuah Khan @ 2013-08-12 17:02 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, shuahkhan, Shuah Khan

On 08/10/2013 12:51 PM, Greg KH wrote:
> On Sat, Aug 10, 2013 at 09:20:46AM -0600, Shuah Khan wrote:
>> Change isa bus to register dev_pm_ops via bus_type.pm. Add freeze ops for
>> PM_EVENT_FREEZE handling.
>
> why?
>

I see that my changelog is very cryptic. Sorry about that.

I have been converting drivers from using legacy pm_ops to dev_pm_ops 
which will allow all drivers to use the same infrastructure and overtime 
obsolete the legacy usage. With this change I made, __device_suspend() 
will find  dev->bus->pm->suspend instead of dev->bus->suspend.

isa bus and isa drivers probably will never take advantage of the pm 
capabilities dev_pm_ops allow for, the reason to update the isa bus to 
use dev_pm_ops is to allow for obsoleting legacy pm_ops handling in pm.

-- Shuah

Shuah Khan, Linux Kernel Developer - Open Source Group Samsung Research 
America (Silicon Valley) shuah.kh@samsung.com | (970) 672-0658

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mmc:tmio_mmc change driver to use dev_pm_ops infrastructure
  2013-08-10 15:20 ` [PATCH] mmc:tmio_mmc " Shuah Khan
@ 2013-08-26  8:48   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 14+ messages in thread
From: Guennadi Liakhovetski @ 2013-08-26  8:48 UTC (permalink / raw)
  To: Shuah Khan; +Cc: ian, cjb, linux-mmc, linux-kernel, shuahkhan

Hi Shuah Khan,

On Sat, 10 Aug 2013, Shuah Khan wrote:

> Change tmio_mmc platform driver to register pm ops using dev_pm_ops instead of
> legacy pm_ops infrastructure.
> 
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>

This looks good to me, although I don't have access to any MFD-based TMIO 
MMC systems, so, cannot test. In fact that code hasn't been touched for a 
while now, so, I don't even know if anyone is still using it. With that in 
mind

Acked-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>

Thanks
Guennadi

> ---
>  drivers/mmc/host/tmio_mmc.c |   24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> index 8860d4d..3e3c730 100644
> --- a/drivers/mmc/host/tmio_mmc.c
> +++ b/drivers/mmc/host/tmio_mmc.c
> @@ -24,31 +24,33 @@
>  #include "tmio_mmc.h"
>  
>  #ifdef CONFIG_PM
> -static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
> +static int tmio_mmc_suspend(struct device *dev)
>  {
> -	const struct mfd_cell *cell = mfd_get_cell(dev);
> +	struct platform_device *pdev = to_platform_device(dev);
> +	const struct mfd_cell *cell = mfd_get_cell(pdev);
>  	int ret;
>  
> -	ret = tmio_mmc_host_suspend(&dev->dev);
> +	ret = tmio_mmc_host_suspend(dev);
>  
>  	/* Tell MFD core it can disable us now.*/
>  	if (!ret && cell->disable)
> -		cell->disable(dev);
> +		cell->disable(pdev);
>  
>  	return ret;
>  }
>  
> -static int tmio_mmc_resume(struct platform_device *dev)
> +static int tmio_mmc_resume(struct device *dev)
>  {
> -	const struct mfd_cell *cell = mfd_get_cell(dev);
> +	struct platform_device *pdev = to_platform_device(dev);
> +	const struct mfd_cell *cell = mfd_get_cell(pdev);
>  	int ret = 0;
>  
>  	/* Tell the MFD core we are ready to be enabled */
>  	if (cell->resume)
> -		ret = cell->resume(dev);
> +		ret = cell->resume(pdev);
>  
>  	if (!ret)
> -		ret = tmio_mmc_host_resume(&dev->dev);
> +		ret = tmio_mmc_host_resume(dev);
>  
>  	return ret;
>  }
> @@ -123,17 +125,19 @@ static int tmio_mmc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static SIMPLE_DEV_PM_OPS(tmio_mmc_dev_pm_ops, tmio_mmc_suspend,
> +			  tmio_mmc_resume);
> +
>  /* ------------------- device registration ----------------------- */
>  
>  static struct platform_driver tmio_mmc_driver = {
>  	.driver = {
>  		.name = "tmio-mmc",
>  		.owner = THIS_MODULE,
> +		.pm = &tmio_mmc_dev_pm_ops,
>  	},
>  	.probe = tmio_mmc_probe,
>  	.remove = tmio_mmc_remove,
> -	.suspend = tmio_mmc_suspend,
> -	.resume = tmio_mmc_resume,
>  };
>  
>  module_platform_driver(tmio_mmc_driver);
> -- 
> 1.7.10.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-08-26  8:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-10 15:20 [PATCH] isa: Change driver to use dev_pm_ops infrastructure Shuah Khan
2013-08-10 15:20 ` [PATCH] mmc:au1xmmc change " Shuah Khan
2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh " Shuah Khan
2013-08-12  2:33   ` Zhang, Sonic
2013-08-10 15:20 ` [PATCH] mmc:bfin_sdh fix build warning in sdh_dma_irq() Shuah Khan
2013-08-12  2:32   ` Zhang, Sonic
2013-08-10 15:20 ` [PATCH] mmc:cb710_mmc change driver to use dev_pm_ops infrastructure Shuah Khan
2013-08-10 15:20 ` [PATCH] mmc:msmsdcc " Shuah Khan
2013-08-10 15:20 ` [PATCH] mmc:mvsdio " Shuah Khan
2013-08-10 15:20 ` [PATCH] mmc:rtsx_pci_sdmmc " Shuah Khan
2013-08-10 15:20 ` [PATCH] mmc:tmio_mmc " Shuah Khan
2013-08-26  8:48   ` Guennadi Liakhovetski
2013-08-10 18:52 ` [PATCH] isa: Change " Greg KH
2013-08-12 17:02   ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).