Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348298
b: refs/heads/master
c: 2f90b68
h: refs/heads/master
v: v3
  • Loading branch information
Tony Prisk authored and Linus Torvalds committed Jan 5, 2013
1 parent a2e7d3c commit 7dad07e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 532db570e5181abc8f4f7bfa6c77c69ec2240198
refs/heads/master: 2f90b68309683f2c5765a1b04ca23d71e51f1494
7 changes: 4 additions & 3 deletions trunk/drivers/rtc/rtc-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int vt8500_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S);
tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S);
tm->tm_mday = bcd2bin(date & DATE_DAY_MASK);
tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S);
tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1;
tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S)
+ ((date >> DATE_CENTURY_S) & 1 ? 200 : 100);
tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S;
Expand All @@ -138,8 +138,9 @@ static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm)
}

writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S)
| (bin2bcd(tm->tm_mon) << DATE_MONTH_S)
| (bin2bcd(tm->tm_mday)),
| (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S)
| (bin2bcd(tm->tm_mday))
| ((tm->tm_year >= 200) << DATE_CENTURY_S),
vt8500_rtc->regbase + VT8500_RTC_DS);
writel((bin2bcd(tm->tm_wday) << TIME_DOW_S)
| (bin2bcd(tm->tm_hour) << TIME_HOUR_S)
Expand Down

0 comments on commit 7dad07e

Please sign in to comment.