Skip to content
Commit ef6c26d3 authored by Chuanhua Han's avatar Chuanhua Han Committed by Heiko Schocher
Browse files

rtc: pcf2127: Fixed bug with rtc settings and getting error time



The previous pcf2127 RTC chip could not read and set the correct time.
When reading the data of internal registers, the read address was the
value of register plus 1. This is because this chip requires the host
to send a stop signal after setting the register address and before
reading the register data.

This patch sets the register address using dm_i2c_write and reads
the register data using the original dm_i2c_xfer in order to generate
a stop signal after the register address is set, and fixes the bug of
the original read and write time.

Signed-off-by: default avatarBiwen Li <biwen.li@nxp.com>
Signed-off-by: default avatarChuanhua Han <chuanhua.han@nxp.com>
Reviewed-by: default avatarLukasz Majewski <lukma@denx.de>
Reviewed-by: default avatarHeiko Schocher <hs@denx.de>
parent d3826fb0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment