Skip to content
Snippets Groups Projects
Commit abfdf4ad authored by Mikhail Vanyulin's avatar Mikhail Vanyulin Committed by Jonas Höppner
Browse files

rtc-pcf8563-guf: prevent resetting of TIE bit to support bootselect


Save the value of TIE bit value before resetting CONTROL_STATUS_2 register in
probe() routine of PCF8563 driver. Otherwise, a bootselect functionality stops
working because it stores some information across reboot in RTC registers.

Signed-off-by: default avatarMikhail Vanyulin <mikhail.vanyulin@rtsoft.de>
parent e186ebab
No related branches found
No related tags found
1 merge request!379rtc-pcf8563-guf: prevent resetting of TIE bit to support bootselect
Pipeline #60275 passed with stage
in 6 seconds
......@@ -23,6 +23,7 @@
#define PCF8563_REG_ST1 0x00 /* status */
#define PCF8563_REG_ST2 0x01
#define PCF8563_BIT_TIE BIT(0)
#define PCF8563_BIT_AIE BIT(1)
#define PCF8563_BIT_AF BIT(3)
#define PCF8563_BITS_ST2_N (7 << 5)
......@@ -561,6 +562,17 @@ static int pcf8563_probe(struct i2c_client *client,
/* Clear flags and disable interrupts */
buf = 0;
/* SECO Northern Europe systems use the TIE bit for bootselect storage.
So, we do not reset it.
*/
err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, &buf);
if (err < 0) {
dev_err(&client->dev, "%s: read error\n", __func__);
return err;
}
buf &= PCF8563_BIT_TIE;
err = pcf8563_write_block_data(client, PCF8563_REG_ST2, 1, &buf);
if (err < 0) {
dev_err(&client->dev, "%s: write error\n", __func__);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment