rtc: bq32k: Fix handling of oscillator failure flag
authorJan Östlund <jao@hms.se>
Thu, 11 Aug 2016 11:31:44 +0000 (13:31 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 31 Aug 2016 16:21:35 +0000 (18:21 +0200)
commit421a5ba24b3ef23b8972a6c238bd300abef532da
tree0b620b64c90e540777d555411e0790d10f9ed6ed
parent6ed1a51e0b8a981ab0540117f0c47c1f11fca5fa
rtc: bq32k: Fix handling of oscillator failure flag

While the oscillator failure flag is set, the RTC registers
should be considered invalid. bq32k_rtc_read_time() now
returns an error instead of an invalid time.

The failure flag is cleared the next time the clock is set.

Signed-off-by: Jan Östlund <jao@hms.se>
Signed-off-by: Daniel Romell <daro@hms.se>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-bq32k.c