[2/4] rtc: rtc-rs5c372: fixed check for 'oscillator halted' condition

Submitted by thomas.koeller@baslerweb.com on June 2, 2010, 1:53 p.m.

Details

Message ID 1275486787-30406-3-git-send-email-thomas.koeller@baslerweb.com
State Accepted
Headers show

Commit Message

thomas.koeller@baslerweb.com June 2, 2010, 1:53 p.m.
From: Thomas Koeller <thomas.koeller@baslerweb.com>

The R2025SD chip, according to its data sheet, sets the /XST
bit to zero if the oscillator stops. Hence the check for this
condition was wrong.

Signed-off-by: Thomas Koeller <thomas.koeller@baslerweb.com>
---
 drivers/rtc/rtc-rs5c372.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Alexandre Belloni May 3, 2016, 2:23 p.m.
On 02/06/2010 at 15:53:05 +0200, thomas.koeller@baslerweb.com wrote :
> From: Thomas Koeller <thomas.koeller@baslerweb.com>
> 
> The R2025SD chip, according to its data sheet, sets the /XST
> bit to zero if the oscillator stops. Hence the check for this
> condition was wrong.
> 
> Signed-off-by: Thomas Koeller <thomas.koeller@baslerweb.com>
> ---
>  drivers/rtc/rtc-rs5c372.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
Applied, thanks.

Patch hide | download patch | download mbox

diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 211cacd..be80560 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -535,9 +535,9 @@  static int rs5c_oscillator_setup(struct rs5c372 *rs5c372)
 	int addr, i, ret = 0;
 
 	if (rs5c372->type == rtc_r2025sd) {
-		if (!(rs5c372->regs[RS5C_REG_CTRL2] & R2025_CTRL2_XST))
+		if (rs5c372->regs[RS5C_REG_CTRL2] & R2025_CTRL2_XST)
 			return ret;
-		rs5c372->regs[RS5C_REG_CTRL2] &= ~R2025_CTRL2_XST;
+		rs5c372->regs[RS5C_REG_CTRL2] |= R2025_CTRL2_XST;
 	} else {
 		if (!(rs5c372->regs[RS5C_REG_CTRL2] & RS5C_CTRL2_XSTP))
 			return ret;