public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
@ 2009-06-24  9:23 Magnus Damm
  2009-06-24  9:23 ` [PATCH 01/07] arm: rework omap suspend_late()/resume_early() Magnus Damm
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, ben-linux, hskinnemoen, anemo, linux-usb, akpm,
	linux-omap, linux-pm, felipe.balbi

pm: remove late/early platform driver pm callbacks V2

[PATCH 01/07] arm: rework omap suspend_late()/resume_early()
[PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
[PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
[PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
[PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
[PATCH 06/07] usb: rework musb suspend()/resume_early()
[PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2

These patches simply remove ->suspend_late() and ->resume_early()
from struct platform_driver. Drivers are converted to dev_pm_ops
with CONFIG_SUSPEND in mind. Untested.

All patches except [02/07] are known to compile.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Changes since V1:
 - resolved conflicts in [05/07], rediffed [07/07]
 - include lkml, linux-usb and akpm

 arch/arm/plat-omap/debug-leds.c  |   11 +++++++----
 arch/arm/plat-omap/gpio.c        |   14 ++++++++++----
 drivers/base/platform.c          |   36 ------------------------------------
 drivers/dma/dw_dmac.c            |   15 ++++++++++-----
 drivers/dma/txx9dmac.c           |   15 ++++++++++-----
 drivers/i2c/busses/i2c-pxa.c     |   25 +++++++++++++++++--------
 drivers/i2c/busses/i2c-s3c2410.c |   25 ++++++++++++++++---------
 drivers/usb/musb/musb_core.c     |   18 ++++++++++++------
 include/linux/platform_device.h  |    2 --
 9 files changed, 82 insertions(+), 79 deletions(-)

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

* [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
  2009-06-24  9:23 [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Magnus Damm
@ 2009-06-24  9:23 ` Magnus Damm
  2009-06-24  9:23 ` [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early() Magnus Damm
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, hskinnemoen, anemo, linux-usb, ben-linux, linux-pm,
	linux-omap, akpm, felipe.balbi

From: Magnus Damm <damm@igel.co.jp>

This patch reworks platform driver power management code
for omap drivers using late/early legacy callbacks.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Untested but compiles just fine.

 arch/arm/plat-omap/debug-leds.c |   11 +++++++----
 arch/arm/plat-omap/gpio.c       |   14 ++++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)

--- 0001/arch/arm/plat-omap/debug-leds.c
+++ work/arch/arm/plat-omap/debug-leds.c	2009-06-01 15:50:21.000000000 +0900
@@ -281,24 +281,27 @@ static int /* __init */ fpga_probe(struc
 	return 0;
 }
 
-static int fpga_suspend_late(struct platform_device *pdev, pm_message_t mesg)
+static int fpga_suspend_noirq(struct device *dev)
 {
 	__raw_writew(~0, &fpga->leds);
 	return 0;
 }
 
-static int fpga_resume_early(struct platform_device *pdev)
+static int fpga_resume_noirq(struct device *dev)
 {
 	__raw_writew(~hw_led_state, &fpga->leds);
 	return 0;
 }
 
+static struct dev_pm_ops fpga_dev_pm_ops = {
+	.suspend_noirq = fpga_suspend_noirq,
+	.resume_noirq = fpga_resume_noirq,
+};
 
 static struct platform_driver led_driver = {
 	.driver.name	= "omap_dbg_led",
+	.driver.pm	= &fpga_dev_pm_ops,
 	.probe		= fpga_probe,
-	.suspend_late	= fpga_suspend_late,
-	.resume_early	= fpga_resume_early,
 };
 
 static int __init fpga_init(void)
--- 0001/arch/arm/plat-omap/gpio.c
+++ work/arch/arm/plat-omap/gpio.c	2009-06-01 16:30:56.000000000 +0900
@@ -1264,8 +1264,9 @@ static struct irq_chip mpuio_irq_chip = 
 
 #include <linux/platform_device.h>
 
-static int omap_mpuio_suspend_late(struct platform_device *pdev, pm_message_t mesg)
+static int omap_mpuio_suspend_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct gpio_bank	*bank = platform_get_drvdata(pdev);
 	void __iomem		*mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT;
 	unsigned long		flags;
@@ -1278,8 +1279,9 @@ static int omap_mpuio_suspend_late(struc
 	return 0;
 }
 
-static int omap_mpuio_resume_early(struct platform_device *pdev)
+static int omap_mpuio_resume_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct gpio_bank	*bank = platform_get_drvdata(pdev);
 	void __iomem		*mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT;
 	unsigned long		flags;
@@ -1291,14 +1293,18 @@ static int omap_mpuio_resume_early(struc
 	return 0;
 }
 
+static struct dev_pm_ops omap_mpuio_dev_pm_ops = {
+	.suspend_noirq = omap_mpuio_suspend_noirq,
+	.resume_noirq = omap_mpuio_resume_noirq,
+};
+
 /* use platform_driver for this, now that there's no longer any
  * point to sys_device (other than not disturbing old code).
  */
 static struct platform_driver omap_mpuio_driver = {
-	.suspend_late	= omap_mpuio_suspend_late,
-	.resume_early	= omap_mpuio_resume_early,
 	.driver		= {
 		.name	= "mpuio",
+		.pm	= &omap_mpuio_dev_pm_ops,
 	},
 };
 

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

* [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
  2009-06-24  9:23 [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Magnus Damm
  2009-06-24  9:23 ` [PATCH 01/07] arm: rework omap suspend_late()/resume_early() Magnus Damm
