All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/04][RFC] PM: Runtime platform device PM
@ 2009-05-27 10:06 Magnus Damm
  2009-05-27 10:06 ` [PATCH 01/04] Driver Core: Add platform device arch data Magnus Damm
                   ` (33 more replies)
  0 siblings, 34 replies; 90+ messages in thread
From: Magnus Damm @ 2009-05-27 10:06 UTC (permalink / raw)
  To: linux-sh

PM: Runtime platform device power management

[PATCH 01/04] Driver Core: Add platform device arch data
[PATCH 02/04] Driver Core: Add idle and wakeup functions
[PATCH 03/04] PM: Add platform bus runtime dev_pm_ops
[PATCH 04/04] sh: Runtime platform device PM mockup

These patches extend platform device and driver interfaces to
allow architectures to implement platform device runtime pm.

Upstream runtime power management needs to be improved to fully
make use of hardware power saving features found on embedded
platforms and in common SoCs.

For runtime power management we today have cpuidle, the clock
framework and qos. This allows the cpu core to enter various
forms of deep sleep, and for devices we may stop clocks to save
power. Modern SoCs however allow disabling of power to parts of
the chip, and we have no upstream interface to handle that today.

I propose adding the following simple platform device functions:
 - platform_device_wakeup()
 - platform_device_idle()

The idle function is used by the platform driver to let the 
architecture power management code know that from now on the
device is in idle state. When the device is marked as idle
the architecture specific runtime power management may decide
to do various levels of device power management, ranging from
stopping clocks to turning off power. The dev_pm_ops callbacks
may be invoked by the runtime pm code to save and restore state
whenever the device is marked as idle.

The wakeup function is used by the platform driver to notify the
architecture code that the driver wants to make use of the hardware
device. If the device has been put in sleep then it needs to be
woken up. This wakeup call may invoke dev_pm_ops callbacks.

Have a look at the last patch for a SuperH mockup that shows how
it all fits together. We need this or a similar interface to be able
to enter deep sleep states on SuperH. I believe other architectures
have similar requirements.

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

 arch/Kconfig                               |    9 +
 arch/sh/Kconfig                            |    3 
 arch/sh/boards/mach-migor/setup.c          |    9 +
 arch/sh/include/asm/device.h               |    6 
 arch/sh/include/cpu-sh4/cpu/sh7722.h       |   14 ++
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c     |   31 ++++
 arch/sh/kernel/cpu/shmobile/pm.c           |  118 +++++++++++++++++
 drivers/base/platform.c                    |  193 +++++++++++++++++++++++++++-
 drivers/clocksource/sh_cmt.c               |    2 
 drivers/clocksource/sh_tmu.c               |    2 
 drivers/i2c/busses/i2c-sh_mobile.c         |    2 
 drivers/media/video/sh_mobile_ceu_camera.c |    2 
 drivers/video/sh_mobile_lcdcfb.c           |    4 
 include/linux/platform_device.h            |   21 +++
 14 files changed, 415 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 90+ messages in thread
* [PATCH 00/04][RFC] PM: Runtime platform device PM
@ 2009-05-27 10:06 Magnus Damm
  0 siblings, 0 replies; 90+ messages in thread
From: Magnus Damm @ 2009-05-27 10:06 UTC (permalink / raw)
  To: linux-pm; +Cc: paul, linux-sh, gregkh

PM: Runtime platform device power management

[PATCH 01/04] Driver Core: Add platform device arch data
[PATCH 02/04] Driver Core: Add idle and wakeup functions
[PATCH 03/04] PM: Add platform bus runtime dev_pm_ops
[PATCH 04/04] sh: Runtime platform device PM mockup

These patches extend platform device and driver interfaces to
allow architectures to implement platform device runtime pm.

Upstream runtime power management needs to be improved to fully
make use of hardware power saving features found on embedded
platforms and in common SoCs.

For runtime power management we today have cpuidle, the clock
framework and qos. This allows the cpu core to enter various
forms of deep sleep, and for devices we may stop clocks to save
power. Modern SoCs however allow disabling of power to parts of
the chip, and we have no upstream interface to handle that today.

I propose adding the following simple platform device functions:
 - platform_device_wakeup()
 - platform_device_idle()

The idle function is used by the platform driver to let the 
architecture power management code know that from now on the
device is in idle state. When the device is marked as idle
the architecture specific runtime power management may decide
to do various levels of device power management, ranging from
stopping clocks to turning off power. The dev_pm_ops callbacks
may be invoked by the runtime pm code to save and restore state
whenever the device is marked as idle.

The wakeup function is used by the platform driver to notify the
architecture code that the driver wants to make use of the hardware
device. If the device has been put in sleep then it needs to be
woken up. This wakeup call may invoke dev_pm_ops callbacks.

Have a look at the last patch for a SuperH mockup that shows how
it all fits together. We need this or a similar interface to be able
to enter deep sleep states on SuperH. I believe other architectures
have similar requirements.

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

 arch/Kconfig                               |    9 +
 arch/sh/Kconfig                            |    3 
 arch/sh/boards/mach-migor/setup.c          |    9 +
 arch/sh/include/asm/device.h               |    6 
 arch/sh/include/cpu-sh4/cpu/sh7722.h       |   14 ++
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c     |   31 ++++
 arch/sh/kernel/cpu/shmobile/pm.c           |  118 +++++++++++++++++
 drivers/base/platform.c                    |  193 +++++++++++++++++++++++++++-
 drivers/clocksource/sh_cmt.c               |    2 
 drivers/clocksource/sh_tmu.c               |    2 
 drivers/i2c/busses/i2c-sh_mobile.c         |    2 
 drivers/media/video/sh_mobile_ceu_camera.c |    2 
 drivers/video/sh_mobile_lcdcfb.c           |    4 
 include/linux/platform_device.h            |   21 +++
 14 files changed, 415 insertions(+), 1 deletion(-)

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

