aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/Kconfig
AgeCommit message (Collapse)AuthorFilesLines
2024-02-29rtc: mt6397: select IRQ_DOMAIN instead of depending on itRandy Dunlap1-1/+2
IRQ_DOMAIN is a hidden (not user visible) symbol. Users cannot set it directly thru "make *config", so drivers should select it instead of depending on it if they need it. Relying on it being set for a dependency is risky. Consistently using "select" or "depends on" can also help reduce Kconfig circular dependency issues. Therefore, change the use of "depends on" for IRQ_DOMAIN to "select" for RTC_DRV_MT6397. Fixes: 04d3ba70a3c9 ("rtc: mt6397: add IRQ domain dependency") Cc: Arnd Bergmann <arnd@arndb.de> Cc: Eddie Huang <eddie.huang@mediatek.com> Cc: Sean Wang <sean.wang@mediatek.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: linux-rtc@vger.kernel.org Cc: Marc Zyngier <maz@kernel.org> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Peter Rosin <peda@axentia.se> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20240213050258.6167-1-rdunlap@infradead.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-15rtc: max31335: add driver supportAntoniu Miclaus1-0/+13
RTC driver for MAX31335 ±2ppm Automotive Real-Time Clock with Integrated MEMS Resonator. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Link: https://lore.kernel.org/r/20231120120114.48657-2-antoniu.miclaus@analog.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-08rtc: lpc24xx: add missing dependencyAntoniu Miclaus1-0/+1
The driver depends on COMMON_CLK. Add the dependency in Kconfig. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Link: https://lore.kernel.org/r/20231114114532.37840-1-antoniu.miclaus@analog.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-08rtc: tps6594: Add driver for TPS6594 RTCEsteban Blanc1-0/+12
TPS6594 PMIC is a MFD. This patch adds support for the RTC found inside TPS6594 family of PMIC. Alarm is also supported. Signed-off-by: Esteban Blanc <eblanc@baylibre.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://lore.kernel.org/r/20231107094701.2223486-1-eblanc@baylibre.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-12-17rtc: Add driver for Nuvoton ma35d1 rtc controllerJacky Huang1-0/+11
The ma35d1 rtc controller provides real-time and calendar messaging capabilities. It supports programmable time tick and alarm match interrupts. The time and calendar messages are expressed in BCD format. This driver supports the built-in rtc controller of the ma35d1. It enables setting and reading the rtc time and configuring and reading the rtc alarm. Signed-off-by: Jacky Huang <ychuang3@nuvoton.com> Link: https://lore.kernel.org/r/20230925070251.28-4-ychuang570808@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-10-16rtc: Add support for the SSD202D RTCRomain Perier1-0/+11
Newer SigmaStar SSD202D SoCs contain a Real Time Clock, capable of running while the system is sleeping (battery powered), this is not the case with the other RTC on older SoCs. This adds basic support for this RTC block. Signed-off-by: Romain Perier <romain.perier@gmail.com> Co-developed-by: Daniel Palmer <daniel@0x0f.com> Signed-off-by: Daniel Palmer <daniel@0x0f.com> Link: https://lore.kernel.org/r/20230913151606.69494-2-romain.perier@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-10-13rtc: imxdi: Soften dependencies for improved compile coverageUwe Kleine-König1-1/+1
The driver compiles fine on x86_64, so soften the dependencies to ARCH_MXC || COMPILE_TEST. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231002080529.2535610-2-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-07-27rtc: bq4802: add sparc dependencyArnd Bergmann1-0/+1
The added HAS_IOPORT dependency might not actually be necessary as Geert points out, but the driver is also only used on one architecture. Sparc is also a special case here since it converts port numbers into virtual addresses rather than having them mapped into a particular part of the __iomem address space, so the difference is actually not important here. Add a dependency on sparc, but allow compile-testing otherwise, to make this clearer without anyone having to spend much time modernizing the driver beyond that. Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: David S. Miller <davem@davemloft.net> Link: https://lore.kernel.org/all/CAMuHMdWEx0F=fNei4Bz_JPkuvoaN-+zk08h0i8KnSi_VjO615g@mail.gmail.com/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230719192835.1025406-1-arnd@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-07-27rtc: pcf2127: add support for PCF2131 RTCHugo Villeneuve1-2/+2
This RTC is very similar in functionality to the PCF2127/29. Basically it: -supports two new control registers at offsets 4 and 5 -supports a new reset register (not implemented in this driver) -supports 4 tamper detection functions instead of 1 -has no nvmem (like the PCF2129) -has two output interrupt pins Because of that, most of the register addresses are very different, although they still follow the same layout. For example, the tamper registers have a different base address, but the offsets are all the same. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20230622145800.2442116-12-hugo@hugovil.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-07-03Merge tag 'rtc-6.5' of ↵Linus Torvalds1-11/+16
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "The isl1208 dirver was reworked tobe able to work as part of an MFD. All the Loongson chips are now supported through a new driver, the old one is removed. Summary: Subsystem: - Switch i2c drivers back to use .probe() - Constify pointers to hwmon_channel_info New driver: - Loongson on chip RTC, replacing the Loongson 1 only driver Drivers: - isl1208: cleanup and support for RAA215300 - st-lpc: cleanups - stm32: fix wakeup" * tag 'rtc-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (21 commits) rtc: Add rtc driver for the Loongson family chips rtc: Remove the Loongson-1 RTC driver dt-bindings: rtc: Split loongson,ls2x-rtc into SoC-based compatibles rtc: rv3028: make rv3028 probeable from userspace rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300 rtc: isl1208: Add isl1208_set_xtoscb() rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[] rtc: isl1208: Make similar I2C and DT-based matching table rtc: isl1208: Drop name variable dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties dt-bindings: rtc: isl1208: Convert to json-schema rtc: st-lpc: Simplify clk handling in st_rtc_probe() rtc: st-lpc: Release some resources in st_rtc_probe() in case of error rtc: stm32: remove dedicated wakeup management dt-bindings: rtc: restrict node name suffixes rtc: add HAS_IOPORT dependencies rtc: Switch i2c drivers back to use .probe() rtc: rv3032: constify pointers to hwmon_channel_info rtc: isl12022: constify pointers to hwmon_channel_info rtc: ds3232: constify pointers to hwmon_channel_info ...
2023-06-26rtc: Add rtc driver for the Loongson family chipsBinbin Zhou1-0/+13
The Loongson family chips use an on-chip counter 0 (Time Of Year counter) as the RTC. We will refer to them as rtc-loongson. Cc: Keguang Zhang <keguang.zhang@gmail.com> Cc: Yang Ling <gnaygnil@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@kernel.org> Signed-off-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Keguang Zhang <keguang.zhang@gmail.com> Tested-by: Keguang Zhang <keguang.zhang@gmail.com> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com> # LS7A Link: https://lore.kernel.org/r/0c5171156390f614d72f36ceb04a20f432ca639e.1685693501.git.zhoubinbin@loongson.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-06-26rtc: Remove the Loongson-1 RTC driverBinbin Zhou1-10/+0
Remove the ls1x-rtc driver as it is obsolete. We will continue to support the ls1x RTC in the upcoming Loongson unified RTC driver rtc-loongson. Cc: Keguang Zhang <keguang.zhang@gmail.com> Cc: zhao zhang <zhzhl555@gmail.com> Cc: Yang Ling <gnaygnil@gmail.com> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Acked-by: Keguang Zhang <keguang.zhang@gmail.com> Link: https://lore.kernel.org/r/c38c666015a162d7031b20a48209ce577bab62cd.1685693501.git.zhoubinbin@loongson.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-06-06rtc: add HAS_IOPORT dependenciesNiklas Schnelle1-1/+3
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Acked-by: Maciej W. Rozycki <macro@orcam.me.uk> Link: https://lore.kernel.org/r/20230522105049.1467313-31-schnelle@linux.ibm.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-05-15mfd: rk808: Split into core and i2cSebastian Reichel1-1/+1
Split rk808 into a core and an i2c part in preparation for SPI support. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> # for RTC Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-6-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
2023-03-17rtc: mpfs: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIREConor Dooley1-1/+1
As part of converting RISC-V SOC_FOO symbols to ARCH_FOO to match the use of such symbols on other architectures, convert the Microchip FPGA RTC driver to use the new symbol. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230309204452.969574-5-conor@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-03-03Merge tag 'rtc-6.3' of ↵Linus Torvalds1-1/+13
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "A few drivers got some nice cleanups and a new driver are making the bulk of the changes. Subsystem: - allow rtc_read_alarm without read_alarm callback New driver: - NXP BBNSM module RTC Drivers: - use IRQ flags from fwnode when available - abx80x: nvmem support - brcmstb-waketimer: add non-wake alarm support - ingenic: provide CLK32K clock - isl12022: cleanups - moxart: switch to using gpiod API - pcf85363: allow setting quartz load - pm8xxx: cleanups and support for setting time - rv3028, rv3032: add ACPI support" * tag 'rtc-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (64 commits) rtc: pm8xxx: add support for nvmem offset dt-bindings: rtc: qcom-pm8xxx: add nvmem-cell offset rtc: abx80x: Add nvmem support rtc: rx6110: Remove unused of_gpio,h rtc: efi: Avoid spamming the log on RTC read failure rtc: isl12022: sort header inclusion alphabetically rtc: isl12022: Join string literals back rtc: isl12022: Drop unneeded OF guards and of_match_ptr() rtc: isl12022: Explicitly use __le16 type for ISL12022_REG_TEMP_L rtc: isl12022: Get rid of unneeded private struct isl12022 rtc: pcf85363: add support for the quartz-load-femtofarads property dt-bindings: rtc: nxp,pcf8563: move pcf85263/pcf85363 to a dedicated binding rtc: allow rtc_read_alarm without read_alarm callback rtc: rv3032: add ACPI support rtc: rv3028: add ACPI support rtc: bbnsm: Add the bbnsm rtc support rtc: jz4740: Register clock provider for the CLK32K pin rtc: jz4740: Use dev_err_probe() rtc: jz4740: Use readl_poll_timeout dt-bindings: rtc: Add #clock-cells property ...
2023-02-22rtc: bbnsm: Add the bbnsm rtc supportJacky Bai1-0/+12
The BBNSM module includes a real time counter with alarm. Add a RTC driver for this function. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20230215024117.3357341-3-ping.bai@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-02-09rtc: jz4740: Register clock provider for the CLK32K pinPaul Cercueil1-1/+1
On JZ4770 and JZ4780, the CLK32K pin is configurable. By default, it is configured as a GPIO in input mode, and its value can be read through GPIO PD14. With this change, clients can now request the 32 kHz clock on the CLK32K pin, through Device Tree. This clock is simply a pass-through of the input oscillator's clock with enable/disable operations. This will permit the WiFi/Bluetooth chip to work on the MIPS CI20 board, which does source one of its clocks from the CLK32K pin. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20230129120442.22858-5-paul@crapouillou.net Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-02-01rtc: remove v3020 driverArnd Bergmann1-9/+0
The v3020 RTC driver was exclusively used by the now removed cm-x300.c machine. Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: linux-kernel@vger.kernel.org Cc: linux-rtc@vger.kernel.org Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-16ARM: s3c: remove s3c24xx specific hacksArnd Bergmann1-6/+2
A number of device drivers reference CONFIG_ARM_S3C24XX_CPUFREQ or similar symbols that are no longer available with the platform gone, though the drivers themselves are still used on newer platforms, so remove these hacks. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-12-21Merge tag 'mfd-next-6.2' of ↵Linus Torvalds1-6/+0
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add support for Ampere Computing SMpro - Add support for TI TPS65219 PMIC New Functionality: - Add support for multiple devices of the same type; rk808 Fix-ups: - Convert a bunch of I2C class drivers over to .probe_new() - Remove superfluous includes; mc13xxx-*, palmas, timberdale - Use correct includes for GPIO handling; madera-core - Convert to GPIOD; twl6040 - Remove unused platform data handling; twl6040 - Device Tree changes; many - Remove unused drivers; dm355evm_msp, davinci_voicecodec, htc-i2cpld - Add support for modules; palmas - Enable COMPILE_TEST support; intel_soc_pmic* - Trivial: spelling / whitespace fixes; mc13xxx-spi - Replace old PM helpers with new ones; many - Convert deprecated mask_invert usage to unmask_base; many - Use devm_*() calls; qcom_rpm - MAINTAINER fix-ups - Make use of improved / replaced APIs; palmas, fsl-imx25-tsadc, stm32-lptimer, qcom_rpm, rohm-* Bug Fixes: - Add bounds / error checking; mt6360-core - No sleeping inside critical sections; axp20x - Fix missing dependencies; ROHM_BD957XMUF - Repair error paths; qcom-pm8008" * tag 'mfd-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (161 commits) dt-bindings: mfd: da9062: Correct file name for watchdog mfd: pm8008: Fix return value check in pm8008_probe() mfd: rohm: Use dev_err_probe() mfd: Drop obsolete dependencies on COMPILE_TEST dt-bindings: mfd: da9062: Move IRQ to optional properties mfd: qcom_rpm: Use devm_of_platform_populate() to simplify code mfd: qcom_rpm: Fix an error handling path in qcom_rpm_probe() mfd: stm32-lptimer: Use devm_platform_get_and_ioremap_resource() mfd: rohm-bd9576: Convert to i2c's .probe_new() mfd: fsl-imx25-tsadc: Use devm_platform_get_and_ioremap_resource() dt-bindings: Fix maintainer email for a few ROHM ICs mfd: palmas: Use device_get_match_data() to simplify the code Input: Add tps65219 interrupt driven powerbutton mfd: tps65219: Add driver for TI TPS65219 PMIC mfd: bd957x: Fix Kconfig dependency on REGMAP_IRQ mfd: wcd934x: Convert irq chip to config regs mfd: tps65090: Replace irqchip mask_invert with unmask_base mfd: sun4i-gpadc: Replace irqchip mask_invert with unmask_base mfd: stpmic1: Fix swapped mask/unmask in irq chip mfd: sprd-sc27xx-spi: Replace irqchip mask_invert with unmask_base ...
2022-12-15rtc: isl12026: drop obsolete dependency on COMPILE_TESTJean Delvare1-1/+1
Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20221124154359.039be06c@endymion.delvare Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-12-07mfd: Remove dm355evm_msp driverArnd Bergmann1-6/+0
The DaVinci DM355EVM platform is gone after the removal of all unused board files, so the MTD device along with its sub-devices can be removed as well. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221019152947.3857217-7-arnd@kernel.org
2022-11-15rtc: remove davinci rtc driverArnd Bergmann1-10/+0
The Davinci dm365 SoC support was removed, so the rtc driver has no remaining users. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Acked-by: Marc Zyngier <maz@kernel.org> Acked-by: Kevin Hilman <khilman@baylibre.com> Link: https://lore.kernel.org/r/20221019152947.3857217-9-arnd@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-10-13rtc: isl12022: switch to using regmap APIRasmus Villemoes1-0/+1
The regmap abstraction allows us to avoid the private i2c transfer helpers, and also offers some nice utility functions such as the regmap_update_bits family. While at it, simplify the code even more by not keeping track of ->write_enabled: rtc_set_time is not a hot path, so one extra i2c read doesn't hurt (regmap_update_bits elides the write when the bits are already as desired). Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Link: https://lore.kernel.org/r/20220921114624.3250848-9-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-07-26rtc: Add NCT3018Y real time clock driverMia Lin1-0/+10
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
2022-07-26rtc: vr41xx: remove driverThomas Bogendoerfer1-10/+0
Commit d3164e2f3b0a ("MIPS: Remove VR41xx support") removed support for MIPS VR41xx platform, so remove exclusive drivers for this platform, too. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220715135330.134684-1-tsbogend@alpha.franken.de
2022-06-24rtc: Introduce ti-k3-rtcNishanth Menon1-0/+11
Introduce support for Texas Instruments Real Time Clock controller on newer K3 family of SoCs such as AM62x. The hardware module that is being supported is the "digital only" version which doesn't have capability of external wakeup sources and external power backup. However, for many practical applications, this should suffice as RTC is operational across low power sequences. The hardware block by itself is split into two distinct domains internally to further reduce the power consumption with the actual counter block and comparators clocked off a 32k clock source (which based on SoC integration can be sourced by an external crystal) and an register interface block which is driven by the bus clock. While optimal from power perspective, it does create some complicated synchronizations and sequences that one must be wary of in the driver handling. Acked-by: Andrew Davis <afd@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Tested-by: Georgi Vlaev <g-vlaev@ti.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220623170808.20998-3-nm@ti.com
2022-06-24rtc: Add driver for Microchip PolarFire SoCConor Dooley1-0/+10
Add support for the built-in RTC on Microchip PolarFire SoC Co-Developed-by: Daire McNamara <daire.mcnamara@microchip.com> Signed-off-by: Daire McNamara <daire.mcnamara@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220601123320.2861043-2-conor.dooley@microchip.com
2022-05-17rtc: rzn1: Add new RTC driverMichel Pollet1-0/+7
Add a basic RTC driver for the RZ/N1. Signed-off-by: Michel Pollet <michel.pollet@bp.renesas.com> Co-developed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220516082504.33913-3-miquel.raynal@bootlin.com
2022-04-01Merge tag 'rtc-5.18' of ↵Linus Torvalds1-0/+10
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "The bulk of the patches are about replacing the uie_unsupported struct rtc_device member by a feature bit. Subsystem: - remove uie_unsupported, all users have been converted to clear RTC_FEATURE_UPDATE_INTERRUPT and provide a reason - RTCs with an alarm with a resolution of a minute are now letting the core handle rounding down the alarm time - fix use-after-free on device removal New driver: - OP-TEE RTC PTA Drivers: - sun6i: Add H616 support - cmos: Fix the AltCentury for AMD platforms - spear: set range" * tag 'rtc-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (56 commits) rtc: check if __rtc_read_time was successful rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram rtc: mc146818-lib: Fix the AltCentury for AMD platforms rtc: optee: add RTC driver for OP-TEE RTC PTA rtc: pm8xxx: Return -ENODEV if set_time disallowed rtc: pm8xxx: Attach wake irq to device clk: sunxi-ng: sun6i-rtc: include clk/sunxi-ng.h rtc: remove uie_unsupported rtc: xgene: stop using uie_unsupported rtc: hym8563: switch to RTC_FEATURE_UPDATE_INTERRUPT rtc: hym8563: let the core handle the alarm resolution rtc: hym8563: switch to devm_rtc_allocate_device rtc: efi: switch to RTC_FEATURE_UPDATE_INTERRUPT rtc: efi: switch to devm_rtc_allocate_device rtc: add new RTC_FEATURE_ALARM_WAKEUP_ONLY feature rtc: spear: fix spear_rtc_read_time rtc: spear: drop uie_unsupported rtc: spear: set range rtc: spear: switch to devm_rtc_allocate_device rtc: pcf8563: switch to RTC_FEATURE_UPDATE_INTERRUPT ...
2022-03-25rtc: optee: add RTC driver for OP-TEE RTC PTAClément Léger1-0/+10
This drivers allows to communicate with a RTC PTA handled by OP-TEE [1]. This PTA allows to query RTC information, set/get time and set/get offset depending on the supported features. [1] https://github.com/OP-TEE/optee_os/pull/5179 Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220308133505.471601-1-clement.leger@bootlin.com
2022-03-07rtc: max77686: Add MAX77714 supportLuca Ceresoli1-1/+1
The RTC included in the MAX77714 PMIC is very similar to the one in the MAX77686. Reuse the rtc-max77686.c driver with the minimum required changes for the MAX77714 RTC. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2022-01-05rtc: Add driver for RTC in Sunplus SP7021Vincent Shih1-0/+13
Add driver for RTC in Sunplus SP7021 Signed-off-by: Vincent Shih <vincent.sunplus@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/1638517579-10316-2-git-send-email-vincent.sunplus@gamil.com
2021-12-16rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii UEmmanuel Gil Peyrot1-0/+11
These three consoles share a device, the MX23L4005, which contains a clock and 64 bytes of SRAM storage, and is exposed on the EXI bus (similar to SPI) on channel 0, device 1. This driver allows it to be used as a Linux RTC device, where time can be read and set. The hardware also exposes two timers, one which shuts down the console and one which powers it on, but these aren’t supported currently. On the Wii U, the counter bias is stored in a XML file, /config/rtc.xml, encrypted in the SLC (eMMC storage), using a proprietary filesystem. In order to avoid having to implement all that, this driver assumes a bootloader will parse this XML file and write the bias into the SRAM, at the same location the other two consoles have it. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211215175501.6761-2-linkmauve@linkmauve.fr
2021-11-12Merge tag 'rtc-5.16' of ↵Linus Torvalds1-8/+11
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "This includes new ioctls to get and set parameters and in particular the backup switch mode that is needed for some RTCs to actually enable the backup voltage (and have a useful RTC). The same interface can also be used to get the actual features supported by the RTC so userspace has a better way than trying and failing. Summary: Subsystem: - Add new ioctl to get and set extra RTC parameters, this includes backup switch mode - Expose available features to userspace, in particular, when alarmas have a resolution of one minute instead of a second. - Let the core handle those alarms with a minute resolution New driver: - MSTAR MSC313 RTC Drivers: - Add SPI ID table where necessary - Add BSM support for rv3028, rv3032 and pcf8523 - s3c: set RTC range - rx8025: set range, implement .set_offset and .read_offset" * tag 'rtc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (50 commits) rtc: rx8025: use .set_offset/.read_offset rtc: rx8025: use rtc_add_group rtc: rx8025: clear RTC_FEATURE_ALARM when alarm are not supported rtc: rx8025: set range rtc: rx8025: let the core handle the alarm resolution rtc: rx8025: switch to devm_rtc_allocate_device rtc: ab8500: let the core handle the alarm resolution rtc: ab-eoz9: support UIE when available rtc: ab-eoz9: use RTC_FEATURE_UPDATE_INTERRUPT rtc: rv3032: let the core handle the alarm resolution rtc: s35390a: let the core handle the alarm resolution rtc: handle alarms with a minute resolution rtc: pcf85063: silence cppcheck warning rtc: rv8803: fix writing back ctrl in flag register rtc: s3c: Add time range rtc: s3c: Extract read/write IO into separate functions rtc: s3c: Remove usage of devm_rtc_device_register() rtc: tps80031: Remove driver rtc: sun6i: Allow probing without an early clock provider rtc: pcf8523: add BSM support ...
2021-10-23rtc: tps80031: Remove driverDmitry Osipenko1-8/+0
Driver was upstreamed in 2013 and never got a user, remove it. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211021192258.21968-2-digetx@gmail.com
2021-10-18rtc: pcf8523: switch to regmapAlexandre Belloni1-0/+1
Use regmap to access the RTC registers, this is a huge reduction in code lines and generated code. Values on ARMv7: text data bss dec hex 5180 132 0 5312 14c0 before 3900 132 0 4032 fc0 after Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211018153651.82069-1-alexandre.belloni@bootlin.com
2021-10-17rtc: s3c: remove HAVE_S3C_RTC in favor of direct dependenciesWill McVicker1-8/+2
The config HAVE_S3C_RTC is not really needed since we can simply just add the dependencies directly to RTC_DRV_S3C. Also, one less config to keep track of! Signed-off-by: Will McVicker <willmcvicker@google.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211013212256.3425889-1-willmcvicker@google.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
2021-09-26rtc: Add support for the MSTAR MSC313 RTCDaniel Palmer1-0/+10
This adds support for the RTC block on the Mstar MSC313e SoCs and newer. Signed-off-by: Daniel Palmer <daniel@0x0f.com> Co-developed-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Romain Perier <romain.perier@gmail.com> Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210823171613.18941-3-romain.perier@gmail.com
2021-09-09rtc: rx8010: select REGMAP_I2CYu-Tung Chang1-0/+1
The rtc-rx8010 uses the I2C regmap but doesn't select it in Kconfig so depending on the configuration the build may fail. Fix it. Signed-off-by: Yu-Tung Chang <mtwget@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210830052532.40356-1-mtwget@gmail.com
2021-08-10rtc: move RTC_LIB_KUNIT_TEST to proper locationAlexandre Belloni1-10/+9
Move RTC_LIB_KUNIT_TEST under RTC_LIB so it is clear in the menu this is part of the RTC subsystem. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210810212008.631359-2-alexandre.belloni@bootlin.com
2021-08-10rtc: Improve performance of rtc_time64_to_tm(). Add tests.Cassio Neri1-0/+10
The current implementation of rtc_time64_to_tm() contains unnecessary loops, branches and look-up tables. The new one uses an arithmetic-based algorithm appeared in [1] and is approximately 4.3 times faster (YMMV). The drawback is that the new code isn't intuitive and contains many 'magic numbers' (not unusual for this type of algorithm). However, [1] justifies all those numbers and, given this function's history, the code is unlikely to need much maintenance, if any at all. Add a KUnit test case that checks every day in a 160,000 years interval starting on 1970-01-01 against the expected result. Add a new config RTC_LIB_KUNIT_TEST symbol to give the option to run this test suite. [1] Neri, Schneider, "Euclidean Affine Functions and Applications to Calendar Algorithms". https://arxiv.org/abs/2102.06959 Signed-off-by: Cassio Neri <cassio.neri@gmail.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210624201343.85441-1-cassio.neri@gmail.com
2021-06-20rtc: bd70528: Drop BD70528 supportMatti Vaittinen1-4/+3
The only known BD70528 use-cases are such that the PMIC is controlled from separate MCU which is not running Linux. I am not aware of any Linux driver users. Furthermore, it seems there is no demand for this IC. Let's ease the maintenance burden and drop the driver. We can always add it back if there is sudden need for it. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210527105819.GA3111334@localhost.localdomain
2021-05-25rtc: bd70528: fix BD71815 watchdog dependencyArnd Bergmann1-1/+2
The added Kconfig dependency is slightly incorrect, which can lead to a link failure when the watchdog is a loadable module: arm-linux-gnueabi-ld: drivers/rtc/rtc-bd70528.o: in function `bd70528_set_rtc_based_timers': rtc-bd70528.c:(.text+0x6cc): undefined reference to `bd70528_wdt_set' arm-linux-gnueabi-ld: drivers/rtc/rtc-bd70528.o: in function `bd70528_set_time': rtc-bd70528.c:(.text+0xaa0): undefined reference to `bd70528_wdt_lock' arm-linux-gnueabi-ld: rtc-bd70528.c:(.text+0xab8): undefined reference to `bd70528_wdt_unlock' arm-linux-gnueabi-ld: drivers/rtc/rtc-bd70528.o: in function `bd70528_alm_enable': rtc-bd70528.c:(.text+0xfc0): undefined reference to `bd70528_wdt_lock' arm-linux-gnueabi-ld: rtc-bd70528.c:(.text+0x1030): undefined reference to `bd70528_wdt_unlock' The problem is that it allows to be built-in if MFD_ROHM_BD71828 is built-in, even when the watchdog is a loadable module. Rework this so that having the watchdog as a loadable module always forces the rtc to be a module as well instead of built-in, regardless of bd71828. Fixes: c56dc069f268 ("rtc: bd70528: Support RTC on ROHM BD71815") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210422151545.2403356-1-arnd@kernel.org
2021-05-03Merge tag 'rtc-5.13' of ↵Linus Torvalds1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Mostly small fixes and two drivers gaining alarm support. Summary: Subsystem: - UIE emulation has been reworked to avoid calling driver callbacks when it is known it will not work Drivers: - ab-eoz9: add alarm support - pcf8523: add alarm support" * tag 'rtc-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (27 commits) rtc: sysfs: check features instead of ops rtc: omap: use rtc_write to access OMAP_RTC_OSC_REG rtc: s5m: Remove reference to parent's device pdata rtc: ds1307: Fix wday settings for rx8130 rtc: pcf8523: report oscillator failures rtc: pcf8523: add alarm support rtc: pcf8523: remove useless define rtc: rtc_update_irq_enable: rework UIE emulation rtc: ds1307: remove flags rtc: ds1307: replace HAS_ALARM by RTC_FEATURE_ALARM rtc: imx-sc: remove .read_alarm rtc: ds1511: remove unused function rtc: fsl-ftm-alarm: add MODULE_TABLE() rtc: rtc-spear: replace spin_lock_irqsave by spin_lock in hard IRQ dt-bindings: rtc: qcom-pm8xxx-rtc: Add qcom pm8xxx rtc bindings rtc: pm8xxx: Add RTC support for PMIC PMK8350 rtc: ab-eoz9: make use of RTC_FEATURE_ALARM rtc: ab-eoz9: add alarm support rtc: ab-eoz9: set regmap max_register rtc: pcf85063: fallback to parent of_node ...
2021-04-16rtc: goldfish: remove dependency to OFLaurent Vivier1-1/+1
We want to use the goldfish RTC on a machine without OF. As there is no real dependency on it, remove the OF dependency from the goldfish entry in Kconfig Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210323221430.3735147-2-laurent@vivier.eu
2021-04-14Merge tags 'ib-mfd-clk-gpio-regulator-rtc-v5.13', 'ib-mfd-extcon-v5.13', ↵Lee Jones1-0/+8
'ib-mfd-input-v5.13-1', 'ib-mfd-platform-x86-v5.13', 'ib-mfd-power-v5.13', 'ib-mfd-pwm-rtc-v5.13-1' and 'ib-regulator-list-ramp-helpers-v5.13' into ibs-for-mfd-merged Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window Immutable branch between MFD and Extcon due for the v5.13 merge window Immutable branch between MFD and Input due for the v5.13 merge window Immutable branch between MFD and Platform/x86 due for the v5.13 merge window Immutable branch between MFD and Power due for the v5.13 merge window Immutable branch between MFD, PWM and RTC due for the v5.13 merge window
2021-04-14rtc: bd70528: Support RTC on ROHM BD71815Matti Vaittinen1-3/+3
BD71815 contains similar RTC block as BD71828. Only the address offsets seem different. Support also BD71815 RTC using rtc-bd70528. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-03-15rtc: imxdi: Convert to a DT-only driverFabio Estevam1-0/+1
i.MX has been converted to a DT-only platform, so make the driver depend on OF, remove the CONFIG_OF ifdefery and remove of_match_ptr(). Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210315172029.173250-1-festevam@gmail.com
2021-03-10rtc: New driver for RTC in Netronix embedded controllerJonathan Neuschäfer1-0/+8
With this driver, mainline Linux can keep its time and date in sync with the vendor kernel. Advanced functionality like alarm and automatic power-on is not yet supported. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-02-22Merge tag 'rtc-5.12' of ↵Linus Torvalds1-35/+3
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Many cleanups and a few drivers removal this cycle. Subsystem: - Introduce features bitfield and the first feature: RTC_FEATURE_ALARM Removed drivers: - ab3100 - coh901331 - tx4939 - sirfsoc Drivers: - use rtc_lock and rtc_unlock instead of opencoding - constify all struct rtc_class_ops - quiet maybe-unused variable warning - replace spin_lock_irqsave with spin_lock in hard IRQ - pcf2127: disable Power-On Reset Override and run OTP refresh" * tag 'rtc-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (81 commits) rtc: abx80x: Add utility function for writing configuration key rtc: pcf2127: properly set flag WD_CD for rtc chips(pcf2129, pca2129) rtc: pcf8563: Add NXP PCA8565 compatible rtc: s3c: quiet maybe-unused variable warning rtc: s3c: stop setting bogus time rtc: sd3078: quiet maybe-unused variable warning rtc: s35390a: quiet maybe-unused variable warning rtc: rx8581: quiet maybe-unused variable warning rtc: rx8010: quiet maybe-unused variable warning rtc: rv8803: quiet maybe-unused variable warning rtc: rv3032: quiet maybe-unused variable warning rtc: rv3029: quiet maybe-unused variable warning rtc: rv3028: quiet maybe-unused variable warning rtc: rs5c372: quiet maybe-unused variable warning rtc: pcf85363: quiet maybe-unused variable warning rtc: pcf85063: quiet maybe-unused variable warnings rtc: meson: quiet maybe-unused variable warning rtc: m41t80: quiet maybe-unused variable warning rtc: isl1208: quiet maybe-unused variable warning rtc: ds3232: quiet maybe-unused variable warning ...
2021-02-06rtc: armada38x: depend on OFAlexandre Belloni1-0/+1
The driver will compile with warning without OF because armada38x_data and armada8k_data will be defined but not used. It would be possible to move then in the #ifdef CONFIG_OF section but then their members will be defined but not used. Instead of moving most of the driver in the #ifdef, simply depend on OF. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210202112219.3610853-3-alexandre.belloni@bootlin.com
2021-02-03rtc: zynqmp: depend on HAS_IOMEMDavid Gow1-1/+1
The Xilinx zynqmp RTC driver makes use of IOMEM functions like devm_platform_ioremap_resource(), which are only available if CONFIG_HAS_IOMEM is defined. This causes the driver not to be enable under make ARCH=um allyesconfig, even though it won't build. By adding a dependency on HAS_IOMEM, the driver will not be enabled on architectures which don't support it. Fixes: 09ef18bcd5ac ("rtc: use devm_platform_ioremap_resource() to simplify code") Signed-off-by: David Gow <davidgow@google.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210127035146.1523286-1-davidgow@google.com
2021-01-25rtc: mrst: Remove driver for deprecated platformAndy Shevchenko1-12/+0
Intel Moorestown and Medfield are quite old Intel Atom based 32-bit platforms, which were in limited use in some Android phones, tablets and consumer electronics more than eight years ago. There are no bugs or problems ever reported outside from Intel for breaking any of that platforms for years. It seems no real users exists who run more or less fresh kernel on it. The commit 05f4434bc130 ("ASoC: Intel: remove mfld_machine") also in align with this theory. Due to above and to reduce a burden of supporting outdated drivers we remove the support of outdated platforms completely. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-01-23rtc: remove ste ab3100 driverArnd Bergmann1-8/+0
The ST-Ericsson U300 platform is getting removed, so this driver is no longer needed. Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210120154158.1860736-4-arnd@kernel.org
2021-01-23rtc: remove ste coh901 driverArnd Bergmann1-12/+0
The ST-Ericsson U300 platform is getting removed, so this driver is no longer needed. Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210120154158.1860736-3-arnd@kernel.org
2021-01-23rtc: remove sirfsoc driverArnd Bergmann1-7/+0
The CSR SiRF prima2/atlas platforms are getting removed, so this driver is no longer needed. Cc: Barry Song <baohua@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Barry Song <baohua@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210120154158.1860736-2-arnd@kernel.org
2021-01-16rtc: s5m: select REGMAP_I2CBartosz Golaszewski1-0/+1
The rtc-s5m uses the I2C regmap but doesn't select it in Kconfig so depending on the configuration the build may fail. Fix it. Fixes: 959df7778bbd ("rtc: Enable compile testing for Maxim and Samsung drivers") Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210114102219.23682-2-brgl@bgdev.pl
2021-01-13rtc: tx4939: Remove driverThomas Bogendoerfer1-7/+0
CPU support for TX49xx is getting removed, so remove rtc driver for it. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210105140305.141401-9-tsbogend@alpha.franken.de
2020-12-03rtc: mxc{,_v2}: enable COMPILE_TESTAlexandre Belloni1-2/+6
Extend code coverage for the rtc-mxc and rtc-mxc-v2 drivers. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20201121224529.568237-1-alexandre.belloni@bootlin.com
2020-12-03rtc: enable RTC framework on ARCH=umJohannes Berg1-1/+3
There's no real reason it should be disabled, and at least we can use it for development & testing with the RTC test driver. However, two devices are missing a HAS_IOMEM dependency, so add that to avoid build failures from e.g. allyesconfig. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201120211103.6895ac740d11.Ic19a9926e8e4c70c03329e55f9e5b1d45095b904@changeid
2020-11-17rtc: rx6110: add i2c supportClaudius Heine1-9/+11
The RX6110 also supports I2C, so this patch adds support for it to the driver. This also renames the SPI specific functions and variables to include `_spi_` in their names. Signed-off-by: Claudius Heine <ch@denx.de> Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201117121817.953924-3-ch@denx.de
2020-11-17rtc: Kconfig: Fix typo in help message of rx 6110Claudius Heine1-1/+1
The help message in the Kconfig for the RX-6110 erronously stated RX-6610. Signed-off-by: Claudius Heine <ch@denx.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201117121817.953924-2-ch@denx.de
2020-11-15rtc: goldfish: Remove GOLDFISH dependencyJiaxun Yang1-1/+0
Goldfish platform is covered with dust. However the goldfish-rtc had been used as virtualized RTC in QEMU for RISC-V virt hw and MIPS loongson3-virt hw, thus we can drop other parts of goldfish but leave goldfish-rtc here. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201114130921.651882-2-jiaxun.yang@flygoat.com
2020-10-19rtc: rv3032: Add a driver for Microcrystal RV-3032Alexandre Belloni1-0/+10
New driver for the Microcrystal RV-3032, including support for: - Date/time - Alarms - Low voltage detection - Trickle charge - Trimming - Clkout - RAM - EEPROM - Temperature sensor Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201013144110.1942218-3-alexandre.belloni@bootlin.com
2020-08-12Merge tag 'rtc-5.9' of ↵Linus Torvalds1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Not much this cycle - mostly non urgent driver fixes: - ds1374: use watchdog core - pcf2127: add alarm and pcf2129 support" * tag 'rtc-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: pcf2127: fix alarm handling rtc: pcf2127: add alarm support rtc: pcf2127: add pca2129 device id rtc: max77686: Fix wake-ups for max77620 rtc: ds1307: provide an indication that the watchdog has fired rtc: ds1374: remove unused define rtc: ds1374: fix RTC_DRV_DS1374_WDT dependencies rtc: cleanup obsolete comment about struct rtc_class_ops rtc: pl031: fix set_alarm by adding back call to alarm_irq_enable rtc: ds1374: wdt: Use watchdog core for watchdog part rtc: Replace HTTP links with HTTPS ones rtc: goldfish: Enable interrupt in set_alarm() when necessary rtc: max77686: Do not allow interrupt to fire before system resume rtc: imxdi: fix trivial typos rtc: cpcap: fix range
2020-07-21rtc: ds1374: fix RTC_DRV_DS1374_WDT dependenciesAlexandre Belloni1-2/+2
It is not enough to select WATCHDOG_CORE, the watchdog part of the driver now also depends on WATCHDOG. This is currently the best we can do because alarm support and watchdog support are mutually exclusive. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Link: https://lore.kernel.org/r/20200720075250.1019172-1-alexandre.belloni@bootlin.com
2020-07-16rtc: ds1374: wdt: Use watchdog core for watchdog partJohnson CH Chen (陳昭勳)1-0/+1
Let ds1374 watchdog use watchdog core functions. It also includes improving watchdog timer setting and nowayout, and just uses ioctl() of watchdog core. Signed-off-by: Johnson Chen <johnsonch.chen@moxa.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/HK2PR01MB328182D5A54BFAA8A22E448AFA640@HK2PR01MB3281.apcprd01.prod.exchangelabs.com
2020-07-01rtc: remove fb-puv3 driverMike Rapoport1-9/+0
The unicore32 port is removed from the kernel. There is no point to keep stale RTC driver for this architecture. Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Guenter Roeck <linux@roeck-us.net>
2020-06-07Merge tag 'rtc-5.8' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Not much this cycle apart from the ingenic rtc driver rework. The fixes are mainly minor issues reported by coccinelle rather than real world issues. Subsystem: - new VL flag for backup switch over Drivers: - ingenic: only support device tree - pcf2127: report battery switch over, handle nowayout" * tag 'rtc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (29 commits) rtc: pcf2127: watchdog: handle nowayout feature rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake rtc: abx80x: Provide debug feedback for invalid dt properties rtc: abx80x: Add Device Tree matching table rtc: rv3028: Add missed check for devm_regmap_init_i2c() rtc: mpc5121: Use correct return value for mpc5121_rtc_probe() rtc: goldfish: Use correct return value for goldfish_rtc_probe() rtc: snvs: Add necessary clock operations for RTC APIs rtc: snvs: Make SNVS clock always prepared rtc: ingenic: Reset regulator register in probe rtc: ingenic: Fix masking of error code rtc: ingenic: Remove unused fields from private structure rtc: ingenic: Set wakeup params in probe rtc: ingenic: Enable clock in probe rtc: ingenic: Use local 'dev' variable in probe rtc: ingenic: Only support probing from devicetree rtc: mc13xxx: fix a double-unlock issue rtc: stmp3xxx: update contact email rtc: max77686: Use single-byte writes on MAX77620 rtc: pcf2127: report battery switch over ...
2020-06-01sh: remove sh5 supportArnd Bergmann1-1/+1
sh5 never became a product and has probably never really worked. Remove it by recursively deleting all associated Kconfig options and all corresponding files. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Rich Felker <dalias@libc.org>
2020-05-11rtc: ingenic: Only support probing from devicetreePaul Cercueil1-0/+1
With the recent work on supporting Device Tree on Ingenic SoCs, no driver ever probes from platform code anymore, so we can clean a bit this driver by removing the non-devicetree paths. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20200505221336.222313-1-paul@crapouillou.net Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-04-07Merge tag 'mfd-next-5.7' of ↵Linus Torvalds1-0/+10
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull mfd updates from Lee Jones: "New Drivers: - Add support for IQS620A/621/622/624/625 Azoteq IQS62X Sensors New Device Support: - Add support for ADC, IRQ, Regulator, RTC and WDT to Ricoh RN5T618 PMIC - Add support for Comet Lake to Intel LPSS New Functionality: - Add support for Charger Detection to Spreadtrum SC27xx PMICs - Add support for Interrupt Polarity to Dialog Semi DA9062/61 PMIC - Add ACPI enumeration support to Diolan DLN2 USB Adaptor Fix-ups: - Device Tree; iqs62x, rn5t618, cros_ec_dev, stm32-lptimer, rohm,bd71837, rohm,bd71847 - I2C registration; rn5t618 - Kconfig; MFD_CPCAP, AB8500_CORE, MFD_WM8994, MFD_WM97xx, MFD_STPMIC1 - Use flexible-array members; omap-usb-tll, qcom-pm8xxx - Remove unnecessary casts; omap-usb-host, omap-usb-tll - Power (suspend/resume/poweroff) enhancements; rk808 - Improve error/sanity checking; dln2 - Use snprintf(); aat2870-core Bug Fixes: - Fix PCI IDs in intel-lpss-pci" * tag 'mfd-next-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (33 commits) mfd: intel-lpss: Fix Intel Elkhart Lake LPSS I2C input clock mfd: aat2870: Use scnprintf() for avoiding potential buffer overflow mfd: dln2: Allow to be enumerated via ACPI mfd: da9062: Add support for interrupt polarity defined in device tree dt-bindings: bd718x7: Yamlify and add BD71850 mfd: dln2: Fix sanity checking for endpoints mfd: intel-lpss: Add Intel Comet Lake PCH-V PCI IDs mfd: sc27xx: Add USB charger type detection support dt-bindings: mfd: Document STM32 low power timer bindings mfd: rk808: Convert RK805 to shutdown/suspend hooks mfd: rk808: Reduce shutdown duplication mfd: rk808: Stop using syscore ops mfd: rk808: Ensure suspend/resume hooks always work mfd: rk808: Always use poweroff when requested mfd: omap: Remove useless cast for driver.name mfd: Kconfig: Fix some misspelling of the word functionality mfd: pm8xxx: Replace zero-length array with flexible-array member mfd: omap-usb-tll: Replace zero-length array with flexible-array member mfd: cpcap: Fix compile if MFD_CORE is not selected mfd: cros_ec: Check DT node for usbpd-notify add ...
2020-04-01rtc: ds1307: add support for watchdog timer on ds1388Chris Packham1-0/+1
The DS1388 variant has watchdog timer capabilities. When using a DS1388 and having enabled CONFIG_WATCHDOG_CORE register a watchdog device for the DS1388. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200330025500.6991-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-03-27rtc: rc5t619: Add Ricoh RC5T619 RTC driverAndreas Kemnade1-0/+10
Add an RTC driver for the RTC device on Ricoh MFD RC5T619, which is implemented as a variant of RN5T618. rtc-range output: Testing 2000-02-28 23:59:59. OK Testing 2038-01-19 03:14:07. OK Testing 2069-12-31 23:59:59. OK Testing 2099-12-31 23:59:59. KO RTC_RD_TIME returned 22 (line 138) Testing 2100-02-28 23:59:59. KO RTC_SET_TIME returned 34 (line 122) Testing 2106-02-07 06:28:15. KO RTC_SET_TIME returned 34 (line 122) Testing 2262-04-11 23:47:16. KO RTC_SET_TIME returned 34 (line 122) Signed-off-by: Andreas Kemnade <andreas@kemnade.info> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2020-03-23rtc: class: support hctosys from modular RTC driversSteve Muckle1-3/+0
Due to distribution constraints it may not be possible to statically compile the required RTC driver into the kernel. Expand RTC_HCTOSYS support to cover all RTC devices (statically compiled or not) by checking at the end of RTC device registration whether the time should be synced. Signed-off-by: Steve Muckle <smuckle@google.com> Link: https://lore.kernel.org/r/20191106194625.116692-1-smuckle@google.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-03-23rtc: max8907: add missing select REGMAP_IRQCorentin Labbe1-0/+1
I have hit the following build error: armv7a-hardfloat-linux-gnueabi-ld: drivers/rtc/rtc-max8907.o: in function `max8907_rtc_probe': rtc-max8907.c:(.text+0x400): undefined reference to `regmap_irq_get_virq' max8907 should select REGMAP_IRQ Fixes: 94c01ab6d7544 ("rtc: add MAX8907 RTC driver") Cc: stable <stable@vger.kernel.org> Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Link: https://lore.kernel.org/r/1584545209-20433-1-git-send-email-clabbe@baylibre.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-03-16rtc: add support for the MediaTek MT2712 RTCRan Bi1-0/+10
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 <ran.bi@mediatek.com> Link: https://lore.kernel.org/r/20200226051303.22560-3-ran.bi@mediatek.com Link: https://lore.kernel.org/r/20200316104701.209293-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
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/20200306131629.18837-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
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 <Anson.Huang@nxp.com> Link: https://lore.kernel.org/r/1583136785-4973-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-02-04Merge tag 'rtc-5.6' of ↵Linus Torvalds1-8/+16
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "The VL_READ and VL_CLR ioctls have been reworked to be more useful. This will not break userspace as there are very few users and they are using the integer value as a boolean. Apart from that, two drivers were reworked and a few fixes here and there for a net reduction of number of lines. Summary: Subsystem: - the VL_READ and VL_CLR ioctls are now documented and their behavior is unified across all the drivers. - RTC_I2C_AND_SPI Kconfig option rework to avoid selecting both REGMAP_I2C and REGMAP_SPI unecessarily. Drivers: - at91rm9200: remove deprecated procfs, add sam9x60, sama5d4 and sama5d2 compatibles. - cmos: solve lost interrupts issue on MS Surface 3 - hym8563: return proper errno when time is invalid - rv3029: many fixes, nvram support" * tag 'rtc-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (63 commits) dt-bindings: rtc: at91rm9200: document clocks property rtc: i2c/spi: Avoid inclusion of REGMAP support when not needed rtc: Kconfig: select REGMAP_I2C when necessary rtc: Kconfig: properly indent sd3078 entry rtc: cmos: Refactor code by using the new dmi_get_bios_year() helper rtc: cmos: Use predefined value for RTC IRQ on legacy x86 rtc: cmos: Stop using shared IRQ rtc: tps6586x: Use IRQ_NOAUTOEN flag rtc: at91rm9200: use FIELD_PREP/FIELD_GET rtc: at91rm9200: avoid time readout in at91_rtc_setalarm rtc: at91rm9200: move register definitions to C file rtc: at91rm9200: add sama5d4 and sama5d2 compatibles dt-bindings: rtc: at91rm9200: convert bindings to json-schema rtc: at91rm9200: remove procfs information dt-bindings: atmel, at91rm9200-rtc: add microchip, sam9x60-rtc rtc: pcf8563: Use BIT rtc: moxart: Convert to SPDX identifier rtc: ds1343: Remove unused struct spi_device in struct ds1343_priv rtc: rx8025: Remove struct i2c_client from struct rx8025_data rtc: hym8563: Read the valid flag directly instead of caching it ...
2020-01-27rtc: i2c/spi: Avoid inclusion of REGMAP support when not neededGeert Uytterhoeven1-2/+6
Merely enabling I2C and RTC selects REGMAP_I2C and REGMAP_SPI, even when no driver needs it. While the former can be moduler, the latter cannot, and thus becomes built-in. Fix this by moving the select statements for REGMAP_I2C and REGMAP_SPI from the RTC_I2C_AND_SPI helper to the individual drivers that depend on it. Note that the comment for RTC_I2C_AND_SPI refers to SND_SOC_I2C_AND_SPI for more information, but the latter does not select REGMAP_{I2C,SPI} itself, and defers that to the individual drivers, too. Fixes: 080481f54ef62121 ("rtc: merge ds3232 and ds3234") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reported-by: kbuild test robot <lkp@intel.com> Reported-by: kbuild test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20200112171349.22268-1-geert@linux-m68k.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-01-27rtc: Kconfig: select REGMAP_I2C when necessaryAlexandre Belloni1-0/+4
Some i2c RTC drivers are using regmap but are not selecting REGMAP_I2C which may lead to build failures. Link: https://lore.kernel.org/r/20200127221724.10160-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-01-27rtc: Kconfig: properly indent sd3078 entryAlexandre Belloni1-6/+6
The RTC_DRV_SD3078 is indented using spaces, use tabs instead. Link: https://lore.kernel.org/r/20200127221724.10160-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2020-01-24rtc: bd70528: add BD71828 supportMatti Vaittinen1-1/+2
ROHM BD71828 PMIC RTC block is from many parts similar to one on BD70528. Support BD71828 RTC using BD70528 RTC driver and avoid re-inventing the wheel. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
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-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-10-16rtc: meson-vrtc: move config option to proper locationAlexandre Belloni1-11/+11
The correct location for this option is under platform driver, not i2c drivers. Link: https://lore.kernel.org/r/20191014155840.22554-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-10-03rtc: at91rm9200: use of_device_get_match_data()Claudiu Beznea1-0/+1
Use of_device_get_match_data() since all platforms should now use DT bindings. AVR32 architecture has been removed in commit 26202873bb51 ("avr32: remove support for AVR32 architecture"). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/1569500132-21164-1-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-09-22Merge tag 'rtc-5.4' of ↵Linus Torvalds1-8/+34
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Two new drivers and the new pcf2127 feature make the bulk of the additions. The rest are the usual fixes and new features. Subsystem: - add debug message when registration fails New drivers: - Amlogic Virtual Wake - Freescale FlexTimer Module alarm Drivers: - remove superfluous error messages - convert to i2c_new_dummy_device and devm_i2c_new_dummy_device - Remove dev_err() usage after platform_get_irq() - Set RTC range for: pcf2123, pcf8563, snvs. - pcf2127: tamper detection and watchdog support - pcf85363: fix regmap issue - sun6i: H6 support - remove w90x900/nuc900 driver" * tag 'rtc-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (51 commits) rtc: meson: mark PM functions as __maybe_unused rtc: sc27xx: Remove clearing SPRD_RTC_POWEROFF_ALM_FLAG flag dt-bindings: rtc: ds1307: add rx8130 compatible rtc: sun6i: Allow using as wakeup source from suspend rtc: pcf8563: let the core handle range offsetting rtc: pcf8563: remove useless indirection rtc: pcf8563: convert to devm_rtc_allocate_device rtc: pcf8563: add Microcrystal RV8564 compatible rtc: pcf8563: add Epson RTC8564 compatible rtc: s35390a: convert to devm_i2c_new_dummy_device() rtc: max77686: convert to devm_i2c_new_dummy_device() rtc: pcf85363/pcf85263: fix regmap error in set_time rtc: snvs: switch to rtc_time64_to_tm/rtc_tm_to_time64 rtc: snvs: set range rtc: snvs: fix possible race condition rtc: pcf2127: bugfix: watchdog build dependency rtc: pcf2127: add tamper detection support rtc: pcf2127: add watchdog feature support rtc: pcf2127: bugfix: read rtc disables watchdog rtc: pcf2127: cleanup register and bit defines ...
2019-09-02mfd / platform: cros_ec: Move cros-ec core driver out from MFDEnric Balletbo i Serra1-1/+1
Now, the ChromeOS EC core driver has nothing related to an MFD device, so move that driver from the MFD subsystem to the platform/chrome subsystem. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-08-27rtc: pcf2127: bugfix: watchdog build dependencyBruno Thomsen1-0/+1
Disable watchdog registation when kernel is build without watchdog functionality, and enable watchdog core otherwise. This removes compile errors like the one below: drivers/rtc/rtc-pcf2127.o: in function `pcf2127_probe.constprop.3': rtc-pcf2127.c:(.text.unlikely+0x2c8): undefined reference to `devm_watchdog_register_device' Watchdog feature in chip will always be configured as this is safe to do in both cases and minimize code churn. Reported-by: Hulk Robot <hulkci@huawei.com> Reported-by: YueHaibing <yuehaibing@huawei.com> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support") Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Link: https://lore.kernel.org/r/20190827143656.4734-1-bruno.thomsen@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-08-27rtc: pcf2127: add watchdog feature supportBruno Thomsen1-1/+6
Add partial support for the watchdog functionality of both PCF2127 and PCF2129 chips. The programmable watchdog timer is currently using a fixed clock source of 1Hz. This result in a selectable range of 1-255 seconds, which covers most embedded Linux use-cases. Clock sources of 4096Hz, 64Hz and 1/60Hz is mostly useful in MCU use-cases. Countdown timer not available when using watchdog feature. Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190822131936.18772-4-bruno.thomsen@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-08-23rtc: fsl-ftm-alarm: add FTM alarm driverBiwen Li1-0/+15
For the platforms including LS1012A, LS1021A, LS1028A, LS1043A, LS1046A, LS1088A, LS208xA that has the FlexTimer module, implementing alarm functions within RTC subsystem to wakeup the system when system going to sleep (work with RCPM driver). Signed-off-by: Biwen Li <biwen.li@nxp.com> Link: https://lore.kernel.org/r/20190813030157.48590-1-biwen.li@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-08-22rtc: Add Amlogic Virtual Wake RTCNeil Armstrong1-0/+11
The Amlogic Meson GX SoCs uses a special register to store the time in seconds to wakeup after a system suspend. In order to be able to reuse the RTC wakealarm feature, this driver implements a fake RTC device which uses the system time to deduce a suspend delay. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> [khilman: rebase to v5.3-rc, rework and modernization] Signed-off-by: Kevin Hilman <khilman@baylibre.com> Link: https://lore.kernel.org/r/20190812232850.8016-3-khilman@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-08-12rtc: bd70528: fix driver dependenciesMatti Vaittinen1-0/+1
With CONFIG_BD70528_WATCHDOG=m, a built-in rtc driver cannot call into the low-level functions that are part of the watchdog module: drivers/rtc/rtc-bd70528.o: In function `bd70528_set_time': rtc-bd70528.c:(.text+0x22c): undefined reference to `bd70528_wdt_lock' rtc-bd70528.c:(.text+0x2a8): undefined reference to `bd70528_wdt_unlock' drivers/rtc/rtc-bd70528.o: In function `bd70528_set_rtc_based_timers': rtc-bd70528.c:(.text+0x50c): undefined reference to `bd70528_wdt_set' Add a Kconfig dependency which forces RTC to be a module if watchdog is a module. If watchdog is not compiled at all the stub functions for watchdog control are used. compiling the RTC without watchdog is fine. Fixes: 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC") Suggested-by: Arnd Bergmann <arnd@arndb.de> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/84462e01e43d39024948a3bdd24087ff87dc2255.1565591387.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-08-12rtc: remove w90x900/nuc900 driverArnd Bergmann1-7/+0
The ARM w90x900 platform is getting removed, so this driver is obsolete. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20190809202749.742267-15-arnd@arndb.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-07-17Merge tag 'rtc-5.3' of ↵Linus Torvalds1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "A quiet cycle this time. - ds1307: properly handle oscillator failure flags - imx-sc: alarm support - pcf2123: alarm support, correct offset handling - sun6i: add R40 support - simplify getting the adapter of an i2c client" * tag 'rtc-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (37 commits) rtc: wm831x: Add IRQF_ONESHOT flag rtc: stm32: remove one condition check in stm32_rtc_set_alarm() rtc: pcf2123: Fix build error rtc: interface: Change type of 'count' from int to u64 rtc: pcf8563: Clear event flags and disable interrupts before requesting irq rtc: pcf8563: Fix interrupt trigger method rtc: pcf2123: fix negative offset rounding rtc: pcf2123: add alarm support rtc: pcf2123: use %ptR rtc: pcf2123: port to regmap rtc: pcf2123: remove sysfs register view rtc: rx8025: simplify getting the adapter of a client rtc: rx8010: simplify getting the adapter of a client rtc: rv8803: simplify getting the adapter of a client rtc: m41t80: simplify getting the adapter of a client rtc: fm3130: simplify getting the adapter of a client rtc: tegra: Drop MODULE_ALIAS rtc: sun6i: Add R40 compatible dt-bindings: rtc: sun6i: Add the R40 RTC compatible dt-bindings: rtc: Convert Allwinner A31 RTC to a schema ...
2019-07-15Merge tag 'mfd-next-5.3' of ↵Linus Torvalds1-2/+10
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Set 'struct device' fwnode when registering a new device New Drivers: - Add support for ROHM BD70528 PMIC New Device Support: - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC - Add support for RK809 and RK817 to Rockchip RK808 - Add support for Lid Angle to ChromeOS core - Add support for CS47L15 CODEC to Madera core - Add support for CS47L92 CODEC to Madera core - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core - Add support for Add Intel Elkhart Lake PCH to Intel LPSS New Functionality: - Provide regulator supply information when registering; madera-core - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic - Allow over-riding power button press via Device Tree; rohm-bd718x7 - Differentiate between running processors; cros_ec_dev Fix-ups: - Big header file update; cros_ec_commands.h - Split header per-subsystem; rohm-bd718x7 - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables - Trivial; sorting, coding style; intel-lpss-pci - Only remove Power Off functionality if set locally; rk808 - Make use for Power Off Prepare(); rk808 - Fix spelling mistake in header guards; stmfx - Properly free IDA resources - SPDX fixups; cs47lXX-tables, madera - Error path fixups; hi655x-pmic Bug Fixes: - Add missing break in case() statement - Repair undefined behaviour when not initialising variables; arizona-core, madera-core - Fix reference to Device Tree documentation; madera" * tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits) mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk mfd: madera: Fixup SPDX headers mfd: madera: Remove some unused registers and fix some defaults mfd: intel-lpss: Release IDA resources mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs mfd: cs5535-mfd: Remove ifdef OLPC noise mfd: stmfx: Fix macro definition spelling dt-bindings: mfd: Add link to ROHM BD71847 Datasheet MAINAINERS: Swap words in INTEL PMIC MULTIFUNCTION DEVICE DRIVERS mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice mfd: rk808: Prepare rk805 for poweroff mfd: rk808: Check pm_power_off pointer mfd: cros_ec: differentiate SCP from EC by feature bit dt-bindings: Add binding for cros-ec-rpmsg mfd: madera: Add Madera core support for CS47L92 mfd: madera: Add Madera core support for CS47L15 mfd: madera: Update DT bindings to add additional CODECs mfd: madera: Add supply mapping for MICVDD mfd: madera: Fix potential uninitialised use of variable mfd: madera: Fix bad reference to pinctrl.txt file ...
2019-07-13rtc: pcf2123: Fix build errorYueHaibing1-0/+1
If REGMAP_SPI is m and RTC_DRV_PCF2123 is y, drivers/rtc/rtc-pcf2123.o: In function `pcf2123_probe': rtc-pcf2123.c:(.text+0xb2b): undefined reference to `__devm_regmap_init_spi' Select REGMAP_SPI as RTC_DRV_DS1347 driver does. Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 790d033933b8 ("rtc: pcf2123: port to regmap") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190704085542.48180-1-yuehaibing@huawei.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-07-02Merge branches 'ib-mfd-clk-gpio-power-regulator-rtc-5.3', ↵Lee Jones1-2/+2
'ib-mfd-clk-regulator-rtc-5.3', 'ib-mfd-cros-5.3' and 'ib-mfd-regulator-5.3' into ibs-for-mfd-merged
2019-06-27rtc: rk808: Add RK809 and RK817 support.Tony Xie1-2/+2
RK809 and RK817 are power management IC chips for multimedia products. Most of their functions and registers are same, including the rtc. Signed-off-by: Tony Xie <tony.xie@rock-chips.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-06-27rtc: bd70528: Initial support for ROHM bd70528 RTCMatti Vaittinen1-0/+8
Support RTC block in ROHM bd70528 power management IC. Support getting and setting the time and date as well as arming an alarm which can also be used to wake the PMIC from standby state. HW supports wake interrupt only for the next 24 hours (sec, minute and hour information only) so we limit also the alarm interrupt to this 24 hours for the sake of consistency. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-06-01rtc: tps65910: remove superfluous Kconfig dependencyMichał Mirosław1-1/+1
TPS65910 entry is already under 'if RTC_CLASS' - remove superfluous dependency. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner1-0/+1
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-09Merge tag 'rtc-5.2' of ↵Linus Torvalds1-4/+15
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "A huge series from me this cycle. I went through many drivers to set the date and time range supported by the RTC which helps solving HW limitation when the time comes (as early as next year for some). This time, I focused on drivers using .set_mms and .set_mmss64, allowing me to remove those callbacks. About a third of the patches got reviews, I actually own the RTCs and I tested another third and the remaining one are unlikely to cause any issues. Other than that, a single new driver and the usual fixes here and there. Summary: Subsystem: - set_mmss and set_mmss64 rtc_ops removal - Fix timestamp value for RTC_TIMESTAMP_BEGIN_1900 - Use SPDX identifier for the core - validate upper bound of tm->tm_year New driver: - Aspeed BMC SoC RTC Drivers: - abx80x: use rtc_add_group - ds3232: nvram support - pcf85063: add alarm, nvram, offset correction and microcrystal rv8263 support - x1205: add of_match_table - Use set_time instead of set_mms/set_mmss64 for: ab3100, coh901331, digicolor, ds1672, ds2404, ep93xx, imxdi, jz4740, lpc32xx, mc13xxx, mxc, pcap, stmp3xxx, test, wm831x, xgene. - Set RTC range for: ab3100, at91sam9, coh901331, da9063, digicolor, dm355evm, ds1672, ds2404, ep39xx, goldfish, imxdi, jz4740, lpc32xx, mc13xxx, mv, mxc, omap, pcap, pcf85063, pcf85363, ps3, sh, stmp3xxx, sun4v, tegra, wm831x, xgene. - Switch to rtc_time64_to_tm/rtc_tm_to_time64 for the driver that properly set the RTC range. - Use dev_get_drvdata instead of multiple indirections" * tag 'rtc-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (177 commits) rtc: snvs: Use __maybe_unused instead of #if CONFIG_PM_SLEEP rtc: imxdi: remove unused variable rtc: drop set_mms and set_mmss64 rtc: pcap: convert to SPDX identifier rtc: pcap: use .set_time rtc: pcap: switch to rtc_time64_to_tm/rtc_tm_to_time64 rtc: pcap: set range rtc: digicolor: convert to SPDX identifier rtc: digicolor: use .set_time rtc: digicolor: set range rtc: digicolor: fix possible race condition rtc: jz4740: convert to SPDX identifier rtc: jz4740: rework invalid time detection rtc: jz4740: use dev_pm_set_wake_irq() to simplify code rtc: jz4740: use .set_time rtc: jz4740: remove useless check rtc: jz4740: switch to rtc_time64_to_tm/rtc_tm_to_time64 rtc: jz4740: set range rtc: 88pm860x: prevent use-after-free on device remove rtc: Use dev_get_drvdata() ...
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 <alexandre.belloni@bootlin.com>
2019-04-04rtc: pcf85063: switch to regmapAlexandre Belloni1-0/+1
Switch to regmap to simplify register accesses and remove the need for pcf85063_stop_clock/pcf85063_start_clock. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: Add ASPEED RTC driverJoel Stanley1-0/+11
Read and writes the time to the non-battery backed RTC in the ASPEED BMC system on chip families. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: at91sam9: drop platform_data supportAlexandre Belloni1-1/+1
ARCH_AT91 is DT only for a while, drop platform data support. Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: goldfish: allow building on more than MIPSAlexandre Belloni1-1/+2
Goldfish can be ARM or x86, allow building the driver for more than just MIPS. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-03-20rtc: sd3078: fix manufacturer nameAlexandre Belloni1-2/+2
The proper manufacturer name is Shenzhen whwave. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-03-12Merge tag 'tag-chrome-platform-for-v5.1' of ↵Linus Torvalds1-0/+11
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: - SPDX identifier cleanup for platform/chrome - Cleanup series between mfd and chrome/platform, moving cros-ec attributes from mfd/cros_ec_dev to sub-drivers in platform/chrome - Wilco EC driver - Maintainership change to new group repository * tag 'tag-chrome-platform-for-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: fix wilco-ec dependencies platform/chrome: wilco_ec: Add RTC driver platform/chrome: wilco_ec: Add support for raw commands in debugfs platform/chrome: Add new driver for Wilco EC platform/chrome: cros_ec: Remove cros_ec dependency in lpc_mec MAINTAINERS: chrome-platform: change the git tree to a chrome-platform group git tree platform/chrome: cros_ec_sysfs: remove pr_fmt() define platform/chrome: cros_ec_lightbar: remove pr_fmt() define platform/chrome: cros_kbd_led_backlight: switch to SPDX identifier platform/chrome: cros_ec_spi: switch to SPDX identifier platform/chrome: cros_ec_proto: switch to SPDX identifier platform/chrome: cros_ec_lpc: switch to SPDX identifier platform/chrome: cros_ec_i2c: switch to SPDX identifier platform/chrome: cros_ec_vbc: switch to SPDX identifier platform/chrome: cros_ec_sysfs: switch to SPDX identifier platform/chrome: cros_ec_lightbar: switch to SPDX identifier platform/chrome: cros_ec_debugfs: switch to SPDX identifier platform/chrome: cromeos_pstore: switch to SPDX identifier
2019-03-02rtc: rx8581: Add support for Epson rx8571 RTCBiju Das1-2/+3
Add support for Epson rx8571 real-time clock. rx8571 rtc is compatible with rx8581,except that rx8571 has additional 16 bytes of RAM. 16 bytes of nvmem is supported and exposed in sysfs (# is the instance number,starting with 0): /sys/bus/nvmem/devices/rx8571-#/nvmem Signed-off-by: Biju Das <biju.das@bp.renesas.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-02-21platform/chrome: wilco_ec: Add RTC driverNick Crews1-0/+11
This Embedded Controller has an internal RTC that is exposed as a standard RTC class driver with read/write functionality. The driver is added to the drivers/rtc/ so that the maintainer of that directory will be able to comment on this change, as that maintainer is the expert on this system. In addition, the driver code is called indirectly after a corresponding device is registered from core.c, as opposed to core.c registering the driver callbacks directly. To test: > hwclock --show --rtc /dev/rtc1 2007-12-31 16:01:20.460959-08:00 > hwclock --systohc --rtc /dev/rtc1 > hwclock --show --rtc /dev/rtc1 2018-11-29 17:08:00.780793-08:00 > hwclock --show --rtc /dev/rtc1 2007-12-31 16:01:20.460959-08:00 > hwclock --systohc --rtc /dev/rtc1 > hwclock --show --rtc /dev/rtc1 2018-11-29 17:08:00.780793-08:00 Signed-off-by: Duncan Laurie <dlaurie@google.com> Signed-off-by: Nick Crews <ncrews@chromium.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> [Fix the sparse warning: symbol 'wilco_ec_rtc_read/write' was not declared] Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2019-02-18rtc: add AB-RTCMC-32.768kHz-EOZ9 RTC supportArtem Panfilov1-0/+10
This patch adds support for AB-RTCMC-32.768kHz-EOZ9 RTC/Calendar module with I2C interface. Signed-off-by: Artem Panfilov <panfilov.artyom@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-02-17rtc: hid-sensor-time: stop selecting IIOAlexandre Belloni1-2/+1
Make RTC_DRV_HID_SENSOR_TIME depend on IIO and HID_SENSOR_HUB to remove possible circular dependencies as this is the only symbol selecting those. Suggested-by: Florian Lohoff <f@zz.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-02-17rtc: rv3028: add new driverAlexandre Belloni1-0/+9
Add a driver for the MicroCrystal RV-3028. It is a SMT Real-Time Clock Module that incorporates an integrated CMOS circuit together with an XTAL. It has an i2c interface. The driver handles date/time, alarms, trickle charging, timestamping, frequency offset correction, EEPROM and NVRAM. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-02-11rtc: support for the Amlogic Meson RTCMartin Blumenstingl1-0/+11
Add support for the RTC block on the 32-bit Amlogic Meson6, Meson8, Meson8b and Meson8m2 SoCs. The RTC is split in to two parts, which are both managed by this driver: - the AHB front end - and a simple serial connection to the actual registers The RTC_COUNTER register which holds the time is 32-bits wide. There are four 32-bit wide (in total: 16 bytes) "regmem" registers which are exposed using nvmem. On Amlogic's 3.10 kernel this is used to store data which needs to survive a suspend / resume cycle. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> [resurrected Ben's patches after 2 years] Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-02-08rtc: imx-sc: depend on HAVE_ARM_SMCCCAlexandre Belloni1-0/+1
Fix the following build issue: drivers/rtc/rtc-imx-sc.o: In function `imx_sc_rtc_set_time': >> rtc-imx-sc.c:(.text+0x212): undefined reference to `__arm_smccc_smc' Fixes: 13a929f38ad7 ("rtc: imx-sc: add rtc set time support") Reviewed-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-01-22rtc: Add Cadence RTC driverJan Kotas1-0/+10
This patch adds a driver for Cadence RTC controller. It can be enabled with RTC_DRV_CADENCE Kconfig option. It supports waking system from sleep modes. Signed-off-by: Jan Kotas <jank@cadence.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-01-10rtc: sd3078: new driver.Dianlong Li1-0/+9
The sd3078 is a combination RTC and SRAM device with I2C interface. Signed-off-by: Dianlong Li <long17.cool@163.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-12-20rtc: add i.MX system controller RTC supportAnson Huang1-0/+7
i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and secure rtc etc.. This patch adds i.MX system controller RTC driver support, Linux kernel has to communicate with system controller via MU (message unit) IPC to set/get RTC time and other alarm functions, since the RTC set time needs to be done in secure EL3 mode (required by system controller firmware) and alarm functions needs to be done with general MU IRQ handle, these depend on other components which are NOT ready, so this patch ONLY enables the RTC time read. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-09-28rtc: ds1685: drop RTC_DS1685_PROC_REGSAlexandre Belloni1-11/+0
/proc is not the correct ABI to display debugging info. Remove RTC_DS1685_PROC_REGS as the driver hasn't seen any real development since it was included. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-09-12rtc: abx80x: add basic watchdog supportJeremy Gebben1-0/+1
The abx804 and abx805 chips have support for a simple watchdog function that can trigger an external reset. Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-08-27rtc: jz4740: Drop dependency on MACH_INGENICPaul Cercueil1-1/+1
Depending on MACH_INGENIC prevent us from creating a generic kernel that works on more than one MIPS board. Instead, we just depend on MIPS being set. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-08-16rtc: ds1307: simplify hwmon configHeiner Kallweit1-9/+0
We don't have to define an extra config symbol, IS_REACHABLE does what we need. And having this config symbol just to save the few bytes of hwmon support on non-DS3231 chips isn't worth it IMO (especially as the symbol is set per default). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-06-20rtc: ds1685: remove sysfs access to control registersAlexandre Belloni1-12/+0
Access to the control registers is mostly not needed and can cause runtime issues (like missed interrupts). Remove this debugging interface. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-05-31rtc: jz4740: Fix a typo in KconfigMathieu Malaterre1-1/+1
Fix typo introduced for RTC_DRV_JZ4740 in commit 586655d278ba ("rtc: jz4740: make the driver buildable as a module again"). Signed-off-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-04-10Merge tag 'rtc-4.17' of ↵Linus Torvalds1-1/+12
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "This contains a few series that have been in preparation for a while and that will help systems with RTCs that will fail in 2038, 2069 or 2100. Subsystem: - Add tracepoints - Rework of the RTC/nvmem API to allow drivers to discard struct nvmem_config after registration - New range API, drivers can now expose the useful range of the RTC - New offset API the core is now able to add an offset to the RTC time, modifying the supported range. - Multiple rtc_time64_to_tm fixes - Handle time_t overflow on 32 bit platforms in the core instead of letting drivers do crazy things. - remove rtc_control API New driver: - Intersil ISL12026 Drivers: - Drivers exposing the RTC non volatile memory have been converted to use nvmem - Removed useless time and date validation - Removed an indirection pattern that was a cargo cult from ancient drivers - Removed VLA usage - Fixed a possible race condition in probe functions - AB8540 support is dropped from ab8500 - pcf85363 now has alarm support" * tag 'rtc-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (128 commits) rtc: snvs: Fix usage of snvs_rtc_enable rtc: mt7622: fix module autoloading for OF platform drivers rtc: isl12022: use true and false for boolean values rtc: ab8500: Drop AB8540 support rtc: remove a warning during scripts/kernel-doc step rtc: 88pm860x: remove artificial limitation rtc: 88pm80x: remove artificial limitation rtc: st-lpc: remove artificial limitation rtc: mrst: remove artificial limitation rtc: mv: remove artificial limitation rtc: hctosys: Ensure system time doesn't overflow time_t parisc: time: stop validating rtc_time in .read_time rtc: pcf85063: fix clearing bits in pcf85063_start_clock rtc: at91sam9: Set name of regmap_config rtc: s5m: Remove VLA usage rtc: s5m: Move enum from rtc.h to rtc-s5m.c rtc: remove VLA usage rtc: Add useful timestamp definitions rtc: Add one offset seconds to expand RTC range rtc: Factor out the RTC range validation into rtc_valid_range() ...
2018-03-26rtc: remove bfin driverArnd Bergmann1-10/+0
The blackfin architecture is getting removed, so this one is now obsolete. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Aaron Wu <aaron.wu@analog.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2018-03-26rtc: remove tile driverArnd Bergmann1-7/+0
The tile architecture is getting removed, so this driver is no longer needed. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2018-03-26treewide: simplify Kconfig dependencies for removed archsArnd Bergmann1-1/+1
A lot of Kconfig symbols have architecture specific dependencies. In those cases that depend on architectures we have already removed, they can be omitted. Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2018-03-17rtc: at91sam: add 'depends on HAS_IOMEM' to fix unmet dependencyMasahiro Yamada1-0/+1
This config select's MFD_SYSCON, but does not depend on HAS_IOMEM. Compile testing on architecture without HAS_IOMEM causes "unmet direct dependencies" in Kconfig phase. Detected by "make ARCH=score allyesconfig". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-17rtc: isl12026: new driver.David Daney1-0/+10
The ISL12026 is a combination RTC and EEPROM device with I2C interface. The standard RTC driver interface is provided. The EEPROM is accessed via the NVMEM interface. Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-09mn10300: Remove the architectureDavid Howells1-1/+1
Remove the MN10300 arch as the hardware is defunct. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David Howells <dhowells@redhat.com> cc: Masahiro Yamada <yamada.masahiro@socionext.com> cc: linux-am33-list@redhat.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2018-03-01rtc: tx4939: extend test coverageAlexandre Belloni1-1/+1
The rtc-tx4939 driver now compiles correctly on other architectures, add COMPILE_TEST to improve code coverage. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-01-19rtc: remove rtc-at32ap700xCorentin Labbe1-7/+0
Since PLATFORM_AT32AP is an AVR32 platform which was removed, the rtc driver rtc-at32ap700x is useless. This patch remove it. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2018-01-12rtc: add mxc driver for i.MX53 SRTCPatrick Bruenn1-0/+10
Neither rtc-imxdi, rtc-mxc nor rtc-snvs are compatible with i.MX53. This is driver enables support for the low power domain SRTC features: - 32-bit MSB of non-rollover time counter - 32-bit alarm register Select the new config option RTC_DRV_MXC_V2 to build this driver Based on: http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/drivers/rtc/rtc-mxc_v2.c?h=imx_2.6.35_11.09.01 Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com> Acked-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-12-18rtc: cros-ec: add cros-ec-rtc driver.Stephen Barber1-0/+10
On platforms with a Chrome OS EC, the EC can function as a simple RTC. Add a basic driver with this functionality. Signed-off-by: Stephen Barber <smbarber@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Benson Leung <bleung@chromium.org> Reviewed-by: Brian Norris <briannorris@chromium.org> Tested-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-11-20rtc: sc27xx: Add Spreadtrum SC27xx PMIC RTC driverBaolin Wang1-0/+11
This patch adds the Spreadtrum RTC driver, which embedded in the Spreadtrum SC27xx series PMICs. Signed-off-by: Baolin Wang <baolin.wang@spreadtrum.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-11-08rtc: add support for NXP PCF85363 real-time clockEric Nelson1-0/+13
Note that alarms are not currently implemented. 64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0): /sys/bus/nvmem/devices/pcf85363-#/nvmem Signed-off-by: Eric Nelson <eric@nelint.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-10-26rtc: mediatek: enhance the description for MediaTek PMIC based RTCSean Wang1-4/+4
Give a better description for original MediaTek RTC driver as PMIC based RTC in order to distinguish SoC based RTC. Also turning all words with Mediatek to MediaTek here. Cc: Eddie Huang <eddie.huang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: Eddie Huang <eddie.huang@mediatek.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-10-26rtc: mediatek: add driver for RTC on MT7622 SoCSean Wang1-0/+10
This patch introduces the driver for the RTC on MT7622 SoC. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Reviewed-by: Yingjoe Chen <yingjoe.chen@mediatek.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-09-05rtc: Add Realtek RTD1295Andreas Färber1-0/+8
Based on QNAP's arch/arm/mach-rtk119x/driver/rtk_rtc_drv.c code and mach-rtk119x/driver/dc2vo/fpga/include/mis_reg.h register definitions. The base year 2014 was observed on all of Zidoo X9S, ProBox2 Ava and Beelink Lake I. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-09-01rtc: goldfish: Add RTC driver for Android emulatorMiodrag Dinic1-0/+8
Add device driver for a virtual RTC device in Android emulator. The compatible string used by OS for binding the driver is defined as "google,goldfish-rtc". Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com> Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-09-01rtc: ds1307: add basic support for ds1341 chipNikita Yushchenko1-5/+5
This adds support for reading and writing date/time from/to ds1341 chip. ds1341 chip has other features - alarms, input clock (can be used instead of intercal oscillator for better accuracy), output clock ("square wave generation"). However, not all of that is available at the same time. Same chip pins, CLKIN/nINTA and SQW/nINTB, can be used either for input/output clocks, or for alarm interrupts. Role of these pins on particular board depends on hardware wiring. We can add device tree properties that describe if each of pins is wired as clock, or as interrupt, or left unconnected, and enable support for corresponding functionality based on that. But that is cumbersome, requires hardware for testing, and has to deal with bit enabling/disabling output clock also affects which pins alarm interrupts are routed to. Another factor is that there are hardware setups (i.e. ZII RDU2) that power DS1341 from SuperCap, which makes power saving critical. For such setups, kernel driver should leave register bits that control mentioned pins in the state configured by bootloader. Given all that, it was decided to limit support to "only date/time" for now. That is enough for common use case. Full (and cumbersome) implementation can be added later if ever needed. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-09-01rtc: rk808: Name RK805 in Kconfig for RTC_DRV_RK808Elaine Zhang1-2/+2
The RK808 and RK805 PMICs are using a similar register map. We can reuse the rtc driver for the RK805 PMIC. So let's add the RK805 in the Kconfig description. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-07-07rtc: add generic nvmem supportAlexandre Belloni1-0/+8
Many RTCs have an on board non volatile storage. It can be battery backed RAM or an EEPROM. Use the nvmem subsystem to export it to both userspace and in-kernel consumers. This stays compatible with the previous (non documented) ABI that was using /sys/class/rtc/rtcx/device/nvram to export that memory. But will warn about the deprecation. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-07-06rtc: ds3232: add temperature supportKirill Esipov1-0/+8
DS3232/DS3234 has the temperature registers with a resolution of 0.25 degree celsius. This enables to get the value through hwmon. # cat /sys/class/hwmon/hwmon0/temp1_input 37250 Signed-off-by: Kirill Esipov <yesipov@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-07-06rtc: gemini/ftrtc010: rename driver and symbolsLinus Walleij1-5/+5
The Gemini RTC is actually a generic IP block from Faraday Technology names FTRTC010. Rename the driver file and all symbols to match this IP name. The relationship can be clearly seen in the U-Boot driver posted by Po-Yu Chuang for the Faraday A320 board: https://lists.denx.de/pipermail/u-boot/2009-September/061326.html Remove the dependency on ARCH_GEMINI but select the driver for ARCH_GEMINI so we get a smooth transition. The IP block is synthsized on different silicon and architectures. Cc: Po-Yu Chuang <ratbert@faraday-tech.com> Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-07-05rtc: brcmstb-waketimer: Add Broadcom STB wake-timerBrian Norris1-0/+11
This adds support for the Broadcom STB wake-timer which is a timer in the chip's 27Mhz clock domain that offers the ability to wake the system (wake-up source) from suspend states (S2, S3, S5). It is supported using the rtc framework allowing us to configure alarms for system wake-up. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-04-03rtc: sh: add support for rza seriesChris Brandt1-2/+2
This same RTC is used in RZ/A series MPUs, therefore with some slight changes, this driver can be reused. Additionally, since ARM architectures require Device Tree configurations, device tree support has been added. Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-03-09rtc: cpcap: new rtc driverSebastian Reichel1-0/+7
This driver supports the Motorola CPCAP PMIC found on some of Motorola's mobile phones, such as the Droid 4. Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-02-27Merge tag 'rtc-4.11' of ↵Linus Torvalds1-3/+15
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Subsystem: - constify rtc_class_ops structures New driver: - STM32 Drivers: - armada38x: fix errata, Armada 7K/8K support - ds3232: fix wakeup support - gemini: DT support - m48t86: huge cleanup and platform_data removal - mcp795: alarm support - sun6i: proper oscillator handling - tegra: proper clock handling - tps65910: calibration support" * tag 'rtc-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (44 commits) rtc: ds3232: Call device_init_wakeup before device_register rtc: pcf2127: bulk read only date and time registers. rtc: armada38x: Add support for Armada 7K/8K rtc: armada38x: Prepare driver to manage different versions rtc: ds3232: Add regmap max_register definition. rtc: ds3232: Cleanup whitespace around register and bit definitions. rtc: m48t86: remove unused platform_data ARM: Orion5x: ts78xx: allow rtc-m48t86 to manage it's own resources ARM: Orion5x: ts78xx: remove RTC detection ARM: ep93xx: ts72xx: allow rtc-m48t86 to manage its own resources rtc: m48t86: verify that the RTC is actually present rtc: m48t86: add NVRAM support rtc: m48t86: allow driver to manage its resources rtc: m48t86: shorten register name defines bindings: rtc: correct wrong reference in required properties rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() rtc: sun6i: extend test coverage rtc: sun6i: Fix compatibility with old DT binding rtc: snvs: add a missing write sync rtc: bq32000: add support to enable disable the trickle charge FET bypass ...
2017-02-01rtc: sun6i: extend test coverageAlexandre Belloni1-2/+3
COMPILE_TEST was wrongly placed, move it to the "depends on" line. Also depend on COMMON_CLK as the driver now needs it to be properly compiled. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-01-26rtc: jz4740: make the driver buildable as a module againAlexandre Belloni1-1/+4
By using kernel_halt() instead of machine_halt(), we can make the driver build as a module. However, jz4740 platforms not loading this module will not be able to power off. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Revert "rtc: jz4740: make the driver builtin only" This reverts commit b9168c539c0b2de756aaffd380384dbde8adbe07.
2017-01-24rtc: sun6i: Disable the build as a moduleMaxime Ripard1-1/+1
Since we have to provide the clock very early on, the RTC driver cannot be built as a module. Make sure that won't happen. Cc: stable@vger.kernel.org Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2017-01-13rtc: add STM32 RTC driverAmelie Delaunay1-0/+11
This patch adds support for the STM32 RTC. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-12-19rtc: add support for EPSON TOYOCOM RTC-7301SF/DGAkinobu Mita1-0/+11
This adds support for EPSON TOYOCOM RTC-7301SF/DG which has parallel interface compatible with SRAM. This driver supports basic clock, calendar and alarm functionality. Tested with Microblaze linux running on Artix7 FPGA board with my own custom IP for RTC-7301. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-11-30rtc: twl: make driver DT onlyNicolae Rosia1-0/+1
Since there are no platform based users and all users of this code are TI OMAP-based which is DT only, it makes sense to remove unused code. Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-11-09rtc: fix typos in KconfigAlexandre Belloni1-2/+2
s/buillt/built/g Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-11-09rtc: jz4740: make the driver builtin onlyAlexandre Belloni1-4/+1
Since the driver is now calling machine_halt() that is not exported, it has to be built in the kernel. Building it as a module will fail at linking time. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-11-05rtc: Enable compile testing for Maxim and Samsung driversKrzysztof Kozlowski1-3/+4
max8907, max77686 and s5m RTC drivers can be compile tested to increase build coverage. The s5m-rtc uses REGMAP_IRQ so add this as explicit dependency. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-11-04rtc: jz4740: Add support for the RTC in the jz4780 SoCPaul Cercueil1-3/+3
The RTC unit present in the JZ4780 works mostly the same as the one in the JZ4740. The major difference is that register writes need to be explicitly enabled, by writing a magic code (0xA55A) to a "write enable" register before each access. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Maarten ter Huurne <maarten@treewalker.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-10-19rtc: cmos: don't refer to asm-generic/rtc.hChristoph Hellwig1-2/+2
That header has been gone for a while. I've fixed up the Kconfig comment, but the one in rtc-cmos.c doesn't make any sense to me even looking at its history. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-10-14Merge tag 'rtc-4.9' of ↵Linus Torvalds1-15/+23
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "RTC for 4.9 Subsystem: - delete owner assignment in multiple drivers - constify rtc_class_ops structures Drivers: - ac100: support clock-output-names - cmos: properly handle ACPI alarms and quirky BIOSes and other fixes - ds1307: fix century bit support while staying comaptible with previous behaviour by default - ds1347: switch to regmap - isl12057 is now handled by ds1307 - omap: support external wakeup - rv8803: allow to disable voltage drop detection" * tag 'rtc-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (25 commits) rtc: rv8803: set VDETOFF and SWOFF via device tree dt/bindings: Add bindings for Micro Crystal rv8803 devicetree: Add Micro Crystal AG vendor id rtc: cmos: avoid unused function warning rtc: ac100: Add NULL checking for devm_kzalloc call rtc: ds1347: changed raw spi calls to register map calls rtc: cmos: Restore alarm after resume rtc: cmos: Clear ACPI-driven alarms upon resume rtc: omap: Support ext_wakeup configuration rtc: cmos: Initialize hpet timer before irq is registered rtc: asm9260: rework locking rtc: asm9260: allow COMPILE_TEST rtc: constify rtc_class_ops structures rtc: ac100: support clock-output-names in device tree binding rtc: rx6110: remove owner assignment rtc: pic32: Delete owner assignment rtc: bq32k: Fix handling of oscillator failure flag rtc: bq32k: Use correct mask name for 'minutes' register. rtc: sysfs: fix a cast removing the const attribute Documentation: dt: Intersil isl12057 is not a trivial device ...
2016-10-04Merge branches 'ib-mfd-gpio-4.9', 'ib-mfd-gpio-regulator-4.9', ↵Lee Jones1-2/+12
'ib-mfd-input-4.9', 'ib-mfd-regulator-4.9', 'ib-mfd-regulator-4.9.1', 'ib-mfd-regulator-rtc-4.9', 'ib-mfd-regulator-rtc-4.9-1' and 'ib-mfd-rtc-4.9' into ibs-for-mfd-merged
2016-09-22rtc: ds1347: changed raw spi calls to register map callsRaghavendra Ganiga1-0/+1
This patch changes calls of spi read write calls to register map read and write calls in rtc ds1347 Signed-off-by: Raghavendra Chandra Ganiga <ravi23ganiga@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-09-21rtc: omap: Support ext_wakeup configurationMarcin Niestroj1-0/+3
Support configuration of ext_wakeup sources. This patch makes it possible to enable ext_wakeup and set it's polarity, depending on board configuration. AM335x's dedicated PMIC (tps65217) uses ext_wakeup to notify about power-button presses. Handling power-button presses enables to recover from RTC-only power states correctly. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-09-05rtc: asm9260: allow COMPILE_TESTAlexandre Belloni1-1/+1
The rtc-asm9260 driver compiles correctly on other architectures, add COMPILE_TEST to improve code coverage. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-08-31rtc: isl12057: remove driverAlexandre Belloni1-10/+0
The Intersil isl12057 is now supported by the ds1307 driver. Acked-by: Arnaud Ebalard <arno@natisbad.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-08-31rtc: ds1307: add Intersil ISL12057 supportAlexandre Belloni1-4/+4
Intersil ISL12057 is a drop-in replacement for DS1337. It can be supported by the ds1307 driver. Acked-by: Arnaud Ebalard <arno@natisbad.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-08-31rtc: ds1307: fix century bit supportAlexandre Belloni1-0/+14
Add an option to properly support the century bit of ds1337 and compatibles and ds1340. Because the driver had a bug until now, it is not possible to switch users to the fixed code directly as RTCs in the field will wrongly have the century bit set. Acked-by: Arnaud Ebalard <arno@natisbad.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-08-31rtc: Kconfig: Name RK818 in Kconfig for RTC_DRV_RK808Wadim Egorov1-2/+2
The RK808 and RK818 PMICs are using a similar register map. We can reuse the rtc driver for the RK818 PMIC. So let's add the RK818 in the Kconfig description. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-08-08rtc: ac100: Add RTC driver for X-Powers AC100Chen-Yu Tsai1-0/+10
X-Powers AC100 is a codec / RTC combo chip. This driver supports the RTC sub-device. The RTC block also has clock outputs and non-volatile storage. Non-volatile storage wthin the RTC hardware is not supported. Clock output support is added in the next patch. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-07-28rtc: rv8803: Kconfig: Indicate rx8900 supportBenoît Thébaudeau1-3/+3
This driver supports the Epson RX8900, but this was not indicated in Kconfig. Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-06-26rtc: move mc146818 helper functions out-of-lineArnd Bergmann1-0/+6
The mc146818_get_time/mc146818_set_time functions are rather large inline functions in a global header file and are used in several drivers and in x86 specific code. Here we move them into a separate .c file that is compiled whenever any of the users require it. This also lets us remove the linux/acpi.h header inclusion from mc146818rtc.h, which in turn avoids some warnings about duplicate definition of the TRUE/FALSE macros. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-06-26mn10300: use RTC_DRV_CMOS instead of CONFIG_RTCArnd Bergmann1-1/+1
nn10300 has a dependency on mc146818_get_time/mc146818_set_time, which we want to move from the mc146818rtc.h header into the rtc subsystem, which in turn is not usable on mn10300. This changes mn10300 to use the modern rtc-cmos driver instead of the old RTC driver, and that in turn lets us completely remove the read_persistent_clock/update_persistent_clock callbacks. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-06-04rtc: add support for Maxim max6916Venkat Prashanth B U1-0/+12
Add support for Maxim max6916 RTC. Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-21rtc: rv3029: Add support of RV3049Mylène Josserand1-18/+19
Add support of Microcrystal RV3049 RTC (SPI) using regmap on the RV3029 (I2C) driver. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1302: rewrite using SPISergey Yanovich1-6/+9
DS1302 is an half-duplex SPI device. The driver respects this fact now. Pin configurations should be implemented using SPI subsystem. Signed-off-by: Sergei Ianovich <ynvich@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-15rtc: rv3029: stop mentioning rv3029c2Alexandre Belloni1-1/+1
rv3029c2 is actually rv3029. c2 denotes an option. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pcf2127: add support for spi interfaceAkinobu Mita1-9/+10
pcf2127 has selectable I2C-bus and SPI-bus interface support. This adds support for SPI interface. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: rv3029: Add thermometer hwmon supportMichael Büsch1-0/+9
This adds support to - enable/disable the thermometer - set the temperature scanning interval - read the current temperature that is used for temp compensation. via hwmon interface Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: merge ds3232 and ds3234Akinobu Mita1-19/+25
According to "Feature Comparison of the DS323x Real-Time Clocks" (http://pdfserv.maximintegrated.com/en/an/AN5143.pdf), DS3232 and DS3234 are very similar. This merges rtc-ds3232 and rtc-ds3234 with using regmap. This change also enables to support alarm for ds3234. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Suggested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pxa: fix Kconfig indentationAlexandre Belloni1-4/+4
The pxa section is indented using spaces, use tabs. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: enable COMPILE_TESTAlexandre Belloni1-23/+23
There are several arch-specific RTC drivers that can be successfully compiled on other platforms. Add a COMPILE_TEST dependency for those. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
2016-03-14rtc: always show I2CAlexandre Belloni1-1/+0
Always show there is an I2C section, like the other sections. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: max77686: Add support for MAX20024/MAX77620 RTC IPLaxman Dewangan1-2/+2
Maxim Semiconductor's PMIC MAX77686 has RTC IP which is reused in the MAX77620/MAX20024 PMICs. Add support for these devices in MAX77686 RTC driver. This device does not have RTC alarm pending status outside of RTC IP. The RTC IP is having separate I2C address for its register access. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: rv3029: reword Kconfig optionAlexandre Belloni1-2/+2
The Kconfig option for rv3029 is not mentioning any part number, explicitly show rv3029. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: Group Kconfig entries by vendorSoren Brinkmann1-44/+44
The RTC entries are mostly grouped by vendor. Move the few outliers in place. Also, change the one occurrence of 'nxp' to 'NXP' to make all NXP entries consistent. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pic32: Add PIC32 real time clock driverJoshua Henderson1-0/+10
This driver adds support for the PIC32 real time clock and calendar peripheral: - reading and setting time - alarms provided by dedicated IRQ Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: add Alphascale asm9260 driverOleksij Rempel1-0/+10
Add support for RTC controller found on Alphascale asm9260 SoC. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: allow compilation of sun6i RTC for all sunxi SoCsAndre Przywara1-3/+4
At the moment the "sun6i" RTC drivers depends on having two specific SoC families selected. The Allwinner A64 SoC has the same RTC, so extend the Kconfig option to allow inclusion of the driver for all Allwinner SoCs. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: add driver for RX6110SA real time clockSteffen Trumtrar1-0/+9
The RX6110 comes in two different variants: SPI and I2C. This driver only supports the SPI variant. If the need ever arises to also support the I2C variant, this driver could easily be refactored to support both cases. Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-02-04rtc: ds1307: add temperature sensor support for ds3231Akinobu Mita1-0/+9
DS3231 has the temperature registers with a resolution of 0.25 degree celsius. This enables to get the value through hwmon. # cat /sys/class/i2c-adapter/i2c-2/2-0068/hwmon/hwmon0/temp1_input 21000 Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-02-04rtc: mt6397: add IRQ domain dependencyArnd Bergmann1-1/+1
The mt6397 RTC driver can be built either when the MFD_MT6397 driver is enabled (which selects IRQ_DOMAIN), or when compile testing. The latter however fails without IRQ domains: drivers/rtc/rtc-mt6397.c: In function 'mtk_rtc_probe': drivers/rtc/rtc-mt6397.c:326:13: error: implicit declaration of function 'irq_create_mapping' [-Werror=implicit-function-declaration] rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start); This adds an explicit dependency for the COMPILE_TEST case. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Eddie Huang <eddie.huang@mediatek.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-02-04rtc: Remove Maxim 77802 driverJavier Martinez Canillas1-10/+0
The max77686 RTC driver now supports the max77802 RTC as well so there's no need to have a separate driver anymore. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Andi Shyti <andi.shyti@samsung.com> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>