linux-stable/drivers
Anton Vorontsov 26b3c01f7d rtc: set wakeup capability for I2C and SPI RTC drivers
RTC core won't allow wakeup alarms to be set if RTC devices' parent (i.e.
i2c_client or spi_device) isn't wakeup capable.

For I2C devices there is I2C_CLIENT_WAKE flag exists that we can pass via
board info, and if set, I2C core will initialize wakeup capability.  For
SPI devices there is no such flag at all.

I believe that it's not platform code responsibility to allow or disallow
wakeups, instead, drivers themselves should set the capability if a device
can trigger wakeups.

That's what drivers/base/power/sysfs.c says:

 * It is the responsibility of device drivers to enable (or disable)
 * wakeup signaling as part of changing device power states, respecting
 * the policy choices provided through the driver model.

I2C and SPI RTC devices send wakeup events via interrupt lines, so we
should set the wakeup capability if IRQ is routed.

Ideally we should also check irq for wakeup capability before setting
device's capability, i.e.

	if (can_irq_wake(irq))
		device_set_wakeup_capable(&client->dev, 1);

But there is no can_irq_wake() call exist, and it is not that trivial to
implement it for all interrupts controllers and complex/cascaded setups.

drivers/base/power/sysfs.c also covers these cases:

 * Devices may not be able to generate wakeup events from all power
 * states.  Also, the events may be ignored in some configurations;
 * for example, they might need help from other devices that aren't
 * active

So there is no guarantee that wakeup will actually work, and so I think
there is no point in being pedantic wrt checking IRQ wakeup capability.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-17 15:45:32 -08:00
..
accessibility drop explicit include of autoconf.h 2009-12-12 13:08:15 +01:00
acpi Merge branch 'misc-2.6.33' into release 2009-12-16 14:22:32 -05:00
amba
ata Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2009-12-12 14:27:24 -08:00
atm drivers/atm: Correct code taking the size of a pointer 2009-12-13 19:56:33 -08:00
auxdisplay
base Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6 2009-12-16 12:36:49 -08:00
block Merge branch 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block 2009-12-15 09:11:28 -08:00
bluetooth USB: remove the auto_pm flag 2009-12-11 11:55:21 -08:00
cdrom
char Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2009-12-16 12:33:19 -08:00
clocksource cs5535: add a generic clock event MFGPT driver 2009-12-15 08:53:28 -08:00
connector
cpufreq Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
cpuidle drivers/cpuidle: Move dereference after NULL test 2009-12-15 08:53:25 -08:00
crypto Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
dca
dio
dma Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2009-12-16 10:28:56 -08:00
edac Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp 2009-12-16 10:09:43 -08:00
eisa
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2009-12-11 15:22:27 -08:00
firmware firmware: only allow EDD on x86 2009-12-15 08:53:34 -08:00
gpio gpiolib: add support for changing value polarity in sysfs 2009-12-16 07:20:01 -08:00
gpu Merge branch 'drm-vmware-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2009-12-16 13:19:31 -08:00
hid drop explicit include of autoconf.h 2009-12-12 13:08:15 +01:00
hwmon hwmon: I2C bus support for lis3lv02d and variant accelerometer chips 2009-12-17 15:45:30 -08:00
i2c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
ide Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2009-12-12 14:27:24 -08:00
idle
ieee1394
ieee802154
infiniband Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-12-16 12:04:02 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2009-12-16 10:31:44 -08:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2009-12-14 12:33:02 -08:00
leds tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
lguest Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2009-12-12 14:27:24 -08:00
mca
md Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm 2009-12-15 09:12:01 -08:00
media V4L/DVB (13698): pms: replace asm/uaccess.h to linux/uaccess.h 2009-12-16 09:28:01 -02:00
memstick
message
mfd mfd: compile fix for twl4030 renaming 2009-12-15 09:33:36 -08:00
misc cs5535: CS5535_MFGPT_DEFAULT_IRQ should depend on CS5535_MFGPT 2009-12-17 15:45:30 -08:00
mmc sdhci-of: add support for the wii sdhci controller 2009-12-17 15:45:32 -08:00
mtd Merge git://git.infradead.org/mtd-2.6 2009-12-16 10:23:43 -08:00
net Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
nubus
of
oprofile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
parisc parisc: Fixup last users of irq_chip->typename 2009-12-16 03:48:56 +00:00
parport parport_pc.c: use correct length in strncmp 2009-12-16 07:20:12 -08:00
pci Merge git://git.infradead.org/iommu-2.6 2009-12-16 10:11:38 -08:00
pcmcia const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
platform Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
pnp Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2009-12-16 12:33:19 -08:00
power Merge git://git.infradead.org/battery-2.6 2009-12-15 08:59:33 -08:00
pps
ps3
rapidio
regulator regulator: wm831x_reg_read() failure unnoticed in wm831x_aldo_get_mode() 2009-12-17 10:27:30 +00:00
rtc rtc: set wakeup capability for I2C and SPI RTC drivers 2009-12-17 15:45:32 -08:00
s390 tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
sbus
scsi Subject: Re: [PATCH] strstrip incorrectly marked __must_check 2009-12-15 08:53:34 -08:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2009-12-16 10:29:52 -08:00
sfi
sh
sn ioc3/ioc4: fix error path on driver registration 2009-12-15 08:53:27 -08:00
spi const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
ssb
staging Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
tc
telephony
thermal Merge branch 'misc-2.6.33' into release 2009-12-16 14:22:32 -05:00
uio const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
usb isp1362-hcd: use bitmap_find_next_zero_area 2009-12-16 07:20:18 -08:00
uwb
video drivers/video/via/viafbdev.c: correct code taking the size of a pointer 2009-12-17 15:45:30 -08:00
virtio
vlynq
w1
watchdog const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
xen Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-12-11 12:18:16 -08:00
zorro
Kconfig cs5535: add a generic clock event MFGPT driver 2009-12-15 08:53:28 -08:00
Makefile