aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)AuthorFilesLines
2019-04-04rtc: remove unnecessary Kconfig dependenciesAlexandre Belloni1-2/+0
Remove the unused "depends on I2C" as the config options are already guarded by if I2C. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: add RTC_VL_READ/RTC_VL_CLR supportAlexandre Belloni1-0/+35
Allow reading the oscillator status bit. Also allow clearing it even if that makes little sense and can't be done in a race free way. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: add offset correction supportAlexandre Belloni1-1/+57
The PCF850363 has an offset correction with two modes: With mode 0, the correction is triggered once every two hours and then correction pulses are applied once per minute until the programmed correction values have been implemented. This gives a step of 4.34 ppm. With mode 1, the correction is triggered once every four minutes and then correction pulses are applied once per second up to a maximum of 60 pulses. When correction values greater than 60 pulses are used, additional correction pulses are made in the 59 th second. This gives a step of 4.069 ppm. Use the correction closest to the requested value. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: add nvram supportAlexandre Belloni1-0/+24
The pcf85063 has one byte of nvram. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: add Micro Crystal RV8263 supportAlexandre Belloni1-4/+28
The Micro Crystal RV8263 has the same IC as the pcf85063 but has an on board crystal. This means that the CAP_SEL bit has to be cleared so the correct capacitance is selected for the crystal. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: add alarm supportAlexandre Belloni1-0/+121
Add support for the alarms. The match on the weekday is not used as it it not necessarily properly set. The tested RTC shows a behaviour where setting an alarm on the second right after an alarm that fired is not working, probably because of the circuit that ensures an alarm only fires once. This is why uie_unsupported is set. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: differentiate pcf85063a and pcf85063tpAlexandre Belloni1-6/+27
As stated in a comment pcf85063a and pcf85063tp don't have the same number of registers. Especially, pcf85063tp doesn't have alarm support. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: switch to regmapAlexandre Belloni2-93/+62
Switch to regmap to simplify register accesses and remove the need for pcf85063_stop_clock/pcf85063_start_clock. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: set rangeAlexandre Belloni1-3/+2
This is a standard BCD RTC that will fail in 2100. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: convert to devm_rtc_allocate_deviceAlexandre Belloni1-6/+6
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: remove bogus i2c functionality checkAlexandre Belloni1-3/+0
Only smbus reads and write are done in the driver, plain i2c functionality is not required. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: convert to SPDX identifierAlexandre Belloni1-6/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: pcf85063: switch to probe_newAlexandre Belloni1-10/+2
struct i2c_device_id argument of probe() is not used, so use probe_new() instead. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: snvs: use devm_platform_ioremap_resource() to simplify codeAnson Huang1-3/+1
Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: mxc: use devm_platform_ioremap_resource() to simplify codeAnson Huang1-3/+1
Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: snvs: use dev_pm_set_wake_irq() to simplify codeAnson Huang1-21/+4
With calling dev_pm_set_wake_irq() to set SNVS RTC as wakeup source for suspend, generic wake irq mechanism will automatically enable it as wakeup source when suspend, then the suspend/resume callback which are ONLY for enabling/disabling irq wake can be removed, it simplifies the code. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: Add ASPEED RTC driverJoel Stanley3-0/+148
Read and writes the time to the non-battery backed RTC in the ASPEED BMC system on chip families. Signed-off-by: Joel Stanley <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: brcmstb-waketimer: switch to rtc_time64_to_tmAlexandre Belloni1-1/+1
Call the 64bit version of rtc_time_to_tm as the range is enforced by the core. Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: mt6397: Don't call irq_dispose_mapping.Pi-Hsun Shih1-6/+3
The IRQ mapping was changed to not being created in the rtc-mt6397 driver, so the irq_dispose_mapping is no longer needed. Also the dev_id passed to free_irq should be the same as the last argument passed to request_threaded_irq. This prevents a "Trying to free already-free IRQ 274" warning when unbinding the driver. Fixes: e695d3a0b3b3 ("mfd: mt6397: Create irq mappings in mfd core driver") Signed-off-by: Pi-Hsun Shih <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: opal: Make opal_tpo_alarm_irq_enable staticYueHaibing1-1/+1
Fix sparse warning: drivers/rtc/rtc-opal.c:227:5: warning: symbol 'opal_tpo_alarm_irq_enable' was not declared. Should it be static? Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: wm831x: convert to SPDX identifierAlexandre Belloni1-5/+1
Use SPDX-License-Identifier instead of a verbose license text. Acked-by: Charles Keepax <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: wm831x: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-12/+4
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Acked-by: Charles Keepax <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: wm831x: remove unnecessary gotoAlexandre Belloni1-4/+1
There is no specific handling in the error path of wm831x_rtc_probe, remove the unnecessary goto and label. Acked-by: Charles Keepax <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: wm831x: set rangeAlexandre Belloni1-6/+10
The wm831x has a 32bit second counter. Acked-by: Charles Keepax <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: da9063: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-2/+2
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Acked-by: Steve Twiss <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: da9063: set rangeAlexandre Belloni1-3/+6
The DA9062 and DA9063 have a year register that can go up to 0x3F. Acked-by: Steve Twiss <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: sun4v: switch to SPDX identifierAlexandre Belloni1-1/+1
Use SPDX-License-Identifier to be clearer on the license. Choose the v2 only as this is the default Linux license. Acked-by: David S. Miller <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: sun4v: set rangeAlexandre Belloni1-3/+5
The Sun4v Hypervisor Core API Specification states: Time is described by a single unsigned 64-bit word equivalent to a time_t for the POSIX time(2) system call. The word contains the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds. Acked-by: David S. Miller <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-9/+2
Call the 64bit versions of rtc_tm time conversion as the hypervisor handles 64bit values. Acked-by: David S. Miller <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: omap: convert to SPDX identifierAlexandre Belloni1-5/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: omap: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-2/+2
Call the 64bit versions of rtc_time_to_tm now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: ps3: set rangeAlexandre Belloni1-0/+1
The PS3 has a 64bit second counter from 2000. While this exceeds the 64bit UNIX timestamp, there is not doubt that non of them will still be working by then. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: ps3: convert to devm_rtc_allocate_deviceAlexandre Belloni1-3/+5
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: ps3: convert to SPDX identifierAlexandre Belloni1-13/+1
Use SPDX-License-Identifier instead of a verbose license text. Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: ps3: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-5/+2
Call the 64bit versions of rtc_tm time conversion as the PS3 handles 64bit values. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: at91sam9: correct trivial checkpatch warningsAlexandre Belloni1-20/+20
Correct trivial checkpatch warnings, mostly whitespace issues and unbalanced braces. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: at91sam9: convert to SPDX identifierAlexandre Belloni1-5/+1
Use SPDX-License-Identifier instead of a verbose license text Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: at91sam9: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-10/+4
Call the 64bit versions of rtc_tm time conversion as the range is enforced by the core. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: at91sam9: set rangeAlexandre Belloni1-0/+1
The AT91 RTT is a 32bit second counter that is saved in a 32bit global purpose register. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: at91sam9: convert to devm_rtc_allocate_deviceAlexandre Belloni1-3/+4
This allows further improvement of the driver. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: at91sam9: drop platform_data supportAlexandre Belloni2-37/+9
ARCH_AT91 is DT only for a while, drop platform data support. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: sh: set rangeAlexandre Belloni1-0/+8
The SH RTC is a BCD RTC with some version having 4 digits for the year. The range for the RTCs with only 2 digits for the year was unfortunately shifted to handle 1999 to 2098. Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: sh: fix possible race conditionAlexandre Belloni1-7/+9
The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc struct before requesting the IRQ. Reviewed-by: Geert Uytterhoeven <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: sh: stop resetting time to epochAlexandre Belloni1-7/+3
There is no point in resetting the time to epoch as this means that userspace will never get the valuable information that time is actually invalid. Reviewed-by: Geert Uytterhoeven <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> [Anders Roxell <[email protected]>: remove unused variable r] Signed-off-by: Anders Roxell <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: dm355evm: convert to SPDX identifierAlexandre Belloni1-5/+1
Use SPDX-License-Identifier instead of a verbose license text Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: dm355evm: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-2/+2
Call the 64bit versions of rtc_tm time conversion as the range is enforced by the core. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: dm355evm: set rangeAlexandre Belloni1-0/+1
The MSP430 has a 32bit second counter. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: dm355evm: convert to devm_rtc_allocate_deviceAlexandre Belloni1-7/+6
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: goldfish: convert to SPDX identifierAlexandre Belloni1-10/+1
Use SPDX-License-Identifier instead of a verbose license text Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-04rtc: goldfish: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-19/+8
This RTC handles dates after 2106 (up to July 2554), call the 64bit versions of rtc_tm time conversion. Signed-off-by: Alexandre Belloni <[email protected]>