@ 2009-06-24  9:23 ` Magnus Damm
  2009-06-24  9:23 ` [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2 Magnus Damm
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, ben-linux, hskinnemoen, anemo, linux-usb, linux-pm,
	linux-omap, akpm, felipe.balbi

From: Magnus Damm <damm@igel.co.jp>

This patch reworks platform driver power management code
for dw_dmac from legacy late/early callbacks to dev_pm_ops.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Untested and not test compiled due to lack of cross compiler.

 drivers/dma/dw_dmac.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

--- 0001/drivers/dma/dw_dmac.c
+++ work/drivers/dma/dw_dmac.c	2009-06-01 16:31:34.000000000 +0900
@@ -1399,8 +1399,9 @@ static void dw_shutdown(struct platform_
 	clk_disable(dw->clk);
 }
 
-static int dw_suspend_late(struct platform_device *pdev, pm_message_t mesg)
+static int dw_suspend_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct dw_dma	*dw = platform_get_drvdata(pdev);
 
 	dw_dma_off(platform_get_drvdata(pdev));
@@ -1408,23 +1409,27 @@ static int dw_suspend_late(struct platfo
 	return 0;
 }
 
-static int dw_resume_early(struct platform_device *pdev)
+static int dw_resume_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct dw_dma	*dw = platform_get_drvdata(pdev);
 
 	clk_enable(dw->clk);
 	dma_writel(dw, CFG, DW_CFG_DMA_EN);
 	return 0;
-
 }
 
+static struct dev_pm_ops dw_dev_pm_ops = {
+	.suspend_noirq = dw_suspend_noirq,
+	.resume_noirq = dw_resume_noirq,
+};
+
 static struct platform_driver dw_driver = {
 	.remove		= __exit_p(dw_remove),
 	.shutdown	= dw_shutdown,
-	.suspend_late	= dw_suspend_late,
-	.resume_early	= dw_resume_early,
 	.driver = {
 		.name	= "dw_dmac",
+		.pm	= &dw_dev_pm_ops,
 	},
 };
 

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

