aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-nct3018y.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-08rtc: nct3018y: fix possible NULL dereferenceAlexandre Belloni1-3/+3
alarm_enable and alarm_flag are allowed to be NULL but will be dereferenced later by the dev_dbg call. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202305180042.DEzW1pSd-lkp@intel.com/ Link: https://lore.kernel.org/r/20240229222127.1878176-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-18rtc: nuvoton: Compatible with NCT3015Y-R and NCT3018Y-RMia Lin1-6/+46
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>
2023-08-10rtc: remove redundant of_match_ptr()Zhu Wang1-1/+1
Signed-off-by: Zhu Wang <wangzhu9@huawei.com> Link: https://lore.kernel.org/r/20230808115213.154377-2-wangzhu9@huawei.com Link: https://lore.kernel.org/r/20230808115213.154377-3-wangzhu9@huawei.com Link: https://lore.kernel.org/r/20230808115213.154377-4-wangzhu9@huawei.com Link: https://lore.kernel.org/r/20230808115213.154377-5-wangzhu9@huawei.com Link: https://lore.kernel.org/r/20230808115213.154377-6-wangzhu9@huawei.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-06-06rtc: Switch i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230505121136.1185653-1-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-11-15rtc: nct3018y: Convert to .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221021130706.178687-6-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-07-26rtc: Add NCT3018Y real time clock driverMia Lin1-0/+553
Add real time clock support for NCT3018Y. Signed-off-by: Mia Lin <mimi05633@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220713090647.8028-4-mimi05633@gmail.com