Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: rs5c372: r2025: fix check for 'oscillator halted' condition

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>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

authored by

Thomas Koeller and committed by
Alexandre Belloni
a9dbe558 0ddc5b89

+2 -2
+2 -2
drivers/rtc/rtc-rs5c372.c
··· 506 506 int addr, i, ret = 0; 507 507 508 508 if (rs5c372->type == rtc_r2025sd) { 509 - if (!(rs5c372->regs[RS5C_REG_CTRL2] & R2025_CTRL2_XST)) 509 + if (rs5c372->regs[RS5C_REG_CTRL2] & R2025_CTRL2_XST) 510 510 return ret; 511 - rs5c372->regs[RS5C_REG_CTRL2] &= ~R2025_CTRL2_XST; 511 + rs5c372->regs[RS5C_REG_CTRL2] |= R2025_CTRL2_XST; 512 512 } else { 513 513 if (!(rs5c372->regs[RS5C_REG_CTRL2] & RS5C_CTRL2_XSTP)) 514 514 return ret;