* [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
       [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
@ 2009-06-24  9:23   ` Magnus Damm
  2009-06-24  9:23   ` [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early() Magnus Damm
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:23 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: gregkh-l3A5Bk7waGM, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	hskinnemoen-AIFe0yeh4nAAvxtiuMwx3w, anemo-7JcRY8pycbNHfZP73Gtkiw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, rjw-KKrjLPT3xs0,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, pavel-+ZI9xUNit7I,
	Magnus Damm, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w

From: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>

This patch reworks platform driver power management code
for txx9dmac from legacy late/early callbacks to dev_pm_ops.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
---

 Untested but compiles fine.

 drivers/dma/txx9dmac.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

--- 0001/drivers/dma/txx9dmac.c
+++ work/drivers/dma/txx9dmac.c	2009-06-01 16:34:23.000000000 +0900
@@ -1287,17 +1287,18 @@ static void txx9dmac_shutdown(struct pla
 	txx9dmac_off(ddev);
 }
 
-static int txx9dmac_suspend_late(struct platform_device *pdev,
-				 pm_message_t mesg)
+static int txx9dmac_suspend_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct txx9dmac_dev *ddev = platform_get_drvdata(pdev);
 
 	txx9dmac_off(ddev);
 	return 0;
 }
 
-static int txx9dmac_resume_early(struct platform_device *pdev)
+static int txx9dmac_resume_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct txx9dmac_dev *ddev = platform_get_drvdata(pdev);
 	struct txx9dmac_platform_data *pdata = pdev->dev.platform_data;
 	u32 mcr;
@@ -1310,6 +1311,11 @@ static int txx9dmac_resume_early(struct 
 
 }
 
+static struct dev_pm_ops txx9dmac_dev_pm_ops = {
+	.suspend_noirq = txx9dmac_suspend_noirq,
+	.resume_noirq = txx9dmac_resume_noirq,
+};
+
 static struct platform_driver txx9dmac_chan_driver = {
 	.remove		= __exit_p(txx9dmac_chan_remove),
 	.driver = {
@@ -1320,10 +1326,9 @@ static struct platform_driver txx9dmac_c
 static struct platform_driver txx9dmac_driver = {
 	.remove		= __exit_p(txx9dmac_remove),
 	.shutdown	= txx9dmac_shutdown,
-	.suspend_late	= txx9dmac_suspend_late,
-	.resume_early	= txx9dmac_resume_early,
 	.driver = {
 		.name	= "txx9dmac",
+		.pm	= &txx9dmac_dev_pm_ops,
 	},
 };
 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
       [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
  2009-06-24  9:23   ` [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early() Magnus Damm
@ 2009-06-24  9:23   ` Magnus Damm
  2009-06-24  9:24   ` [PATCH 06/07] usb: rework musb suspend()/resume_early() Magnus Damm
  2009-06-24 18:48   ` [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Rafael J. Wysocki
  3 siblings, 0 replies; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:23 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: gregkh-l3A5Bk7waGM, pavel-+ZI9xUNit7I,
	hskinnemoen-AIFe0yeh4nAAvxtiuMwx3w, anemo-7JcRY8pycbNHfZP73Gtkiw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, rjw-KKrjLPT3xs0,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Magnus Damm,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w

From: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>

This patch reworks platform driver power management code
for i2c-pxa from legacy late/early callbacks to dev_pm_ops.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
---

 Untested but compiles fine.

 drivers/i2c/busses/i2c-pxa.c |   25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

--- 0001/drivers/i2c/busses/i2c-pxa.c
+++ work/drivers/i2c/busses/i2c-pxa.c	2009-06-01 15:26:06.000000000 +0900
@@ -1135,35 +1135,44 @@ static int __exit i2c_pxa_remove(struct 
 }
 
 #ifdef CONFIG_PM
-static int i2c_pxa_suspend_late(struct platform_device *dev, pm_message_t state)
+static int i2c_pxa_suspend_noirq(struct device *dev)
 {
-	struct pxa_i2c *i2c = platform_get_drvdata(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
+
 	clk_disable(i2c->clk);
+
 	return 0;
 }
 
-static int i2c_pxa_resume_early(struct platform_device *dev)
+static int i2c_pxa_resume_noirq(struct device *dev)
 {
-	struct pxa_i2c *i2c = platform_get_drvdata(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct pxa_i2c *i2c = platform_get_drvdata(pdev);
 
 	clk_enable(i2c->clk);
 	i2c_pxa_reset(i2c);
 
 	return 0;
 }
+
+static struct dev_pm_ops i2c_pxa_dev_pm_ops = {
+	.suspend_noirq = i2c_pxa_suspend_noirq,
+	.resume_noirq = i2c_pxa_resume_noirq,
+};
+
+#define I2C_PXA_DEV_PM_OPS (&i2c_pxa_dev_pm_ops)
 #else
-#define i2c_pxa_suspend_late NULL
-#define i2c_pxa_resume_early NULL
+#define I2C_PXA_DEV_PM_OPS NULL
 #endif
 
 static struct platform_driver i2c_pxa_driver = {
 	.probe		= i2c_pxa_probe,
 	.remove		= __exit_p(i2c_pxa_remove),
-	.suspend_late	= i2c_pxa_suspend_late,
-	.resume_early	= i2c_pxa_resume_early,
 	.driver		= {
 		.name	= "pxa2xx-i2c",
 		.owner	= THIS_MODULE,
+		.pm	= I2C_PXA_DEV_PM_OPS,
 	},
 	.id_table	= i2c_pxa_id_table,
 };
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
  2009-06-24  9:23 [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Magnus Damm
  2009-06-24  9:23 ` [PATCH 01/07] arm: rework omap suspend_late()/resume_early() Magnus Damm
  2009-06-24  9:23 ` [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early() Magnus Damm
@ 2009-06-24  9:23 ` Magnus Damm
  2009-06-24  9:24 ` [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2 Magnus Damm
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, ben-linux, hskinnemoen, anemo, linux-usb, Magnus Damm,
	rjw, stern, pavel, linux-pm, linux-omap, akpm, felipe.balbi

From: Magnus Damm <damm@igel.co.jp>

This is V2 of the i2c-s3c2410 dev_pm_ops patch.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume() -> resume()

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Changes since V1:
 - resolved conflicts to fit upstream changes

 drivers/i2c/busses/i2c-s3c2410.c |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

--- 0001/drivers/i2c/busses/i2c-s3c2410.c
+++ work/drivers/i2c/busses/i2c-s3c2410.c	2009-06-22 17:18:22.000000000 +0900
@@ -951,17 +951,20 @@ static int s3c24xx_i2c_remove(struct pla
 }
 
 #ifdef CONFIG_PM
-static int s3c24xx_i2c_suspend_late(struct platform_device *dev,
-				    pm_message_t msg)
+static int s3c24xx_i2c_suspend_noirq(struct device *dev)
 {
-	struct s3c24xx_i2c *i2c = platform_get_drvdata(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
+
 	i2c->suspended = 1;
+
 	return 0;
 }
 
-static int s3c24xx_i2c_resume(struct platform_device *dev)
+static int s3c24xx_i2c_resume(struct device *dev)
 {
-	struct s3c24xx_i2c *i2c = platform_get_drvdata(dev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
 	i2c->suspended = 0;
 	s3c24xx_i2c_init(i2c);
@@ -969,9 +972,14 @@ static int s3c24xx_i2c_resume(struct pla
 	return 0;
 }
 
+static struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
+	.suspend_noirq = s3c24xx_i2c_suspend_noirq,
+	.resume = s3c24xx_i2c_resume,
+};
+
+#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
 #else
-#define s3c24xx_i2c_suspend_late NULL
-#define s3c24xx_i2c_resume NULL
+#define S3C24XX_DEV_PM_OPS NULL
 #endif
 
 /* device driver for platform bus bits */
@@ -990,12 +998,11 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_dr
 static struct platform_driver s3c24xx_i2c_driver = {
 	.probe		= s3c24xx_i2c_probe,
 	.remove		= s3c24xx_i2c_remove,
-	.suspend_late	= s3c24xx_i2c_suspend_late,
-	.resume		= s3c24xx_i2c_resume,
 	.id_table	= s3c24xx_driver_ids,
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "s3c-i2c",
+		.pm	= S3C24XX_DEV_PM_OPS,
 	},
 };
 

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

* [PATCH 06/07] usb: rework musb suspend()/resume_early()
       [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
  2009-06-24  9:23   ` [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early() Magnus Damm
  2009-06-24  9:23   ` [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early() Magnus Damm
@ 2009-06-24  9:24   ` Magnus Damm
  2009-06-24 20:34     ` Greg KH
  2009-06-24 18:48   ` [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Rafael J. Wysocki
  3 siblings, 1 reply; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:24 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: gregkh-l3A5Bk7waGM, pavel-+ZI9xUNit7I,
	hskinnemoen-AIFe0yeh4nAAvxtiuMwx3w, anemo-7JcRY8pycbNHfZP73Gtkiw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, rjw-KKrjLPT3xs0,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg, Magnus Damm,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w

From: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>

This patch reworks platform driver power management code
for musb from legacy callbacks to dev_pm_ops.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend() -> suspend()
  resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
---

 Untested but compiles fine.

 drivers/i2c/busses/i2c-pxa.c |   25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

--- 0001/drivers/usb/musb/musb_core.c
+++ work/drivers/usb/musb/musb_core.c	2009-06-01 15:27:12.000000000 +0900
@@ -2168,8 +2168,9 @@ static int __devexit musb_remove(struct 
 
 #ifdef	CONFIG_PM
 
-static int musb_suspend(struct platform_device *pdev, pm_message_t message)
+static int musb_suspend(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	unsigned long	flags;
 	struct musb	*musb = dev_to_musb(&pdev->dev);
 
@@ -2196,8 +2197,9 @@ static int musb_suspend(struct platform_
 	return 0;
 }
 
-static int musb_resume_early(struct platform_device *pdev)
+static int musb_resume_noirq(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct musb	*musb = dev_to_musb(&pdev->dev);
 
 	if (!musb->clock)
@@ -2215,9 +2217,14 @@ static int musb_resume_early(struct plat
 	return 0;
 }
 
+static struct dev_pm_ops musb_dev_pm_ops = {
+	.suspend	= musb_suspend,
+	.resume_noirq	= musb_resume_noirq,
+};
+
+#define MUSB_DEV_PM_OPS (&musb_dev_pm_ops)
 #else
-#define	musb_suspend	NULL
-#define	musb_resume_early	NULL
+#define	MUSB_DEV_PM_OPS	NULL
 #endif
 
 static struct platform_driver musb_driver = {
@@ -2225,11 +2232,10 @@ static struct platform_driver musb_drive
 		.name		= (char *)musb_driver_name,
 		.bus		= &platform_bus_type,
 		.owner		= THIS_MODULE,
+		.pm		= MUSB_DEV_PM_OPS,
 	},
 	.remove		= __devexit_p(musb_remove),
 	.shutdown	= musb_shutdown,
-	.suspend	= musb_suspend,
-	.resume_early	= musb_resume_early,
 };
 
 /*-------------------------------------------------------------------------*/
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
  2009-06-24  9:23 [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Magnus Damm
                   ` (2 preceding siblings ...)
  2009-06-24  9:23 ` [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2 Magnus Damm
@ 2009-06-24  9:24 ` Magnus Damm
  2009-06-24 16:02   ` Pavel Machek
       [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
  2009-07-04 23:45 ` Rafael J. Wysocki
  5 siblings, 1 reply; 16+ messages in thread
From: Magnus Damm @ 2009-06-24  9:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: gregkh, ben-linux, hskinnemoen, anemo, linux-usb, rjw, stern,
	pavel, linux-pm, akpm, linux-omap, Magnus Damm, felipe.balbi

From: Magnus Damm <damm@igel.co.jp>

This is V2 of the platform driver power management late/early
callback removal patch. The callbacks ->suspend_late() and
->resume_early() are removed since all in-tree users now have
been migrated to dev_pm_ops.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
---

 Untested but compiles fine.

 Changes since V1:
 - none, just rediff to fit upstream changes

 drivers/base/platform.c         |   36 ------------------------------------
 include/linux/platform_device.h |    2 --
 2 files changed, 38 deletions(-)

--- 0001/drivers/base/platform.c
+++ work/drivers/base/platform.c	2009-06-24 17:27:33.000000000 +0900
@@ -628,30 +628,6 @@ static int platform_legacy_suspend(struc
 	return ret;
 }
 
-static int platform_legacy_suspend_late(struct device *dev, pm_message_t mesg)
-{
-	struct platform_driver *pdrv = to_platform_driver(dev->driver);
-	struct platform_device *pdev = to_platform_device(dev);
-	int ret = 0;
-
-	if (dev->driver && pdrv->suspend_late)
-		ret = pdrv->suspend_late(pdev, mesg);
-
-	return ret;
-}
-
-static int platform_legacy_resume_early(struct device *dev)
-{
-	struct platform_driver *pdrv = to_platform_driver(dev->driver);
-	struct platform_device *pdev = to_platform_device(dev);
-	int ret = 0;
-
-	if (dev->driver && pdrv->resume_early)
-		ret = pdrv->resume_early(pdev);
-
-	return ret;
-}
-
 static int platform_legacy_resume(struct device *dev)
 {
 	struct platform_driver *pdrv = to_platform_driver(dev->driver);
@@ -714,8 +690,6 @@ static int platform_pm_suspend_noirq(str
 	if (drv->pm) {
 		if (drv->pm->suspend_noirq)
 			ret = drv->pm->suspend_noirq(dev);
-	} else {
-		ret = platform_legacy_suspend_late(dev, PMSG_SUSPEND);
 	}
 
 	return ret;
@@ -750,8 +724,6 @@ static int platform_pm_resume_noirq(stru
 	if (drv->pm) {
 		if (drv->pm->resume_noirq)
 			ret = drv->pm->resume_noirq(dev);
-	} else {
-		ret = platform_legacy_resume_early(dev);
 	}
 
 	return ret;
@@ -797,8 +769,6 @@ static int platform_pm_freeze_noirq(stru
 	if (drv->pm) {
 		if (drv->pm->freeze_noirq)
 			ret = drv->pm->freeze_noirq(dev);
-	} else {
-		ret = platform_legacy_suspend_late(dev, PMSG_FREEZE);
 	}
 
 	return ret;
@@ -833,8 +803,6 @@ static int platform_pm_thaw_noirq(struct
 	if (drv->pm) {
 		if (drv->pm->thaw_noirq)
 			ret = drv->pm->thaw_noirq(dev);
-	} else {
-		ret = platform_legacy_resume_early(dev);
 	}
 
 	return ret;
@@ -869,8 +837,6 @@ static int platform_pm_poweroff_noirq(st
 	if (drv->pm) {
 		if (drv->pm->poweroff_noirq)
 			ret = drv->pm->poweroff_noirq(dev);
-	} else {
-		ret = platform_legacy_suspend_late(dev, PMSG_HIBERNATE);
 	}
 
 	return ret;
@@ -905,8 +871,6 @@ static int platform_pm_restore_noirq(str
 	if (drv->pm) {
 		if (drv->pm->restore_noirq)
 			ret = drv->pm->restore_noirq(dev);
-	} else {
-		ret = platform_legacy_resume_early(dev);
 	}
 
 	return ret;
--- 0001/include/linux/platform_device.h
+++ work/include/linux/platform_device.h	2009-06-24 17:27:33.000000000 +0900
@@ -57,8 +57,6 @@ struct platform_driver {
 	int (*remove)(struct platform_device *);
 	void (*shutdown)(struct platform_device *);
 	int (*suspend)(struct platform_device *, pm_message_t state);
-	int (*suspend_late)(struct platform_device *, pm_message_t state);
-	int (*resume_early)(struct platform_device *);
 	int (*resume)(struct platform_device *);
 	struct device_driver driver;
 	struct platform_device_id *id_table;

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

* Re: [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
  2009-06-24  9:24 ` [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2 Magnus Damm
@ 2009-06-24 16:02   ` Pavel Machek
  0 siblings, 0 replies; 16+ messages in thread
From: Pavel Machek @ 2009-06-24 16:02 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, gregkh, ben-linux, hskinnemoen, anemo, linux-usb,
	rjw, stern, linux-pm, akpm, linux-omap, felipe.balbi

On Wed 2009-06-24 18:24:09, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
> 
> This is V2 of the platform driver power management late/early
> callback removal patch. The callbacks ->suspend_late() and
> ->resume_early() are removed since all in-tree users now have
> been migrated to dev_pm_ops.
> 
> Signed-off-by: Magnus Damm <damm@igel.co.jp>

Looks ok to me. ACK.

> ---
> 
>  Untested but compiles fine.
> 
>  Changes since V1:
>  - none, just rediff to fit upstream changes
> 
>  drivers/base/platform.c         |   36 ------------------------------------
>  include/linux/platform_device.h |    2 --
>  2 files changed, 38 deletions(-)
> 
> --- 0001/drivers/base/platform.c
> +++ work/drivers/base/platform.c	2009-06-24 17:27:33.000000000 +0900
> @@ -628,30 +628,6 @@ static int platform_legacy_suspend(struc
>  	return ret;
>  }
>  
> -static int platform_legacy_suspend_late(struct device *dev, pm_message_t mesg)
> -{
> -	struct platform_driver *pdrv = to_platform_driver(dev->driver);
> -	struct platform_device *pdev = to_platform_device(dev);
> -	int ret = 0;
> -
> -	if (dev->driver && pdrv->suspend_late)
> -		ret = pdrv->suspend_late(pdev, mesg);
> -
> -	return ret;
> -}
> -
> -static int platform_legacy_resume_early(struct device *dev)
> -{
> -	struct platform_driver *pdrv = to_platform_driver(dev->driver);
> -	struct platform_device *pdev = to_platform_device(dev);
> -	int ret = 0;
> -
> -	if (dev->driver && pdrv->resume_early)
> -		ret = pdrv->resume_early(pdev);
> -
> -	return ret;
> -}
> -
>  static int platform_legacy_resume(struct device *dev)
>  {
>  	struct platform_driver *pdrv = to_platform_driver(dev->driver);
> @@ -714,8 +690,6 @@ static int platform_pm_suspend_noirq(str
>  	if (drv->pm) {
>  		if (drv->pm->suspend_noirq)
>  			ret = drv->pm->suspend_noirq(dev);
> -	} else {
> -		ret = platform_legacy_suspend_late(dev, PMSG_SUSPEND);
>  	}
>  
>  	return ret;
> @@ -750,8 +724,6 @@ static int platform_pm_resume_noirq(stru
>  	if (drv->pm) {
>  		if (drv->pm->resume_noirq)
>  			ret = drv->pm->resume_noirq(dev);
> -	} else {
> -		ret = platform_legacy_resume_early(dev);
>  	}
>  
>  	return ret;
> @@ -797,8 +769,6 @@ static int platform_pm_freeze_noirq(stru
>  	if (drv->pm) {
>  		if (drv->pm->freeze_noirq)
>  			ret = drv->pm->freeze_noirq(dev);
> -	} else {
> -		ret = platform_legacy_suspend_late(dev, PMSG_FREEZE);
>  	}
>  
>  	return ret;
> @@ -833,8 +803,6 @@ static int platform_pm_thaw_noirq(struct
>  	if (drv->pm) {
>  		if (drv->pm->thaw_noirq)
>  			ret = drv->pm->thaw_noirq(dev);
> -	} else {
> -		ret = platform_legacy_resume_early(dev);
>  	}
>  
>  	return ret;
> @@ -869,8 +837,6 @@ static int platform_pm_poweroff_noirq(st
>  	if (drv->pm) {
>  		if (drv->pm->poweroff_noirq)
>  			ret = drv->pm->poweroff_noirq(dev);
> -	} else {
> -		ret = platform_legacy_suspend_late(dev, PMSG_HIBERNATE);
>  	}
>  
>  	return ret;
> @@ -905,8 +871,6 @@ static int platform_pm_restore_noirq(str
>  	if (drv->pm) {
>  		if (drv->pm->restore_noirq)
>  			ret = drv->pm->restore_noirq(dev);
> -	} else {
> -		ret = platform_legacy_resume_early(dev);
>  	}
>  
>  	return ret;
> --- 0001/include/linux/platform_device.h
> +++ work/include/linux/platform_device.h	2009-06-24 17:27:33.000000000 +0900
> @@ -57,8 +57,6 @@ struct platform_driver {
>  	int (*remove)(struct platform_device *);
>  	void (*shutdown)(struct platform_device *);
>  	int (*suspend)(struct platform_device *, pm_message_t state);
> -	int (*suspend_late)(struct platform_device *, pm_message_t state);
> -	int (*resume_early)(struct platform_device *);
>  	int (*resume)(struct platform_device *);
>  	struct device_driver driver;
>  	struct platform_device_id *id_table;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
       [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
                     ` (2 preceding siblings ...)
  2009-06-24  9:24   ` [PATCH 06/07] usb: rework musb suspend()/resume_early() Magnus Damm
@ 2009-06-24 18:48   ` Rafael J. Wysocki
  2009-06-24 18:56     ` Pavel Machek
       [not found]     ` <200906242048.40956.rjw-KKrjLPT3xs0@public.gmane.org>
  3 siblings, 2 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2009-06-24 18:48 UTC (permalink / raw)
  To: Magnus Damm, gregkh-l3A5Bk7waGM
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, pavel-+ZI9xUNit7I,
	hskinnemoen-AIFe0yeh4nAAvxtiuMwx3w, anemo-7JcRY8pycbNHfZP73Gtkiw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w

On Wednesday 24 June 2009, Magnus Damm wrote:
> pm: remove late/early platform driver pm callbacks V2
> 
> [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
> [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
> [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
> [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
> [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
> [PATCH 06/07] usb: rework musb suspend()/resume_early()
> [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
> 
> These patches simply remove ->suspend_late() and ->resume_early()
> from struct platform_driver. Drivers are converted to dev_pm_ops
> with CONFIG_SUSPEND in mind. Untested.
> 
> All patches except [02/07] are known to compile.
> 
> Signed-off-by: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>

If no one objects, I'd like to take this series into the suspend-2.6 tree as
2.6.32 material.  Greg?

Pavel, is your ACK for the entire series?

Best,
Rafael

> ---
> 
>  Changes since V1:
>  - resolved conflicts in [05/07], rediffed [07/07]
>  - include lkml, linux-usb and akpm
> 
>  arch/arm/plat-omap/debug-leds.c  |   11 +++++++----
>  arch/arm/plat-omap/gpio.c        |   14 ++++++++++----
>  drivers/base/platform.c          |   36 ------------------------------------
>  drivers/dma/dw_dmac.c            |   15 ++++++++++-----
>  drivers/dma/txx9dmac.c           |   15 ++++++++++-----
>  drivers/i2c/busses/i2c-pxa.c     |   25 +++++++++++++++++--------
>  drivers/i2c/busses/i2c-s3c2410.c |   25 ++++++++++++++++---------
>  drivers/usb/musb/musb_core.c     |   18 ++++++++++++------
>  include/linux/platform_device.h  |    2 --
>  9 files changed, 82 insertions(+), 79 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
  2009-06-24 18:48   ` [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Rafael J. Wysocki
@ 2009-06-24 18:56     ` Pavel Machek
       [not found]     ` <200906242048.40956.rjw-KKrjLPT3xs0@public.gmane.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Pavel Machek @ 2009-06-24 18:56 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Magnus Damm, gregkh, linux-kernel, hskinnemoen, anemo, linux-usb,
	akpm, stern, ben-linux, linux-omap, linux-pm, felipe.balbi

On Wed 2009-06-24 20:48:39, Rafael J. Wysocki wrote:
> On Wednesday 24 June 2009, Magnus Damm wrote:
> > pm: remove late/early platform driver pm callbacks V2
> > 
> > [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
> > [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
> > [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
> > [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
> > [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
> > [PATCH 06/07] usb: rework musb suspend()/resume_early()
> > [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
> > 
> > These patches simply remove ->suspend_late() and ->resume_early()
> > from struct platform_driver. Drivers are converted to dev_pm_ops
> > with CONFIG_SUSPEND in mind. Untested.
> > 
> > All patches except [02/07] are known to compile.
> > 
> > Signed-off-by: Magnus Damm <damm@igel.co.jp>
> 
> If no one objects, I'd like to take this series into the suspend-2.6 tree as
> 2.6.32 material.  Greg?
> 
> Pavel, is your ACK for the entire series?

Well, I don't really understand stuff like dw_dmac.c, but it looks
basically okay to me. I guess ACK might be okay.

> >  arch/arm/plat-omap/debug-leds.c  |   11 +++++++----
> >  arch/arm/plat-omap/gpio.c        |   14 ++++++++++----
> >  drivers/base/platform.c          |   36 ------------------------------------
> >  drivers/dma/dw_dmac.c            |   15 ++++++++++-----
> >  drivers/dma/txx9dmac.c           |   15 ++++++++++-----
> >  drivers/i2c/busses/i2c-pxa.c     |   25 +++++++++++++++++--------
> >  drivers/i2c/busses/i2c-s3c2410.c |   25 ++++++++++++++++---------
> >  drivers/usb/musb/musb_core.c     |   18 ++++++++++++------
> >  include/linux/platform_device.h  |    2 --
> >  9 files changed, 82 insertions(+), 79 deletions(-)

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
       [not found]     ` <200906242048.40956.rjw-KKrjLPT3xs0@public.gmane.org>
@ 2009-06-24 20:33       ` Greg KH
  0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2009-06-24 20:33 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Magnus Damm, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	pavel-+ZI9xUNit7I, hskinnemoen-AIFe0yeh4nAAvxtiuMwx3w,
	anemo-7JcRY8pycbNHfZP73Gtkiw, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w

On Wed, Jun 24, 2009 at 08:48:39PM +0200, Rafael J. Wysocki wrote:
> On Wednesday 24 June 2009, Magnus Damm wrote:
> > pm: remove late/early platform driver pm callbacks V2
> > 
> > [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
> > [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
> > [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
> > [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
> > [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
> > [PATCH 06/07] usb: rework musb suspend()/resume_early()
> > [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
> > 
> > These patches simply remove ->suspend_late() and ->resume_early()
> > from struct platform_driver. Drivers are converted to dev_pm_ops
> > with CONFIG_SUSPEND in mind. Untested.
> > 
> > All patches except [02/07] are known to compile.
> > 
> > Signed-off-by: Magnus Damm <damm-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
> 
> If no one objects, I'd like to take this series into the suspend-2.6 tree as
> 2.6.32 material.  Greg?

Looks good to me, feel free to add an:
	Acked-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
to the whole series.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 06/07] usb: rework musb suspend()/resume_early()
  2009-06-24  9:24   ` [PATCH 06/07] usb: rework musb suspend()/resume_early() Magnus Damm
@ 2009-06-24 20:34     ` Greg KH
  0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2009-06-24 20:34 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, pavel, hskinnemoen, anemo, linux-usb, akpm, rjw,
	stern, ben-linux, linux-omap, linux-pm, felipe.balbi

On Wed, Jun 24, 2009 at 06:24:00PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
> 
> This patch reworks platform driver power management code
> for musb from legacy callbacks to dev_pm_ops.
> 
> The callbacks are converted for CONFIG_SUSPEND like this:
>   suspend() -> suspend()
>   resume_early() -> resume_noirq()
> 
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
> 
>  Untested but compiles fine.
> 
>  drivers/i2c/busses/i2c-pxa.c |   25 +++++++++++++++++--------
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 
> --- 0001/drivers/usb/musb/musb_core.c

I think you need to look at the tools you used to create this series,
the diffstat doesn't seem to match up here :)

thanks,

greg k-h

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

* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
  2009-06-24  9:23 [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Magnus Damm
                   ` (4 preceding siblings ...)
       [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
@ 2009-07-04 23:45 ` Rafael J. Wysocki
  2009-09-09  1:25   ` Dan Williams
  5 siblings, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2009-07-04 23:45 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, gregkh, pavel, hskinnemoen, anemo, linux-usb, akpm,
	stern, ben-linux, linux-omap, linux-pm, felipe.balbi

On Wednesday 24 June 2009, Magnus Damm wrote:
> pm: remove late/early platform driver pm callbacks V2
> 
> [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
> [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
> [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
> [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
> [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
> [PATCH 06/07] usb: rework musb suspend()/resume_early()
> [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
> 
> These patches simply remove ->suspend_late() and ->resume_early()
> from struct platform_driver. Drivers are converted to dev_pm_ops
> with CONFIG_SUSPEND in mind. Untested.
> 
> All patches except [02/07] are known to compile.
> 
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
> 
>  Changes since V1:
>  - resolved conflicts in [05/07], rediffed [07/07]
>  - include lkml, linux-usb and akpm
> 
>  arch/arm/plat-omap/debug-leds.c  |   11 +++++++----
>  arch/arm/plat-omap/gpio.c        |   14 ++++++++++----
>  drivers/base/platform.c          |   36 ------------------------------------
>  drivers/dma/dw_dmac.c            |   15 ++++++++++-----
>  drivers/dma/txx9dmac.c           |   15 ++++++++++-----
>  drivers/i2c/busses/i2c-pxa.c     |   25 +++++++++++++++++--------
>  drivers/i2c/busses/i2c-s3c2410.c |   25 ++++++++++++++++---------
>  drivers/usb/musb/musb_core.c     |   18 ++++++++++++------
>  include/linux/platform_device.h  |    2 --
>  9 files changed, 82 insertions(+), 79 deletions(-)

The series is now in the linux-next branch of the suspend-2.6 tree.  I'll move
it into the for-linus branch, which is not rebased, if the patches are not
reported to cause any problems in the next few days.

Best,
Rafael

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

* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
  2009-07-04 23:45 ` Rafael J. Wysocki
@ 2009-09-09  1:25   ` Dan Williams
  2009-09-09 22:09     ` Rafael J. Wysocki
  0 siblings, 1 reply; 16+ messages in thread
From: Dan Williams @ 2009-09-09  1:25 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Magnus Damm, linux-kernel, gregkh, pavel, hskinnemoen, anemo,
	linux-usb, akpm, stern, ben-linux, linux-omap, linux-pm,
	felipe.balbi, nicolas.ferre, linux-next

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

2009/7/4 Rafael J. Wysocki <rjw@sisk.pl>:
> On Wednesday 24 June 2009, Magnus Damm wrote:
>> pm: remove late/early platform driver pm callbacks V2
>>
>> [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
>> [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
>> [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
>> [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
>> [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
>> [PATCH 06/07] usb: rework musb suspend()/resume_early()
>> [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
>>
>> These patches simply remove ->suspend_late() and ->resume_early()
>> from struct platform_driver. Drivers are converted to dev_pm_ops
>> with CONFIG_SUSPEND in mind. Untested.
>>
>> All patches except [02/07] are known to compile.
>>
>> Signed-off-by: Magnus Damm <damm@igel.co.jp>
[..]
>
> The series is now in the linux-next branch of the suspend-2.6 tree.  I'll move
> it into the for-linus branch, which is not rebased, if the patches are not
> reported to cause any problems in the next few days.
>

Hi,

My linux-next test builds for drivers/dma/ caught a missed conversion
of the at_hdmac driver.  Please check the attached fix (compile tested
only) and include it in this series.

Thanks and regards,
Dan

[-- Attachment #2: at-hdmac-rework-suspend.patch --]
[-- Type: application/octet-stream, Size: 2119 bytes --]

at_hdmac: Rework suspend_late()/resume_early()

From: Dan Williams <dan.j.williams@intel.com>

This patch reworks platform driver power management code
for at_hdmac from legacy late/early callbacks to dev_pm_ops.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume_early() -> resume_noirq()

Cc: Magnus Damm <damm@igel.co.jp>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/dma/at_hdmac.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 0aeb578..7585c41 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1168,32 +1168,37 @@ static void at_dma_shutdown(struct platform_device *pdev)
 	clk_disable(atdma->clk);
 }
 
-static int at_dma_suspend_late(struct platform_device *pdev, pm_message_t mesg)
+static int at_dma_suspend_noirq(struct device *dev)
 {
-	struct at_dma	*atdma = platform_get_drvdata(pdev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct at_dma *atdma = platform_get_drvdata(pdev);
 
 	at_dma_off(platform_get_drvdata(pdev));
 	clk_disable(atdma->clk);
 	return 0;
 }
 
-static int at_dma_resume_early(struct platform_device *pdev)
+static int at_dma_resume_noirq(struct device *dev)
 {
-	struct at_dma	*atdma = platform_get_drvdata(pdev);
+	struct platform_device *pdev = to_platform_device(dev);
+	struct at_dma *atdma = platform_get_drvdata(pdev);
 
 	clk_enable(atdma->clk);
 	dma_writel(atdma, EN, AT_DMA_ENABLE);
 	return 0;
-
 }
 
+static struct dev_pm_ops at_dma_dev_pm_ops = {
+	.suspend_noirq = at_dma_suspend_noirq,
+	.resume_noirq = at_dma_resume_noirq,
+};
+
 static struct platform_driver at_dma_driver = {
 	.remove		= __exit_p(at_dma_remove),
 	.shutdown	= at_dma_shutdown,
-	.suspend_late	= at_dma_suspend_late,
-	.resume_early	= at_dma_resume_early,
 	.driver = {
 		.name	= "at_hdmac",
+		.pm	= &at_dma_dev_pm_ops,
 	},
 };
 

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

* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
  2009-09-09  1:25   ` Dan Williams
@ 2009-09-09 22:09     ` Rafael J. Wysocki
  0 siblings, 0 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2009-09-09 22:09 UTC (permalink / raw)
  To: Dan Williams
  Cc: Magnus Damm, linux-kernel, gregkh, pavel, hskinnemoen, anemo,
	linux-usb, akpm, stern, ben-linux, linux-omap, linux-pm,
	felipe.balbi, nicolas.ferre, linux-next

On Wednesday 09 September 2009, Dan Williams wrote:
> 2009/7/4 Rafael J. Wysocki <rjw@sisk.pl>:
> > On Wednesday 24 June 2009, Magnus Damm wrote:
> >> pm: remove late/early platform driver pm callbacks V2
> >>
> >> [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
> >> [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
> >> [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
> >> [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
> >> [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
> >> [PATCH 06/07] usb: rework musb suspend()/resume_early()
> >> [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
> >>
> >> These patches simply remove ->suspend_late() and ->resume_early()
> >> from struct platform_driver. Drivers are converted to dev_pm_ops
> >> with CONFIG_SUSPEND in mind. Untested.
> >>
> >> All patches except [02/07] are known to compile.
> >>
> >> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> [..]
> >
> > The series is now in the linux-next branch of the suspend-2.6 tree.  I'll move
> > it into the for-linus branch, which is not rebased, if the patches are not
> > reported to cause any problems in the next few days.
> >
> 
> Hi,
> 
> My linux-next test builds for drivers/dma/ caught a missed conversion
> of the at_hdmac driver.  Please check the attached fix (compile tested
> only) and include it in this series.

Applied to suspend-2.6/linux-next, thanks.

Best,
Rafael

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

end of thread, other threads:[~2009-09-09 22:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24  9:23 [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Magnus Damm
2009-06-24  9:23 ` [PATCH 01/07] arm: rework omap suspend_late()/resume_early() Magnus Damm
2009-06-24  9:23 ` [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early() Magnus Damm
2009-06-24  9:23 ` [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2 Magnus Damm
2009-06-24  9:24 ` [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2 Magnus Damm
2009-06-24 16:02   ` Pavel Machek
     [not found] ` <20090624092306.14276.127.sendpatchset-/W6D1AVitZKvog7CDwlRTrNAH6kLmebB@public.gmane.org>
2009-06-24  9:23   ` [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early() Magnus Damm
2009-06-24  9:23   ` [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early() Magnus Damm
2009-06-24  9:24   ` [PATCH 06/07] usb: rework musb suspend()/resume_early() Magnus Damm
2009-06-24 20:34     ` Greg KH
2009-06-24 18:48   ` [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2 Rafael J. Wysocki
2009-06-24 18:56     ` Pavel Machek
     [not found]     ` <200906242048.40956.rjw-KKrjLPT3xs0@public.gmane.org>
2009-06-24 20:33       ` Greg KH
2009-07-04 23:45 ` Rafael J. Wysocki
2009-09-09  1:25   ` Dan Williams
2009-09-09 22:09     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox