Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319950
b: refs/heads/master
c: 064407f
h: refs/heads/master
v: v3
  • Loading branch information
Bengt Jonsson authored and Linus Torvalds committed Jul 31, 2012
1 parent 75edd1e commit 3642885
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 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: dc43d4a26b808240410ce3ea1c72a8047f90d1d8
refs/heads/master: 064407f1c0d54ad215927b4c14b3f4e68fa486f4
27 changes: 11 additions & 16 deletions trunk/drivers/rtc/rtc-ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,17 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm)
if (retval < 0)
return retval;

/* Early AB8500 chips will not clear the rtc read request bit */
if (abx500_get_chip_id(dev) == 0) {
usleep_range(1000, 1000);
} else {
/* Wait for some cycles after enabling the rtc read in ab8500 */
while (time_before(jiffies, timeout)) {
retval = abx500_get_register_interruptible(dev,
AB8500_RTC, AB8500_RTC_READ_REQ_REG, &value);
if (retval < 0)
return retval;

if (!(value & RTC_READ_REQUEST))
break;

usleep_range(1000, 5000);
}
/* Wait for some cycles after enabling the rtc read in ab8500 */
while (time_before(jiffies, timeout)) {
retval = abx500_get_register_interruptible(dev,
AB8500_RTC, AB8500_RTC_READ_REQ_REG, &value);
if (retval < 0)
return retval;

if (!(value & RTC_READ_REQUEST))
break;

usleep_range(1000, 5000);
}

/* Read the Watchtime registers */
Expand Down

0 comments on commit 3642885

Please sign in to comment.