end of thread, other threads:[~2009-07-18 11:49 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 10:06 [PATCH 00/04][RFC] PM: Runtime platform device PM Magnus Damm
2009-05-27 10:06 ` [PATCH 01/04] Driver Core: Add platform device arch data Magnus Damm
2009-05-27 10:06 ` Magnus Damm
2009-05-28 21:26   ` Rafael J. Wysocki
2009-05-29  5:07     ` Magnus Damm
2009-05-28 21:26   ` Rafael J. Wysocki
2009-05-29  5:07   ` Magnus Damm
2009-05-29  5:51     ` Paul Mundt
2009-05-29  5:51   ` Paul Mundt
2009-05-27 10:06 ` [PATCH 02/04] Driver Core: Add idle and wakeup functions Magnus Damm
2009-05-28 21:29   ` Rafael J. Wysocki
2009-05-28 21:29   ` Rafael J. Wysocki
2009-05-29  5:10     ` Magnus Damm
2009-05-29  5:10   ` Magnus Damm
2009-06-03  9:05     ` Rafael J. Wysocki
2009-06-03  9:05   ` Rafael J. Wysocki
2009-06-05  3:26     ` Magnus Damm
2009-06-05  3:26   ` Magnus Damm
2009-06-05 20:42     ` Rafael J. Wysocki
2009-06-05 20:42   ` Rafael J. Wysocki
2009-06-09  4:22     ` Magnus Damm
2009-06-09  4:22   ` Magnus Damm
2009-06-09 23:41     ` Rafael J. Wysocki
2009-06-09 23:41   ` Rafael J. Wysocki
2009-06-10  6:03     ` Magnus Damm
2009-06-10  6:03   ` Magnus Damm
2009-06-10  8:19     ` Rafael J. Wysocki
2009-06-10  8:19   ` Rafael J. Wysocki
2009-05-27 10:06 ` Magnus Damm
2009-05-27 10:06 ` [PATCH 03/04] PM: Add platform bus runtime dev_pm_ops Magnus Damm
2009-05-29 23:23   ` Rafael J. Wysocki
2009-05-29 23:23   ` Rafael J. Wysocki
2009-06-02 13:37     ` Magnus Damm
2009-06-02 13:37   ` Magnus Damm
2009-06-03  9:47     ` Rafael J. Wysocki
2009-06-05 10:40       ` Magnus Damm
2009-06-05 10:40   ` Magnus Damm
2009-06-05 21:24     ` Rafael J. Wysocki
2009-06-05 21:24   ` Rafael J. Wysocki
2009-05-27 10:06 ` Magnus Damm
2009-05-27 10:06 ` [PATCH 04/04] sh: Runtime platform device PM mockup Magnus Damm
2009-05-27 12:10 ` [PATCH 00/04][RFC] PM: Runtime platform device PM Mark Brown
2009-05-27 12:10 ` [linux-pm] " Mark Brown
2009-05-28  6:02   ` Magnus Damm
2009-05-27 14:30 ` Alan Stern
2009-05-27 14:30 ` Alan Stern
2009-05-28  6:14   ` Magnus Damm
2009-05-28  0:32 ` Kevin Hilman
2009-05-28  0:32 ` Kevin Hilman
2009-05-28  6:02 ` [linux-pm] " Magnus Damm
2009-05-28  6:14 ` Magnus Damm
2009-05-28  7:12   ` Rafael J. Wysocki
2009-05-28 15:33   ` Alan Stern
2009-05-28  7:12 ` Rafael J. Wysocki
2009-05-28 15:28   ` Alan Stern
2009-05-28 15:28 ` Alan Stern
2009-06-01 19:04   ` Rafael J. Wysocki
2009-05-28 15:33 ` Alan Stern
2009-05-29  7:41   ` Magnus Damm
2009-05-28 17:14 ` Kevin Hilman
2009-05-29  9:17   ` Magnus Damm
2009-05-28 17:14 ` Kevin Hilman
2009-05-29  7:41 ` Magnus Damm
2009-05-29 13:45   ` Alan Stern
2009-05-29 13:45     ` Alan Stern
2009-05-29 18:18     ` Rafael J. Wysocki
2009-05-29  9:17 ` Magnus Damm
2009-06-02 21:37   ` Pavel Machek
2009-05-29 18:18 ` Rafael J. Wysocki
2009-06-02 13:44   ` Magnus Damm
2009-06-01 19:04 ` Rafael J. Wysocki
2009-06-01 19:31   ` Alan Stern
2009-06-01 19:31 ` Alan Stern
2009-06-01 19:58   ` Rafael J. Wysocki
2009-06-01 19:58 ` Rafael J. Wysocki
2009-06-01 22:16   ` Alan Stern
2009-06-01 22:16 ` Alan Stern
2009-06-01 23:21   ` Rafael J. Wysocki
2009-06-01 23:21 ` Rafael J. Wysocki
2009-06-02 14:51   ` Alan Stern
2009-06-02 13:44 ` Magnus Damm
2009-06-02 14:51 ` Alan Stern
2009-06-04 16:30   ` Rafael J. Wysocki
2009-06-02 21:37 ` [linux-pm] " Pavel Machek
2009-06-04 10:03   ` Magnus Damm
2009-06-04 10:03 ` [linux-pm] " Magnus Damm
2009-06-04 16:30 ` Rafael J. Wysocki
2009-07-18 11:49   ` Pavel Machek
2009-07-18 11:49 ` [linux-pm] " Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2009-05-27 10:06 Magnus Damm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.