alistair23-linux/drivers
Stephen Warren 75ea799df4 rtc: max8907: weekday encoding fixes
The current MAX8907 driver has two issues related to weekday value
handling:

1)

The HW WEEKDAY register has range 0..6 rather than 1..7 as documented.
Note that I validated the actual HW range by observing the HW register
roll from 6->0 rather than 6->7->1 as would otherwise be expected.

This matches Linux's tm_wday range of 0..6.

When the CMOS RAM content is lost, the date returned from the device is
2007-01-01 00:00:00, which is a Monday.  The WEEKDAY register reads 1 in
this case.  This matches the numbering in Linux's tm_wday field.

Hence we should write Linux's tm_wday value to the register without
modifying it.  Hence, remove the +1/-1 calculations for WEEKDAY/tm_wday.

2)

There's no need to make alarms match on the WEEKDAY register, since the
other fields together uniquely define the alarm date/time.  Ignoring the
WEEKDAY value in the match isolates the driver from any incorrect value in
the current time copy of the WEEKDAY register.

Each change individually, or both together, solves an issue that I
observed; "hwclock -r" would time out waiting for its alarm to fire if the
CMOS RAM content had been lost, and hence the WEEKDAY register value
mismatched what the driver expected it to be.  "hwclock -w" would solve
this by over-writing the HW default WEEKDAY register value with what the
driver expected.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-23 16:37:00 -08:00
..
accessibility
acpi PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
amba
ata PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
atm
auxdisplay
base Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
bcma
block drivers/block/Kconfig: update RAM block device module name 2014-01-23 16:36:53 -08:00
bluetooth
bus
cdrom
char Features: 2014-01-22 22:00:18 -08:00
clk Merge branch 'for-next' into for-linus 2014-01-20 10:20:14 +01:00
clocksource Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-01-20 11:34:26 -08:00
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma Merge branch 'for-next' into for-linus 2014-01-20 10:20:14 +01:00
edac Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-01-20 12:10:27 -08:00
eisa Revert "EISA: Initialize device before its resources" 2014-01-17 14:57:29 -07:00
extcon
firewire
firmware firmware/dmi_scan: generalize for use by other archs 2014-01-23 16:36:57 -08:00
fmc
gpio MFD changes due for the v3.14 merge window 2014-01-21 10:58:17 -08:00
gpu drivers/gpu/drm/gma500/backlight.c: fix a defined-but-not-used warning for do_gma_backlight_set() 2014-01-23 16:36:55 -08:00
hid Merge branches 'for-3.13/upstream-fixes', 'for-3.14/i2c-hid', 'for-3.14/sensor-hub', 'for-3.14/sony' and 'for-3.14/upstream' into for-linus 2014-01-22 15:40:14 +01:00
hsi
hv
hwmon hwmon: (k10temp) Add support for Kaveri CPUs 2014-01-14 21:36:54 -08:00
hwspinlock
i2c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
ide
idle Merge branch 'x86/idle' into sched/core 2014-01-13 17:37:05 +01:00
iio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
infiniband
input Features: 2014-01-22 22:00:18 -08:00
iommu intel-iommu: fix off-by-one in pagetable freeing 2014-01-21 16:19:41 -08:00
ipack
irqchip
isdn Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
leds Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
lguest
macintosh Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2014-01-20 09:24:31 -08:00
mailbox drivers/mailbox/omap: make mbox->irq signed for error handling 2014-01-23 16:36:53 -08:00
md A set of device-mapper changes for 3.14. 2014-01-22 20:17:48 -08:00
media
memory
memstick
message MPT / PCI: Use pci_stop_and_remove_bus_device_locked() 2014-01-14 12:14:25 -07:00
mfd drivers/mfd/tps65217.c: fix pointer-integer size mismatch warning in tps65217_probe() 2014-01-23 16:36:55 -08:00
misc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
mmc ARM: s3c24xx: explicit dependency on <plat/gpio-cfg.h> 2014-01-14 15:24:54 +01:00
mtd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
net Features: 2014-01-22 22:00:18 -08:00
nfc
ntb
nubus
of of/Kconfig: Spelling s/one/once/ 2014-01-10 15:30:15 +01:00
oprofile
parisc
parport TTY/Serial driver patches for 3.14-rc1 2014-01-20 16:05:23 -08:00
pci Features: 2014-01-22 22:00:18 -08:00
pcmcia PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
phy USB patches for 3.14-rc1 2014-01-20 16:13:02 -08:00
pinctrl MFD changes due for the v3.14 merge window 2014-01-21 10:58:17 -08:00
platform PCI changes for the v3.14 merge window: 2014-01-22 16:39:28 -08:00
pnp
power
powercap
pps
ps3
ptp
pwm pwm: Add LP3943 PWM driver 2014-01-21 08:28:00 +00:00
rapidio
regulator mfd: mc13xxx: Remove useless symbol MFD_MC13783 2014-01-21 08:28:09 +00:00
remoteproc
reset
rpmsg
rtc rtc: max8907: weekday encoding fixes 2014-01-23 16:37:00 -08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-01-20 09:23:31 -08:00
sbus
scsi A few simple fixes. Quiet cycle. 2014-01-22 22:24:35 -08:00
sfi
sh
sn
spi
ssb
staging Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
target
tc
thermal Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
tty Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
uio
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
uwb
vfio vfio-pci: Use pci "try" reset interface 2014-01-15 10:43:17 -07:00
vhost
video backlight: lp8788: remove unnecessary parentheses 2014-01-23 16:36:57 -08:00
virt
virtio A few simple fixes. Quiet cycle. 2014-01-22 22:24:35 -08:00
vlynq drivers/vlynq/vlynq.c: fix another resource size off by 1 error 2014-01-23 16:36:55 -08:00
vme
w1
watchdog
xen Features: 2014-01-22 22:00:18 -08:00
zorro
Kconfig
Makefile