* [patch/UPDATE 2.6.18-rc5-mm] PM: platform_bus and late_suspend/early_resume
@ 2006-09-03 20:16 David Brownell
2006-09-06 21:55 ` patch pm-platform_bus-and-late_suspend-early_resume.patch added to gregkh-2.6 tree gregkh
0 siblings, 1 reply; 2+ messages in thread
From: David Brownell @ 2006-09-03 20:16 UTC (permalink / raw)
To: Greg KH; +Cc: Linus Torvalds, Linux-pm mailing list
Teach platform_bus about the new suspend_late/resume_early PM calls,
issued with IRQs off. Do we really need sysdev and friends any more,
or can janitors start switching its users over to platform_device so
we can do a minor code-ectomy?
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
bugfixed from previous version: platform_bus didn't assign the
intended methods.
Index: g26/drivers/base/platform.c
===================================================================
--- g26.orig/drivers/base/platform.c 2006-06-28 22:02:04.000000000 -0700
+++ g26/drivers/base/platform.c 2006-08-31 19:36:07.000000000 -0700
@@ -505,12 +505,36 @@ static int platform_match(struct device
return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
}
-static int platform_suspend(struct device * dev, pm_message_t state)
+static int platform_suspend(struct device *dev, pm_message_t mesg)
{
int ret = 0;
if (dev->driver && dev->driver->suspend)
- ret = dev->driver->suspend(dev, state);
+ ret = dev->driver->suspend(dev, mesg);
+
+ return ret;
+}
+
+static int platform_suspend_late(struct device *dev, pm_message_t mesg)
+{
+ struct platform_driver *drv = to_platform_driver(dev->driver);
+ struct platform_device *pdev = container_of(dev, struct platform_device, dev);
+ int ret = 0;
+
+ if (dev->driver && drv->suspend_late)
+ ret = drv->suspend_late(pdev, mesg);
+
+ return ret;
+}
+
+static int platform_resume_early(struct device *dev)
+{
+ struct platform_driver *drv = to_platform_driver(dev->driver);
+ struct platform_device *pdev = container_of(dev, struct platform_device, dev);
+ int ret = 0;
+
+ if (dev->driver && drv->resume_early)
+ ret = drv->resume_early(pdev);
return ret;
}
@@ -531,6 +555,8 @@ struct bus_type platform_bus_type = {
.match = platform_match,
.uevent = platform_uevent,
.suspend = platform_suspend,
+ .suspend_late = platform_suspend_late,
+ .resume_early = platform_resume_early,
.resume = platform_resume,
};
EXPORT_SYMBOL_GPL(platform_bus_type);
Index: g26/include/linux/platform_device.h
===================================================================
--- g26.orig/include/linux/platform_device.h 2006-08-31 19:30:33.000000000 -0700
+++ g26/include/linux/platform_device.h 2006-08-31 19:30:46.000000000 -0700
@@ -49,6 +49,8 @@ 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;
};
^ permalink raw reply [flat|nested] 2+ messages in thread* patch pm-platform_bus-and-late_suspend-early_resume.patch added to gregkh-2.6 tree
2006-09-03 20:16 [patch/UPDATE 2.6.18-rc5-mm] PM: platform_bus and late_suspend/early_resume David Brownell
@ 2006-09-06 21:55 ` gregkh
0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2006-09-06 21:55 UTC (permalink / raw)
To: david-b, dbrownell, greg, gregkh, linux-pm, torvalds
This is a note to let you know that I've just added the patch titled
Subject: PM: platform_bus and late_suspend/early_resume
to my gregkh-2.6 tree. Its filename is
pm-platform_bus-and-late_suspend-early_resume.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From david-b@pacbell.net Sun Sep 3 13:17:24 2006
From: David Brownell <david-b@pacbell.net>
To: Greg KH <greg@kroah.com>
Subject: PM: platform_bus and late_suspend/early_resume
Date: Sun, 3 Sep 2006 13:16:45 -0700
Cc: "Linux-pm mailing list" <linux-pm@lists.osdl.org>, Linus Torvalds <torvalds@osdl.org>
Content-Disposition: inline
Message-Id: <200609031316.45905.david-b@pacbell.net>
Teach platform_bus about the new suspend_late/resume_early PM calls,
issued with IRQs off. Do we really need sysdev and friends any more,
or can janitors start switching its users over to platform_device so
we can do a minor code-ectomy?
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/platform.c | 30 ++++++++++++++++++++++++++++--
include/linux/platform_device.h | 2 ++
2 files changed, 30 insertions(+), 2 deletions(-)
--- gregkh-2.6.orig/drivers/base/platform.c
+++ gregkh-2.6/drivers/base/platform.c
@@ -505,12 +505,36 @@ static int platform_match(struct device
return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
}
-static int platform_suspend(struct device * dev, pm_message_t state)
+static int platform_suspend(struct device *dev, pm_message_t mesg)
{
int ret = 0;
if (dev->driver && dev->driver->suspend)
- ret = dev->driver->suspend(dev, state);
+ ret = dev->driver->suspend(dev, mesg);
+
+ return ret;
+}
+
+static int platform_suspend_late(struct device *dev, pm_message_t mesg)
+{
+ struct platform_driver *drv = to_platform_driver(dev->driver);
+ struct platform_device *pdev = container_of(dev, struct platform_device, dev);
+ int ret = 0;
+
+ if (dev->driver && drv->suspend_late)
+ ret = drv->suspend_late(pdev, mesg);
+
+ return ret;
+}
+
+static int platform_resume_early(struct device *dev)
+{
+ struct platform_driver *drv = to_platform_driver(dev->driver);
+ struct platform_device *pdev = container_of(dev, struct platform_device, dev);
+ int ret = 0;
+
+ if (dev->driver && drv->resume_early)
+ ret = drv->resume_early(pdev);
return ret;
}
@@ -531,6 +555,8 @@ struct bus_type platform_bus_type = {
.match = platform_match,
.uevent = platform_uevent,
.suspend = platform_suspend,
+ .suspend_late = platform_suspend_late,
+ .resume_early = platform_resume_early,
.resume = platform_resume,
};
EXPORT_SYMBOL_GPL(platform_bus_type);
--- gregkh-2.6.orig/include/linux/platform_device.h
+++ gregkh-2.6/include/linux/platform_device.h
@@ -49,6 +49,8 @@ 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;
};
Patches currently in gregkh-2.6 which might be from david-b@pacbell.net are
driver/pm-define-pm_event_prethaw.patch
driver/suspend-infrastructure-cleanup-and-extension.patch
driver/suspend-pci.patch
driver/pm-issue-pm_event_prethaw.patch
driver/pm-pci-and-ide-handle-pm_event_prethaw.patch
driver/pm-usb-hcds-use-pm_event_prethaw.patch
driver/pm-video-drivers-and-pm_event_prethaw.patch
driver/updated-documentation-power-devices.txt.patch
driver/make-suspend-quieter.patch
driver/fix-broken-dubious-driver-suspend-methods.patch
driver/pm-add-kconfig-option-for-deprecated-...-power-state-files.patch
driver/pm-no-suspend_prepare-phase.patch
driver/pm-schedule-sys-devices-...-power-state-for-removal.patch
driver/pm-update-docs-for-writing-...-power-state.patch
driver/pm-platform_bus-and-late_suspend-early_resume.patch
i2c/i2c-algos-constify-i2c_algorithm.patch
i2c/i2c-busses-constify-i2c_algorithm.patch
i2c/i2c-constify-i2c_algorithm.patch
usb/usb-ohci-avoids-root-hub-timer-polling.patch
usb/usb-asix-add-ax88178-support-and-many-other-changes.patch
usb/usb-usbnet-add-unlink_rx_urbs-call-to-allow-for-jumbo-frames.patch
usb/usb-allow-compile-in-g_ether-fix-typo.patch
usb/usbcore-make-hcd_endpoint_disable-wait-for-queue-to-drain.patch
usb/usb-move-linux-usb_otg.h-to-linux-usb-otg.h.patch
usb/usb-ohci-controller-support-for-pnx4008.patch
usb/usb-pxa2xx_udc-understands-gpio-based-vbus-sensing.patch
usb/usb-ehci-whitespace-fixes.patch
usb/usb-build-fixes-ohci-omap.patch
usb/usb-correct-locking-in-gadgetfs_disconnect.patch
usb/usb-fix-ep_config-to-return-correct-value.patch
usb/usb-gadgetfs-protect-ep_release-with-lock.patch
usb/usb-gmidi-new-usb-midi-gadget-class-driver.patch
usb/usb-add-poll-to-gadgetfs-s-endpoint-zero.patch
usb/usb-gadget-gadgetfs-dont-try-to-lock-before-free.patch
usb/usb-net1080-inherent-pad-length.patch
usb/usb-properly-unregister-reboot-notifier-in-case-of-failure-in-ehci-hcd.patch
usb/wusb-hub-recognizes-wusb-ports.patch
usb/wusb-handle-wusb-device-ep0-speed-settings.patch
usb/wusb-pretty-print-new-devices.patch
usb/usb-deal-with-broken-config-descriptors.patch
usb/usb-fix-signedness-issue-in-drivers-usb-gadget-ether.c.patch
usb/usb-ethernet-gadget-avoids-zlps-for-musb_hdrc.patch
usb/gadgetfs-patch-for-ep0out.patch
usb/usb-ohci-at91-two-one-liners.patch
usb/usb-net2280-update-dma-buffer-allocation.patch
usb/usb-usb-serial-gadget-smp-related-bug.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-06 21:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-03 20:16 [patch/UPDATE 2.6.18-rc5-mm] PM: platform_bus and late_suspend/early_resume David Brownell
2006-09-06 21:55 ` patch pm-platform_bus-and-late_suspend-early_resume.patch added to gregkh-2.6 tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox