summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
* rtc: cmos: Revert "rtc: Fix the AltCentury value on AMD/Hygon platform"Alexandre Belloni2020-01-041-14/+1
| | | | | | | | | | | | | There are multiple reports of this patch breaking RTC time setting for AMD platforms. This reverts commit 7ad295d5196a58c22abecef62dd4f99e2f86e831. Cc: Jinke Fan <fanjinke@hygon.cn> Link: https://lore.kernel.org/r/CABXGCsMLob0DC25JS8wwAYydnDoHBSoMh2_YLPfqm3TTvDE-Zw@mail.gmail.com Fixes: 7ad295d5196a ("rtc: Fix the AltCentury value on AMD/Hygon platform") Link: https://lore.kernel.org/r/20200104043110.707810-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: mt6397: fix alarm register overwriteRan Bi2019-12-111-14/+25
| | | | | | | | | | | | | Alarm registers high byte was reserved for other functions. This add mask in alarm registers operation functions. This also fix error condition in interrupt handler. Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver") Signed-off-by: Ran Bi <ran.bi@mediatek.com> Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Link: https://lore.kernel.org/r/1576057435-3561-6-git-send-email-hsin-hsiung.wang@mediatek.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: sun6i: Add support for RTC clocks on R40Chen-Yu Tsai2019-12-101-0/+16
| | | | | | | | | | | | | | | | | | | | When support for the R40 in the rtc-sun6i driver was split out for a separate compatible string, only the RTC half was covered, and not the clock half. Unfortunately this results in the whole driver not working, as the RTC half expects the clock half to have been initialized. Add support for the clock part as well. The clock part is like the H3, but does not need to export the internal oscillator, nor does it have a gateable LOSC external output. This fixes issues with WiFi and Bluetooth not working on the BPI M2U. Fixes: d6624cc75021 ("rtc: sun6i: Add R40 compatible") Cc: <stable@vger.kernel.org> # 5.3.x Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20191205085054.6049-1-wens@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* Merge tag 'rtc-5.5' of ↵Linus Torvalds2019-12-0369-670/+555
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "A lot of unnecessary code removal in here that ends up decreasing the number of lines in the subsystem. The ds1343 and ds1347 drivers got cleaned up. The rest are the usual fixes and new features. Subsystem: - fix warnings and errors with make W=1 - UIE are now disabled while setting the RTC time - UIE are now disallowed when the RTC time is not set. Drivers: - remove unecessary .remove callbacks - Set RTC range for cros-ec, ds1343, ds1347, m41t80, s35390a, vt8500 - Use devm_platform_ioremap_resource where applicable - rv3028: add clock out support" * tag 'rtc-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (81 commits) rtc: Fix Kconfig indentation rtc: xgene: Remove unused struct device in struct xgene_rtc_dev rtc: sun6i: Remove struct device from sun6i_rtc_dev rtc: st-lpc: Remove struct resource from struct st_rtc rtc: pcf8523: Remove struct pcf8523 rtc: meson: remove redundant assignment to variable retries rtc: v3020: remove set but unused variable rtc: tegra: remove set but unused variable rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtc rtc: m41t80: remove excess kerneldoc rtc: ds1685: fix build error with make W=1 rtc: ds1685: remove set but unused variables rtc: ds1374: remove unused variable rtc: sysfs: fix hctosys_show kerneldoc rtc: interface: fix kerneldoc comments rtc: msm6242: Remove unneeded msm6242_set()/msm6242_clear() functions rtc: msm6242: Fix reading of 10-hour digit rtc: tps65910: allow using RTC without alarm interrupt rtc: fsl-ftm-alarm: remove select FSL_RCPM and default y from Kconfig rtc: pcf8563: Constify clkout_rates ...
| * rtc: Fix Kconfig indentationKrzysztof Kozlowski2019-11-271-3/+3
| | | | | | | | | | | | | | | | | | | | Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191120133940.13881-1-krzk@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: xgene: Remove unused struct device in struct xgene_rtc_devNobuhiro Iwamatsu2019-11-271-2/+0
| | | | | | | | | | | | | | | | struct device in struct xgene_rtc_dev is not used, remove it. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191123090234.32180-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sun6i: Remove struct device from sun6i_rtc_devNobuhiro Iwamatsu2019-11-271-2/+0
| | | | | | | | | | | | | | | | struct device in struct sun6i_rtc_dev is not used, remove it. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191123090538.32364-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: st-lpc: Remove struct resource from struct st_rtcNobuhiro Iwamatsu2019-11-271-1/+0
| | | | | | | | | | | | | | | | struct resource in struct st_rtc is not used, remove it. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191123091241.1905-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf8523: Remove struct pcf8523Nobuhiro Iwamatsu2019-11-271-14/+4
| | | | | | | | | | | | | | | | | | struct pcf8523 is referenced only by pcf8523_probe(). And member variable in this is not referenced by any function. Remove struct pcf8523. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191123090838.1619-1-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: meson: remove redundant assignment to variable retriesColin Ian King2019-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The variable retries is being initialized with a value that is never read and it is being updated later with a new value in a for-loop. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://lore.kernel.org/r/20191122225210.109172-1-colin.king@canonical.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: v3020: remove set but unused variableAlexandre Belloni2019-11-271-2/+1
| | | | | | | | | | | | | | | | | | Fix the following warning: drivers/rtc/rtc-v3020.c: In function ‘rtc_probe’: drivers/rtc/rtc-v3020.c:287:6: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable] Link: https://lore.kernel.org/r/20191122102212.400158-9-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: tegra: remove set but unused variableAlexandre Belloni2019-11-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fix the following warning: drivers/rtc/rtc-tegra.c: In function ‘tegra_rtc_read_time’: drivers/rtc/rtc-tegra.c:106:11: warning: variable ‘msec’ set but not used [-Wunused-but-set-variable] Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20191122102212.400158-8-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtcAlexandre Belloni2019-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | The change from u8 ctrl_reg to const struct pm8xxx_rtc_regs *regs; did not properly update the kerneldoc comment. Fixes: drivers/rtc/rtc-pm8xxx.c:64: warning: Function parameter or member 'regs' not described in 'pm8xxx_rtc' Fixes: c8d523a4b053 ("drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc") Link: https://lore.kernel.org/r/20191122102212.400158-7-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: m41t80: remove excess kerneldocAlexandre Belloni2019-11-271-1/+0
| | | | | | | | | | | | | | | | Fix the following warning: drivers/rtc/rtc-m41t80.c:716: warning: Excess function parameter 'inode' description in 'wdt_ioctl' Link: https://lore.kernel.org/r/20191122102212.400158-6-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1685: fix build error with make W=1Alexandre Belloni2019-11-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | Fix the following parsing errors when building with W=1: drivers/rtc/rtc-ds1685.c:1053: error: Cannot parse struct or union! drivers/rtc/rtc-ds1685.c:1062: error: Cannot parse struct or union! drivers/rtc/rtc-ds1685.c:1363: warning: cannot understand function prototype: 'struct platform_driver ds1685_rtc_driver = ' Cc: Joshua Kinard <kumba@gentoo.org> Link: https://lore.kernel.org/r/20191122102212.400158-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1685: remove set but unused variablesAlexandre Belloni2019-11-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following warnings: drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_read_time’: drivers/rtc/rtc-ds1685.c:264:5: warning: variable ‘ctrlb’ set but not used [-Wunused-but-set-variable] 264 | u8 ctrlb, century; | ^~~~~ drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_proc’: drivers/rtc/rtc-ds1685.c:758:19: warning: variable ‘ctrlc’ set but not used [-Wunused-but-set-variable] 758 | u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8]; | ^~~~~ Cc: Joshua Kinard <kumba@gentoo.org> Acked-By: Joshua Kinard <kumba@gentoo.org> Link: https://lore.kernel.org/r/20191122102212.400158-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1374: remove unused variableAlexandre Belloni2019-11-271-2/+1
| | | | | | | | | | | | | | | | | | | | Fix warning: drivers/rtc/rtc-ds1374.c: In function ‘ds1374_wdt_disable’: drivers/rtc/rtc-ds1374.c:442:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Link: https://lore.kernel.org/r/20191122102212.400158-3-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sysfs: fix hctosys_show kerneldocAlexandre Belloni2019-11-271-1/+4
| | | | | | | | | | | | | | | | | | | | Fix undocumented function parameters: drivers/rtc/sysfs.c:112: warning: Function parameter or member 'dev' not described in 'hctosys_show' drivers/rtc/sysfs.c:112: warning: Function parameter or member 'attr' not described in 'hctosys_show' drivers/rtc/sysfs.c:112: warning: Function parameter or member 'buf' not described in 'hctosys_show' Link: https://lore.kernel.org/r/20191122102212.400158-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: interface: fix kerneldoc commentsAlexandre Belloni2019-11-271-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix kerneldoc warnings: drivers/rtc/interface.c:619: warning: Function parameter or member 'num' not described in 'rtc_handle_legacy_irq' drivers/rtc/interface.c:619: warning: Function parameter or member 'mode' not described in 'rtc_handle_legacy_irq' drivers/rtc/interface.c:804: warning: Function parameter or member 'rtc' not described in 'rtc_timer_enqueue' drivers/rtc/interface.c:804: warning: Function parameter or member 'timer' not described in 'rtc_timer_enqueue' drivers/rtc/interface.c:864: warning: Function parameter or member 'rtc' not described in 'rtc_timer_remove' drivers/rtc/interface.c:864: warning: Function parameter or member 'timer' not described in 'rtc_timer_remove' drivers/rtc/interface.c:900: warning: Function parameter or member 'work' not described in 'rtc_timer_do_work' drivers/rtc/interface.c:1035: warning: Function parameter or member 'rtc' not described in 'rtc_read_offset' drivers/rtc/interface.c:1035: warning: Function parameter or member 'offset' not described in 'rtc_read_offset' drivers/rtc/interface.c:1070: warning: Function parameter or member 'rtc' not described in 'rtc_set_offset' drivers/rtc/interface.c:1070: warning: Function parameter or member 'offset' not described in 'rtc_set_offset' Link: https://lore.kernel.org/r/20191127082932.666869-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: msm6242: Remove unneeded msm6242_set()/msm6242_clear() functionsKars de Jong2019-11-181-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The msm6242_set()/msm6242_clear() functions are used when writing to Control Register D to set or clear the HOLD bit when reading the current time from the RTC. Doing this with a read-modify-write cycle will potentially clear an interrupt condition which occurs between the read and the write. The datasheet states the following about this: When writing the HOLD or 30 second adjust bits of register D, it is necessary to write the IRQ FLAG bit to a "1". Since the only other bits in the register are the 30 second adjust bit (which is not used) and the BUSY bit (which is read-only), the read-modify-write cycle can be replaced by a simple write with the IRQ FLAG bit set to 1 and the other bits (except HOLD) set to 0. Tested-by: Kars de Jong <jongk@linux-m68k.org> Signed-off-by: Kars de Jong <jongk@linux-m68k.org> Link: https://lore.kernel.org/r/20191116114620.9193-1-jongk@linux-m68k.org Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: msm6242: Fix reading of 10-hour digitKars de Jong2019-11-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver was reading the wrong register as the 10-hour digit due to a misplaced ')'. It was in fact reading the 1-second digit register due to this bug. Also remove the use of a magic number for the hour mask and use the define for it which was already present. Fixes: 4f9b9bba1dd1 ("rtc: Add an RTC driver for the Oki MSM6242") Tested-by: Kars de Jong <jongk@linux-m68k.org> Signed-off-by: Kars de Jong <jongk@linux-m68k.org> Link: https://lore.kernel.org/r/20191116110548.8562-1-jongk@linux-m68k.org Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: tps65910: allow using RTC without alarm interruptAndrey Skvortsov2019-11-171-6/+15
| | | | | | | | | | | | | | | | | | | | If tps65910 INT1 pin (IRQ output) is not wired to any IRQ controller, then it can't be used as system wakeup/alarm source, but it is still possible to read/write time from/to RTC. Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Link: https://lore.kernel.org/r/20191116203748.27166-1-andrej.skvortzov@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: fsl-ftm-alarm: remove select FSL_RCPM and default y from KconfigLi Yang2019-11-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The Flextimer alarm is primarily used as a wakeup source for system power management. But it shouldn't select the power management driver as they don't really have dependency of each other. Also remove the default y as it is not a critical feature for the systems. Signed-off-by: Li Yang <leoyang.li@nxp.com> Link: https://lore.kernel.org/r/1573252856-11759-1-git-send-email-leoyang.li@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf8563: Constify clkout_ratesNobuhiro Iwamatsu2019-11-151-1/+1
| | | | | | | | | | | | | | | | The lates of clockout should be marked const. Make that so. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191108002449.15097-1-iwamatsu@nigauri.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1302: Remove unused DRV_NAMENobuhiro Iwamatsu2019-11-151-2/+0
| | | | | | | | | | | | | | | | DRV_NAME is unused, remove it. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191108002354.15016-1-iwamatsu@nigauri.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rx6110: Convert to SPDX identifierNobuhiro Iwamatsu2019-11-151-9/+1
| | | | | | | | | | | | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191108002250.14937-1-iwamatsu@nigauri.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rx6110: Remove useless rx6110_removeNobuhiro Iwamatsu2019-11-151-6/+0
| | | | | | | | | | | | | | | | rx6110_remove is empty, remove it. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191108002113.14791-1-iwamatsu@nigauri.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: Fix the AltCentury value on AMD/Hygon platformJinke Fan2019-11-081-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using following operations: date -s "21190910 19:20:00" hwclock -w to change date from 2019 to 2119 for test, it will fail on Hygon Dhyana and AMD Zen CPUs, while the same operations run ok on Intel i7 platform. MC146818 driver use function mc146818_set_time() to set register RTC_FREQ_SELECT(RTC_REG_A)'s bit4-bit6 field which means divider stage reset value on Intel platform to 0x7. While AMD/Hygon RTC_REG_A(0Ah)'s bit4 is defined as DV0 [Reference]: DV0 = 0 selects Bank 0, DV0 = 1 selects Bank 1. Bit5-bit6 is defined as reserved. DV0 is set to 1, it will select Bank 1, which will disable AltCentury register(0x32) access. As UEFI pass acpi_gbl_FADT.century 0x32 (AltCentury), the CMOS write will be failed on code: CMOS_WRITE(century, acpi_gbl_FADT.century). Correct RTC_REG_A bank select bit(DV0) to 0 on AMD/Hygon CPUs, it will enable AltCentury(0x32) register writing and finally setup century as expected. Test results on Intel i7, AMD EPYC(17h) and Hygon machine show that it works as expected. Compiling for sparc64 and alpha architectures are passed. Reference: https://www.amd.com/system/files/TechDocs/51192_Bolton_FCH_RRG.pdf section: 3.13 Real Time Clock (RTC) Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Jinke Fan <fanjinke@hygon.cn> Link: https://lore.kernel.org/r/20191105083943.115320-1-fanjinke@hygon.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: bd70528: fix module alias to autoload moduleColin Ian King2019-11-081-1/+1
| | | | | | | | | | | | | | | | | | The module alias platform tag contains a spelling mistake. Fix it. Fixes: f33506abbcdd ("rtc: bd70528: Add MODULE ALIAS to autoload module") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20191106083418.159045-1-colin.king@canonical.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: bd70528: Add MODULE ALIAS to autoload moduleMatti Vaittinen2019-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bd70528 RTC driver is probed by MFD driver. Add MODULE_ALIAS in order to allow udev to load the module when MFD sub-device cell for RTC is added. I'm not sure if this is a bugfix or feature addition but I guess fixes tag won't harm in this case. Fixes: 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC") Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20191023114711.GA13954@localhost.localdomain Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: em3027: correct month valueIlya Ledvich2019-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | The RTC month value is 1-indexed, but the kernel assumes it is 0-indexed. This may result in the RTC not rolling over correctly. Signed-off-by: Ilya Ledvich <ilya@compulab.co.il> Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191101095422.14787-1-ilya@compulab.co.il Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: brcmstb-waketimer: add missed clk_disable_unprepareChuhong Yuan2019-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare to fix it. Fixes: c4f07ecee22e ("rtc: brcmstb-waketimer: Add Broadcom STB wake-timer") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20191105160043.20018-1-hslester96@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: cros-ec: let the core handle rtc rangeAlexandre Belloni2019-11-081-8/+9
| | | | | | | | | | | | | | | | Let the rtc core check the date/time against the RTC range. Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20191016201414.30934-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: cros-ec: remove superfluous error messageAlexandre Belloni2019-11-081-5/+2
| | | | | | | | | | | | | | | | | | The RTC core now has error messages in case of registration failure, there is no need to have other messages in the drivers. Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20191016201414.30934-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sirfsoc: remove .removeAlexandre Belloni2019-11-081-8/+0
| | | | | | | | | | | | | | | | | | | | dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-3-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sc27xx: remove .removeAlexandre Belloni2019-11-081-7/+0
| | | | | | | | | | | | | | | | | | | | | | dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-4-alexandre.belloni@bootlin.com Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: lpc32xx: remove .removeAlexandre Belloni2019-11-081-11/+0
| | | | | | | | | | | | | | | | | | | | dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ab-b5ze-s3: remove .removeAlexandre Belloni2019-11-081-11/+0
| | | | | | | | | | | | | | | | | | | | dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: disallow update interrupts when time is invalidAlexandre Belloni2019-11-081-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | Never enable update interrupts when the time set on the rtc is invalid. In that case, also avoid enabling the emulation because it will fail for the same reason. Link: https://lore.kernel.org/r/20191021155631.3342-2-alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/CA+ASDXMarBG5C1Kz42B9i_iVZ1=i6GgH9Yja2cdmSueKD_As_g@mail.gmail.com Reported-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reported-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: disable uie before setting time and enable afterAlexandre Belloni2019-11-081-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting the time in the future with the uie timer enabled, rtc_timer_do_work will loop for a while because the expiration of the uie timer was way before the current RTC time and a new timer will be enqueued until the current rtc time is reached. If the uie timer is enabled, disable it before setting the time and enable it after expiring current timers (which may actually be an alarm). This is the safest thing to do to ensure the uie timer is still synchronized with the RTC, especially in the UIE emulation case. Reported-by: syzbot+08116743f8ad6f9a6de7@syzkaller.appspotmail.com Fixes: 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events") Link: https://lore.kernel.org/r/20191020231320.8191-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: fsl-ftm-alarm: avoid struct rtc_time conversionsAlexandre Belloni2019-11-081-5/+2
| | | | | | | | | | | | | | | | Directly call ktime_get_real_seconds instead of converting the result to a struct rtc_time and then back to a time64_t. Link: https://lore.kernel.org/r/20191016201223.30568-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: fsl-ftm-alarm: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni2019-11-081-4/+5
| | | | | | | | | | | | | | Call the 64bit versions of rtc_tm time conversion to avoid the y2038 issue. Link: https://lore.kernel.org/r/20191016201223.30568-3-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: fsl-ftm-alarm: switch to ktime_get_real_secondsAlexandre Belloni2019-11-081-4/+1
| | | | | | | | | | | | | | | | The driver drops the nanoseconds part of the timespec64, there is no need to call ktime_get_real_ts64. Link: https://lore.kernel.org/r/20191016201223.30568-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf2127: handle boot-enabled watchdog featureMartin Hundebøll2019-10-211-1/+9
| | | | | | | | | | | | | | | | | | | | | | Linux should handle when the pcf2127 watchdog feature is enabled by the bootloader. This is done by checking the watchdog timer value during init, and set the WDOG_HW_RUNNING flag if the value differs from zero. Signed-off-by: Martin Hundebøll <martin@geanix.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20191021080838.2789-1-martin@geanix.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rv3028: add clkout supportParthiban Nallathambi2019-10-191-0/+146
| | | | | | | | | | | | | | | | | | | | rv3028 provides clkout (enabled by default). Add clkout to clock framework source and control from device tree for variable frequency with enable and disable functionality. Signed-off-by: Parthiban Nallathambi <pn@denx.de> Link: https://lore.kernel.org/r/20191018100425.1687979-1-pn@denx.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: cleanup .removeAlexandre Belloni2019-10-191-9/+1
| | | | | | | | | | | | | | | | | | | | It is not necessary to call device_init_wakeup(dev, false) in .remove as device_del will take care of that. It is also not necessary to devm_free_irq. Finally, dev_pm_clear_wake_irq can be called unconditionally. Link: https://lore.kernel.org/r/20191019204941.6203-9-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: rework interrupt handlingAlexandre Belloni2019-10-191-77/+35
| | | | | | | | | | | | | | | | | | | | | | | | Rework the interrupt handling to avoid caching the values as the core is already doing that. The core also always ensures the rtc_time passed for the alarm is fully populated. The only trick is in read_alarm where status needs to be read before the alarm registers to ensure the potential irq is not cleared. Link: https://lore.kernel.org/r/20191019204941.6203-8-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: remove unnecessary mutexAlexandre Belloni2019-10-191-29/+7
| | | | | | | | | | | | | | | | Use rtc_lock and rtc_unlock to lock the rtc from the interrupt handler. This removes the need for a driver specific lock. Link: https://lore.kernel.org/r/20191019204941.6203-7-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: check regmap_read return valueAlexandre Belloni2019-10-191-3/+8
| | | | | | | | | | | | | | | | Check whether regmap_read fails before continuing in the sysfs .show callbacks. Link: https://lore.kernel.org/r/20191019204941.6203-6-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: use regmap_update_bits for glitch filterAlexandre Belloni2019-10-191-10/+8
| | | | | | | | | | | | | | | | Use regmap_update_bits to update DS1343_CONTROL_REG in a race free manner when setting the glitch filter. Link: https://lore.kernel.org/r/20191019204941.6203-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>