Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9dbe558 authored by Thomas Koeller's avatar Thomas Koeller Committed by Alexandre Belloni
Browse files

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: default avatarThomas Koeller <thomas.koeller@baslerweb.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 0ddc5b89
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -506,9 +506,9 @@ static int rs5c_oscillator_setup(struct rs5c372 *rs5c372)
	int addr, i, ret = 0;
	int addr, i, ret = 0;


	if (rs5c372->type == rtc_r2025sd) {
	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;
			return ret;
		rs5c372->regs[RS5C_REG_CTRL2] &= ~R2025_CTRL2_XST;
		rs5c372->regs[RS5C_REG_CTRL2] |= R2025_CTRL2_XST;
	} else {
	} else {
		if (!(rs5c372->regs[RS5C_REG_CTRL2] & RS5C_CTRL2_XSTP))
		if (!(rs5c372->regs[RS5C_REG_CTRL2] & RS5C_CTRL2_XSTP))
			return ret;
			return ret;