]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
authorTony Prisk <linux@prisktech.co.nz>
Fri, 4 Jan 2013 23:35:47 +0000 (15:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Jan 2013 17:03:49 +0000 (09:03 -0800)
commit 532db570e5181abc8f4f7bfa6c77c69ec2240198 upstream.

Control register bitfield for 12H/24H mode is handled incorrectly.
Setting CR_24H actually enables 12H mode.  This patch renames the define
and changes the initialization code to correctly set 24H mode.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Cc: Edgar Toernig <froese@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-vt8500.c

index efd6066b5cd25d3911bd626919ba9f683cf1b3e8..2e27e73a66a0d423de198c5d0930cbff94d13436 100644 (file)
@@ -69,7 +69,7 @@
                                | ALARM_SEC_BIT)
 
 #define VT8500_RTC_CR_ENABLE   (1 << 0)        /* Enable RTC */
-#define VT8500_RTC_CR_24H      (1 << 1)        /* 24h time format */
+#define VT8500_RTC_CR_12H      (1 << 1)        /* 12h time format */
 #define VT8500_RTC_CR_SM_ENABLE        (1 << 2)        /* Enable periodic irqs */
 #define VT8500_RTC_CR_SM_SEC   (1 << 3)        /* 0: 1Hz/60, 1: 1Hz */
 #define VT8500_RTC_CR_CALIB    (1 << 4)        /* Enable calibration */
@@ -246,7 +246,7 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
        }
 
        /* Enable RTC and set it to 24-hour mode */
-       writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H,
+       writel(VT8500_RTC_CR_ENABLE,
               vt8500_rtc->regbase + VT8500_RTC_CR);
 
        vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,