rtc: nuvoton: Compatible with NCT3015Y-R and NCT3018Y-R
authorMia Lin <mimi05633@gmail.com>
Mon, 13 Nov 2023 10:38:07 +0000 (18:38 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 18 Jan 2024 00:05:33 +0000 (01:05 +0100)
commit14688f1a91e1f37bc6bf50ff5241e857f24338e0
tree615ebb114ff3ea9122bb45a022f7705314a07a23
parentf5334aa88345874d54a406e86a886a54173e1ba8
rtc: nuvoton: Compatible with NCT3015Y-R and NCT3018Y-R

The NCT3015Y-R and NCT3018Y-R use the same datasheet
    but have different topologies as follows.
- Topology (Only 1st i2c can set TWO bit and HF bit)
  In NCT3015Y-R,
    rtc 1st i2c is connected to a host CPU
    rtc 2nd i2c is connected to a BMC
  In NCT3018Y-R,
    rtc 1st i2c is connected to a BMC
    rtc 2nd i2c is connected to a host CPU
In order to be compatible with NCT3015Y-R and NCT3018Y-R,
- In probe,
  If part number is NCT3018Y-R, only set HF bit to 24-Hour format.
  Else, do nothing
- In set_time,
  If part number is NCT3018Y-R && TWO bit is 0,
     change TWO bit to 1, and restore TWO bit after updating time.

Signed-off-by: Mia Lin <mimi05633@gmail.com>
Link: https://lore.kernel.org/r/20231113103807.1036978-2-mimi05633@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-nct3018y.c