aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)AuthorFilesLines
2020-03-16rtc: 88pm860x: stop setting a default timeAlexandre Belloni1-13/+0
It doesn't make sense to set the RTC to a default value at probe time. Let the core handle invalid date and time. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: 88pm860x: fix possible race conditionAlexandre Belloni1-6/+8
The RTC IRQ is requested before the struct rtc_device is allocated, this may lead to a NULL pointer dereference in the IRQ handler. To fix this issue, allocating the rtc_device struct before requesting the RTC IRQ using devm_rtc_allocate_device, and use rtc_register_device to register the RTC device. Also remove the unnecessary error message as the core already prints the info. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: snvs: Use devm_add_action_or_reset() for calls to clk_disable_unprepare()Anson Huang1-14/+13
Use devm_add_action_or_reset() for calls to clk_disable_unprepare(), which can simplify the error handling. Signed-off-by: Anson Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: add support for the MediaTek MT2712 RTCRan Bi3-0/+432
This add support for the MediaTek MT2712 RTC. It was SoC based RTC, but had different architecture compared with MT7622 RTC. Signed-off-by: Ran Bi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: m48t35: remove SGI-IP27 kludgeThomas Bogendoerfer1-6/+1
With the IOC3 MFD driver it's no longer necessary to special case SGI-IP27. Signed-off-by: Thomas Bogendoerfer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sun6i: Make external 32k oscillator optionalJernej Skrabec1-8/+8
Some boards, like OrangePi PC2 (H5), OrangePi Plus 2E (H3) and Tanix TX6 (H6) don't have external 32kHz oscillator. Till H6, it didn't really matter if external oscillator was enabled because HW detected error and fall back to internal one. H6 has same functionality but it's the first SoC which have "auto switch bypass" bit documented and always enabled in driver. This prevents RTC to work correctly if external crystal is not present on board. There are other side effects - all peripherals which depends on this clock also don't work (HDMI CEC for example). Make clocks property optional. If it is present, select external oscillator. If not, stay on internal. Signed-off-by: Jernej Skrabec <[email protected]> Acked-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: puv3: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-9/+4
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: puv3: set rangeAlexandre Belloni1-0/+1
This RTC is a 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: ab8500: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-5/+5
Call the 64bit versions of rtc_tm time conversion. Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pl031: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-20/+7
Call the 64bit versions of rtc_tm time conversion to allow extending support after 2106 and properly supporting the STv2 range. Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pl031: set rangeAlexandre Belloni1-0/+8
The PL031 and ST v1 RTC are 32bit seconds counters. STv2 is a BCD RTC apparently going from 0000 to 9999, hopefully handling the leap days properly until then. Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pl031: remove useless invalid alarm handlingAlexandre Belloni1-16/+8
The core will never pass an invalid alarm to .set_alarm, it is not necessary to check for its validity. Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: fsl-ftm-alarm: allow COMPILE_TESTAlexandre Belloni1-1/+1
Allow building building the driver with COMPILE_TEST. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: mpc5121: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-5/+3
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: mpc5121: set rangeAlexandre Belloni1-0/+9
The datasheet states that 4052 is the maximum value for year. However, the mpc5121 read_time and set_time function abuse the target time register instead of using the broken down time so it is limited to 2106. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: mpc5121: convert to devm_rtc_allocate_deviceAlexandre Belloni1-10/+12
This simplifies the path for the rtc_ops selection. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: mpc5121: simplify probeAlexandre Belloni1-14/+8
Use devm managed function to simplify probe and remove. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pm8xxx: stop validating valid alarm timeAlexandre Belloni1-6/+0
rtc_time64_to_tm never generates an invalid rtc_tm, stop validating it. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pm8xxx: : switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-4/+4
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pm8xxx: set rangeAlexandre Belloni1-0/+1
The pm8xxx are 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pm8xxx: convert to devm_rtc_allocate_deviceAlexandre Belloni1-9/+5
This allows further improvement of the driver. Also remove the unnecessary error string as the core will already display error messages. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: ds1305: switch to rtc_tm_to_time64Alexandre Belloni1-6/+2
Call the 64bit version of rtc_tm to time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: ds1305: set rangeAlexandre Belloni1-0/+2
The ds1305 is a BCD rtc valid from 2000 to 2099. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: ds1374: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-6/+5
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: ds1374: set rangeAlexandre Belloni1-0/+1
The ds1374 is a 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: ds1374: fix possible race conditionAlexandre Belloni1-6/+9
The RTC IRQ is requested before the struct rtc_device is allocated, this may lead to a NULL pointer dereference in the IRQ handler. To fix this issue, allocating the rtc_device struct before requesting the RTC IRQ using devm_rtc_allocate_device, and use rtc_register_device to register the RTC device. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: cpcap: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-2/+2
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: cpcap: set rangeAlexandre Belloni1-0/+1
The CPCAP rtc is a 14bit day counter plus a 17bit seconds counter. Note that this failed on Nov 10 2014 so it is very likely this driver as never been used since. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: cpcap: convert to devm_rtc_allocate_deviceAlexandre Belloni1-4/+4
This allows further improvement of the driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sa1100: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-15/+6
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sa1100: set rangeAlexandre Belloni1-0/+1
The SA1100 RTC is a 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sa1100: fix possible race conditionAlexandre Belloni1-8/+10
Both RTC IRQs are requested before the struct rtc_device is allocated, this may lead to a NULL pointer dereference in the IRQ handler. To fix this issue, allocating the rtc_device struct before requesting the IRQs using devm_rtc_allocate_device, and use rtc_register_device to register the RTC device. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: au1xxx: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-2/+2
Call the 64bit versions of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: au1xxx: set rangeAlexandre Belloni1-0/+1
The Alchemy counter0 is a 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: au1xxx: remove goto labelAlexandre Belloni1-9/+2
Simplify the driver by removing the goto label as it only does return ret. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: au1xxx: convert to devm_rtc_allocate_deviceAlexandre Belloni1-7/+6
This allows further improvement of the driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: starfire: switch to rtc_time64_to_tmAlexandre Belloni1-1/+1
Call the 64bit version of rtc_tm time conversion. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: starfire: set rangeAlexandre Belloni1-3/+5
The starfire RTC is a 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pl030: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-14/+7
Call the 64bit versions of rtc_tm time conversion to avoid the y2106 issue. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pl030: remove useless invalid alarm handlingAlexandre Belloni1-6/+1
The core will never pass an invalid alarm to .set_alarm, it is not necessary to check for its validity. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: pl030: set rangeAlexandre Belloni1-0/+1
This RTC is a 32bit seconds counter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: davinci: remove useless error handlingAlexandre Belloni1-9/+4
convertfromdays and convert2days never return errors, stop handling non existent errors. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: davinci: let the core handle rtc rangeAlexandre Belloni1-8/+4
Let the core handle offsetting and windowing the RTC range. This rtc has hours, minutes, seconds and 16bit days. As the driver has the RTC epoch set to year 2000, this means that the end of the range is 2^16 days minus one second later. This is Sun Jun 6 23:59:59 UTC 2179. This is better than the currently set year 2099. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: davinci: remove useless 24h alarm handlingAlexandre Belloni1-21/+0
The code handling invalid alarms meaning the alarm is in the next 24 hours is not necessary since commit f8245c26886c ("rtc: remove "RTC_ALM_SET mode" bugs") which actually predates this driver. Since then, .set_alarm is never called with an invalid alarm and this handling is not necessary in the driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: davinci: convert to devm_rtc_allocate_deviceAlexandre Belloni1-7/+5
This allows further improvement of the driver. Also remove the unnecessary error string as the core will already display error messages. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sirfsoc: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-10/+10
Call the 64bit versions of rtc_tm time conversion to avoid the y2106 issue. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sirfsoc: set rangeAlexandre Belloni1-0/+1
This RTC is a 32bit counter running at 16Hz. This overflows every eight years and a half. However, the driver uses the SW_VALUE register to store the overflow, extending the counter to 64bit as long as the update happens before the overflow. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sirfsoc: convert to devm_rtc_allocate_deviceAlexandre Belloni1-15/+8
This allows further improvement of the driver. Also remove the unnecessary error string as the core will already display error messages. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: snvs: Improve Kconfig dependencyAnson Huang1-0/+1
i.MX SNVS RTC should depend on ARCH_MXC or COMPILE_TEST. Signed-off-by: Anson Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-03-16rtc: sysfs: use kobj_to_devsuguosong1-1/+1
use kobj_to_dev instead of open-conding it Signed-off-by: suguosong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>