kernel-fxtec-pro1x/drivers
Rafael J. Wysocki 9659cc0678 PM: Make system-wide PM and runtime PM treat subsystems consistently
The code handling system-wide power transitions (eg. suspend-to-RAM)
can in theory execute callbacks provided by the device's bus type,
device type and class in each phase of the power transition.  In
turn, the runtime PM core code only calls one of those callbacks at
a time, preferring bus type callbacks to device type or class
callbacks and device type callbacks to class callbacks.

It seems reasonable to make them both behave in the same way in that
respect.  Moreover, even though a device may belong to two subsystems
(eg. bus type and device class) simultaneously, in practice power
management callbacks for system-wide power transitions are always
provided by only one of them (ie. if the bus type callbacks are
defined, the device class ones are not and vice versa).  Thus it is
possible to modify the code handling system-wide power transitions
so that it follows the core runtime PM code (ie. treats the
subsystem callbacks as mutually exclusive).

On the other hand, the core runtime PM code will choose to execute,
for example, a runtime suspend callback provided by the device type
even if the bus type's struct dev_pm_ops object exists, but the
runtime_suspend pointer in it happens to be NULL.  This is confusing,
because it may lead to the execution of callbacks from different
subsystems during different operations (eg. the bus type suspend
callback may be executed during runtime suspend of the device, while
the device type callback will be executed during system suspend).

Make all of the power management code treat subsystem callbacks in
a consistent way, such that:
(1) If the device's type is defined (eg. dev->type is not NULL)
    and its pm pointer is not NULL, the callbacks from dev->type->pm
    will be used.
(2) If dev->type is NULL or dev->type->pm is NULL, but the device's
    class is defined (eg. dev->class is not NULL) and its pm pointer
    is not NULL, the callbacks from dev->class->pm will be used.
(3) If dev->type is NULL or dev->type->pm is NULL and dev->class is
    NULL or dev->class->pm is NULL, the callbacks from dev->bus->pm
    will be used provided that both dev->bus and dev->bus->pm are
    not NULL.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Kevin Hilman <khilman@ti.com>
Reasoning-sounds-sane-to: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-15 00:43:17 +01:00
..
accessibility
acpi PM: Drop pm_flags that is not necessary 2011-03-15 00:43:16 +01:00
amba
ata
atm
auxdisplay
base PM: Make system-wide PM and runtime PM treat subsystems consistently 2011-03-15 00:43:17 +01:00
block block: kill loop_mutex 2011-03-03 11:53:25 -05:00
bluetooth Revert "Bluetooth: Enable USB autosuspend by default on btusb" 2011-02-23 19:42:03 -08:00
cdrom
char ipmi: Fix IPMI errors due to timing problems 2011-03-10 13:21:16 -08:00
clk
clocksource
connector
cpufreq [CPUFREQ] fix BUG on cpufreq policy init failure 2011-03-01 18:49:44 -05:00
cpuidle
crypto
dca
dio
dma
edac
eisa
firewire
firmware
gpio gpio: add MODULE_DEVICE_TABLE 2011-03-13 15:35:59 -07:00
gpu drm/radeon: fix problem with changing active VRAM size. (v2) 2011-03-14 12:51:04 +10:00
hid
hwmon hwmon/f71882fg: Set platform drvdata to NULL later 2011-03-13 07:42:52 -07:00
i2c i2c-eg20t: include slab.h for memory allocations 2011-03-08 23:13:30 +00:00
ide
idle intel_idle: disable Atom/Lincroft HW C-state auto-demotion 2011-02-17 17:08:48 -05:00
ieee802154
infiniband Merge branches 'nes' and 'qib' into for-next 2011-02-17 14:04:59 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2011-02-23 14:44:25 -08:00
isdn drivers:isdn:istream.c Fix typo pice to piece 2011-02-28 12:07:32 -08:00
leds
lguest
macintosh
mca
md md: Fix - again - partition detection when array becomes active 2011-02-24 17:26:41 +11:00
media Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-03-10 13:22:10 -08:00
memstick workqueue, freezer: unify spelling of 'freeze' + 'able' to 'freezable' 2011-02-16 17:48:59 +01:00
message
mfd mfd: Avoid tps6586x burst writes 2011-03-02 10:57:50 +01:00
misc drivers/misc/bmp085.c: add MODULE_DEVICE_TABLE 2011-03-04 17:53:38 -08:00
mmc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc 2011-03-09 14:00:44 -08:00
mtd Merge git://git.infradead.org/users/dwmw2/mtd-2.6.38 2011-03-13 15:56:22 -07:00
net PM: Remove CONFIG_PM_OPS 2011-03-15 00:43:15 +01:00
nfc drivers/nfc/pn544.c: add missing regulator 2011-02-25 15:07:36 -08:00
nubus
of of/promtree: allow DT device matching by fixing 'name' brokenness (v5) 2011-03-02 13:45:19 -07:00
oprofile
parisc
parport
pci PM: Remove CONFIG_PM_OPS 2011-03-15 00:43:15 +01:00
pcmcia Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm 2011-03-07 20:45:42 -08:00
platform dell-laptop: Toggle the unsupported hardware killswitch 2011-02-21 17:06:21 -05:00
pnp
power
pps pps: make pps_gen_parport depend on BROKEN 2011-03-04 17:53:38 -08:00
ps3
rapidio rapidio: fix sysfs config attribute to access 16MB of maint space 2011-02-25 15:07:37 -08:00
regulator regulator, mc13xxx: Remove pointless test for unsigned less than zero 2011-02-25 08:51:07 +00:00
rtc drivers/rtc/rtc-s3c.c: fix prototype for s3c_rtc_setaie() 2011-03-04 17:53:38 -08:00
s390 [S390] tape: deadlock on system work queue 2011-03-03 17:56:14 +01:00
sbus
scsi PM: Remove CONFIG_PM_OPS 2011-03-15 00:43:15 +01:00
sfi
sh
sn
spi
ssb
staging
target [SCSI] target: Fix t_transport_aborted handling in LUN_RESET + active I/O shutdown 2011-02-28 11:23:32 -06:00
tc
telephony
thermal ACPI: Fix build for CONFIG_NET unset 2011-02-28 18:00:31 -08:00
tty fmvj18x_cs: add new id 2011-02-28 12:06:20 -08:00
uio
usb PM: Remove CONFIG_PM_OPS 2011-03-15 00:43:15 +01:00
uwb
vhost
video drivers/video/backlight/ltv350qv.c: fix a memory leak 2011-03-04 17:53:38 -08:00
virtio
vlynq
w1
watchdog watchdog: hpwdt: eliminate section mismatch warning 2011-03-14 10:44:31 +00:00
xen xen: suspend and resume system devices when running PVHVM 2011-02-17 10:31:20 +00:00
zorro
Kconfig
Makefile