Skip to content

Commit

Permalink
drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Edgar Toernig <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tonyprisk authored and torvalds committed Jan 5, 2013
1 parent dc59ed3 commit 532db57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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 */
Expand Down Expand Up @@ -247,7 +247,7 @@ static int 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,
Expand Down

0 comments on commit 532db57

Please sign in to comment.