summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
AgeCommit message (Collapse)AuthorFilesLines
2019-12-18rtc: rv8803: return meaningful value for RTC_VL_READAlexandre Belloni1-8/+6
RV8803_FLAG_V1F means the voltage is too low to keep the temperature compensation running and the accuracy of the RTC is affected. RV8803_FLAG_V2F means the voltage dropped so low that data is now invalid. Link: https://lore.kernel.org/r/20191214220259.621996-16-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: rv8803: avoid clearing RV8803_FLAG_V2F in RTC_VL_CLRAlexandre Belloni1-1/+1
Stop clearing RV8803_FLAG_V2F in RTC_VL_CLR because it is a disservice to userspace as it removes the important information that the RTC data is invalid. This may lead userspace to set an invalid system time later on. Link: https://lore.kernel.org/r/20191214220259.621996-15-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: rv3028: return meaningful value for RTC_VL_READAlexandre Belloni1-9/+2
RV3028_STATUS_PORF means the voltage dropped too low and data has been lost. Link: https://lore.kernel.org/r/20191214220259.621996-14-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: rv3028: remove RTC_VL_CLR handlingAlexandre Belloni1-6/+0
Remove RTC_VL_CLR handling because it is a disservice to userspace as it removes the important information that the RTC data is invalid. This may lead userspace to set an invalid system time later on. Link: https://lore.kernel.org/r/20191214220259.621996-13-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf85063: return meaningful value for RTC_VL_READAlexandre Belloni1-8/+2
PCF85063_REG_SC_OS means the voltage dropped too low and data has been lost. Link: https://lore.kernel.org/r/20191214220259.621996-12-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf85063: remove RTC_VL_CLR handlingAlexandre Belloni1-6/+0
Remove RTC_VL_CLR handling because it is a disservice to userspace as it removes the important information that the RTC data is invalid. This may lead userspace to set an invalid system time later on. Link: https://lore.kernel.org/r/20191214220259.621996-11-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf8563: return meaningful value for RTC_VL_READAlexandre Belloni1-7/+3
PCF8563_SC_LV means the voltage dropped too low and data has been lost. Link: https://lore.kernel.org/r/20191214220259.621996-10-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf8563: stop caching voltage_lowAlexandre Belloni1-7/+9
voltage_low is only updated when reading the time, this means that using RTC_VL_READ will miss the VL flag if the time has not been read before using the ioctl. Always read the status from the hardware. Link: https://lore.kernel.org/r/20191214220259.621996-9-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf8563: remove conditional compilationAlexandre Belloni1-5/+0
Always compile pcf8563_rtc_ioctl as we are sure that CONFIG_RTC_INTF_DEV is selected on actual kernel configurations. Link: https://lore.kernel.org/r/20191214220259.621996-8-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf8563: remove RTC_VL_CLR handlingAlexandre Belloni1-15/+0
Remove RTC_VL_CLR handling because it is a disservice to userspace as it removes the important information that the RTC data is invalid. This may lead userspace to set an invalid system time later on. Link: https://lore.kernel.org/r/20191214220259.621996-7-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf8523: return meaningful value for RTC_VL_READAlexandre Belloni1-3/+3
REG_CONTROL3_BLF indicates the battery is low and needs to be replaced soon. Link: https://lore.kernel.org/r/20191214220259.621996-6-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: pcf2127: return meaningful value for RTC_VL_READAlexandre Belloni1-4/+2
PCF2127_BIT_CTRL3_BLF indicates the battery is low and needs to be replaced soon. Link: https://lore.kernel.org/r/20191214220259.621996-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-18rtc: abx80x: return meaningful value for RTC_VL_READAlexandre Belloni1-5/+2
ABX8XX_STATUS_BLF indicates the battery is low and needs to be replaced soon. Link: https://lore.kernel.org/r/20191214220259.621996-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-11rtc: mt6397: fix alarm register overwriteRan Bi1-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>
2019-12-10rtc: ds1343: Do not hardcode SPI mode flagsLinus Walleij1-2/+5
The current use of mode flags to us SPI_MODE_3 and SPI_CS_HIGH is fragile: it overwrites anything already assigned by the SPI core. Change it thusly: - Just |= the SPI_MODE_3 so we keep other flags - Assign ^= SPI_CS_HIGH since we might be active high already, and that is usually the case with GPIOs used for chip select, even if they are in practice active low. Add a comment clarifying why ^= SPI_CS_HIGH is the right choice here. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20191204225731.20306-1-linus.walleij@linaro.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-10rtc: zynqmp: re-use rtc_time64_to_tm operationJean-Francois Dagenais1-2/+2
This allows a subsequent commit to spin_unlock sooner. Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/20191128015613.10003-1-jeff.dagenais@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-10rtc: sun6i: Add support for RTC clocks on R40Chen-Yu Tsai1-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>
2019-12-10rtc: stm32: add missed clk_disable_unprepare in error path of resumeChuhong Yuan1-1/+4
The resume() forgets to call clk_disable_unprepare() when failed. Add the missed call to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com> Link: https://lore.kernel.org/r/20191205160655.32188-1-hslester96@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-10rtc: mt6397: drop free_irq of devm_ allocated irqWei Yongjun1-9/+1
The devm_request_threaded_irq function allocates irq that is released when a driver detaches. Thus, there is no reason to explicitly call free_irq in probe function. Fixes: 851b87148aa2 ("rtc: mt6397: improvements of rtc driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20191113021720.9527-1-weiyongjun1@huawei.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-12-03Merge tag 'rtc-5.5' of ↵Linus Torvalds69-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 ...
2019-12-01Merge tag 'mfd-next-5.5' of ↵Linus Torvalds1-86/+21
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Add support for a "resource managed strongly uncachable ioremap" call - Provide a collection of MFD helper macros - Remove mfd_clone_cell() from MFD core - Add NULL de-reference protection in MFD core - Remove superfluous function fd_platform_add_cell() from MFD core - Honour Device Tree's request to disable a device New Drivers: - Add support for MediaTek MT6323 PMIC New Device Support: - Add support for Gemini Lake to Intel LPSS PCI - Add support for Cherry Trail Crystal Cover PMIC to Intel SoC PMIC CRC - Add support for PM{I}8950 to Qualcomm SPMI PMIC - Add support for U8420 to ST-Ericsson DB8500 - Add support for Comet Lake PCH-H to Intel LPSS PCI New Functionality: - Add support for requested supply clocks; madera-core Fix-ups: - Lower interrupt priority; rk808 - Use provided helpers (macros, group functions, defines); rk808, ipaq-micro, ab8500-core, db8500-prcmu, mt6397-core, cs5535-mfd - Only allocate IRQs on request; max77620 - Use simplified API; arizona-core - Remove redundant and/or duplicated code; wm8998-tables, arizona, syscon - Device Tree binding fix-ups; madera, max77650, max77693 - Remove mfd_cell->id abuse hack; cs5535-mfd - Remove only user of mfd_clone_cell(); cs5535-mfd - Make resources static; rohm-bd70528 Bug Fixes: - Fix product ID for RK818; rk808 - Fix Power Key; rk808 - Fix booting on the BananaPi; mt6397-core - Endian fix-ups; twl.h - Fix static error checker warnings; ti_am335x_tscadc" * tag 'mfd-next-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (47 commits) Revert "mfd: syscon: Set name of regmap_config" mfd: ti_am335x_tscadc: Fix static checker warning mfd: bd70528: Staticize bit value definitions mfd: mfd-core: Honour Device Tree's request to disable a child-device dt-bindings: mfd: max77693: Fix missing curly brace mfd: intel-lpss: Add Intel Comet Lake PCH-H PCI IDs mfd: db8500-prcmu: Support U8420-sysclk firmware dt-bindings: mfd: max77650: Convert the binding document to yaml mfd: mfd-core: Move pdev->mfd_cell creation back into mfd_add_device() mfd: mfd-core: Remove usage counting for .{en,dis}able() call-backs x86: olpc-xo1-sci: Remove invocation of MFD's .enable()/.disable() call-backs x86: olpc-xo1-pm: Remove invocation of MFD's .enable()/.disable() call-backs mfd: mfd-core: Remove mfd_clone_cell() mfd: mfd-core: Protect against NULL call-back function pointer mfd: cs5535-mfd: Register clients using their own dedicated MFD cell entries mfd: cs5535-mfd: Request shared IO regions centrally mfd: cs5535-mfd: Remove mfd_cell->id hack mfd: cs5535-mfd: Use PLATFORM_DEVID_* defines and tidy error message mfd: intel_soc_pmic_crc: Add "cht_crystal_cove_pmic" cell to CHT cells mfd: madera: Add support for requesting the supply clocks ...
2019-11-27rtc: Fix Kconfig indentationKrzysztof Kozlowski1-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>
2019-11-27rtc: xgene: Remove unused struct device in struct xgene_rtc_devNobuhiro Iwamatsu1-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>
2019-11-27rtc: sun6i: Remove struct device from sun6i_rtc_devNobuhiro Iwamatsu1-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>
2019-11-27rtc: st-lpc: Remove struct resource from struct st_rtcNobuhiro Iwamatsu1-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>
2019-11-27rtc: pcf8523: Remove struct pcf8523Nobuhiro Iwamatsu1-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>
2019-11-27rtc: meson: remove redundant assignment to variable retriesColin Ian King1-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>
2019-11-27rtc: v3020: remove set but unused variableAlexandre Belloni1-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>
2019-11-27rtc: tegra: remove set but unused variableAlexandre Belloni1-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>
2019-11-27rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtcAlexandre Belloni1-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>
2019-11-27rtc: m41t80: remove excess kerneldocAlexandre Belloni1-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>
2019-11-27rtc: ds1685: fix build error with make W=1Alexandre Belloni1-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>
2019-11-27rtc: ds1685: remove set but unused variablesAlexandre Belloni1-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>
2019-11-27rtc: ds1374: remove unused variableAlexandre Belloni1-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>
2019-11-27rtc: sysfs: fix hctosys_show kerneldocAlexandre Belloni1-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>
2019-11-27rtc: interface: fix kerneldoc commentsAlexandre Belloni1-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>
2019-11-18rtc: msm6242: Remove unneeded msm6242_set()/msm6242_clear() functionsKars de Jong1-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>
2019-11-18rtc: msm6242: Fix reading of 10-hour digitKars de Jong1-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>
2019-11-17rtc: tps65910: allow using RTC without alarm interruptAndrey Skvortsov1-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>
2019-11-15rtc: fsl-ftm-alarm: remove select FSL_RCPM and default y from KconfigLi Yang1-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>
2019-11-15rtc: pcf8563: Constify clkout_ratesNobuhiro Iwamatsu1-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>
2019-11-15rtc: ds1302: Remove unused DRV_NAMENobuhiro Iwamatsu1-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>
2019-11-15rtc: rx6110: Convert to SPDX identifierNobuhiro Iwamatsu1-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>
2019-11-15rtc: rx6110: Remove useless rx6110_removeNobuhiro Iwamatsu1-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>
2019-11-08rtc: Fix the AltCentury value on AMD/Hygon platformJinke Fan1-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>
2019-11-08rtc: bd70528: fix module alias to autoload moduleColin Ian King1-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>
2019-11-08rtc: bd70528: Add MODULE ALIAS to autoload moduleMatti Vaittinen1-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>
2019-11-08rtc: em3027: correct month valueIlya Ledvich1-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>
2019-11-08rtc: brcmstb-waketimer: add missed clk_disable_unprepareChuhong Yuan1-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>
2019-11-08rtc: cros-ec: let the core handle rtc rangeAlexandre Belloni1-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>