Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Clear OS bit in RTC register after low voltage condition #898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drivers/rtc/rtc-pcf85063.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,16 @@ static int pcf85063_probe(struct i2c_client *client)
return err;
}

ret = regmap_read(pcf85063->regmap, PCF85063_REG_SC, &tmp);
if (ret < 0)
return ret;

// cleat the OS Bit if it is set
if ((tmp & (1 << (8 - 1)))) {
tmp = tmp & (~(1 << (8 - 1)));
regmap_write(pcf85063->regmap, PCF85063_REG_SC, tmp);
}

pcf85063->rtc = devm_rtc_allocate_device(&client->dev);
if (IS_ERR(pcf85063->rtc))
return PTR_ERR(pcf85063->rtc);
Expand Down