Commit graph

254 commits

Author SHA1 Message Date
Linus Torvalds
271d89394e RTC for 6.3
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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEBqsFVZXh8s/0O5JiY6TcMGxwOjIFAmQBNu0ACgkQY6TcMGxw
 OjLXoA//S8YQQLqAOHPdmEmiVHEoYQv+VYwYrnK8of3QTDOJizboDRgRSSMgNNBj
 ViqDCLUUDnmPd/91BiTVgKdfmjY2gqR3coyu5XcEKDNRoLCeLjrKENtrmrjwOvKW
 gdbvs3oXsUtWC6JY0vuEABCn0DNxg7I7pvT57Ykaun2mhASo6LeTwGU5Jwo27GtY
 /MEY7Av+VMOvNWXsjRi9qaIms9DtX8LbXSDgkYoVy8QH97iW9iTVZu2tCgFAR9Fl
 HrLzVslnOg+ae8sBJ7rAY57xD+ZRT/P8ZnVlgUs/oQ9DxJ15rmjifzJA6SurcVea
 HmNrVzdyiNmTY4Vk9/M/pAADwwz0L5sxXMnbemLcl97MHIZulhAz/4zWMEwZixCi
 Of+ROqt1tahk69d3QRry4zlWp5dGfn07+DDD9aVFV2YqmAmBSlUkru65tse10gem
 QWVcrmURMQoBjrgXkWki3+6NjvqlBTrJa7qY8KAB3iGpDF/yAUwYm8rBVYxGAiUz
 NaoiFKgwbVxE67SSP6OFURTWi+lGyS+kmaTVbzfTfWDI8Tf++U4xbMkDzhyvL4A2
 HZD3HbTghdnbVfysTI9Fxtk1mFbO3EDuMRK5YpLcx7gZAn+S7vUNRU0oFPxAR/aX
 BhZAWSQvZJWewPuTBSfoSSPFCEEiCSqOVupHmMr5J4H1lgtZAXo=
 =aZkd
 -----END PGP SIGNATURE-----

Merge tag 'rtc-6.3' of 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-03-03 09:15:50 -08:00
Jacky Bai
eb7b85853c rtc: bbnsm: Add the bbnsm rtc support
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-22 12:25:32 +01:00
Arnd Bergmann
6388bbad4a rtc: remove v3020 driver
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-02-01 17:23:38 +01:00
Linus Torvalds
7406fd75a9 - 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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmOhmWgACgkQUa+KL4f8
 d2GEMA/+LQ+1Iv/MS8xh9a5SNs3lUJcHmNe8j1OhdD62usl1gQa9HegyL+h60Ajm
 r+MAxO3s0iTvPJFi9+i9S/BdO0XtdF1+0eIFm3Qih4A8NUDeK4wnr1J+5fswYvPG
 5Nvut/sqIQhCoT64T7009pwdRx8S5b1Von7+hGfDoC3UN0cGqW8+/3K0lEE4I1FY
 RaDKwS4Wvs3zZdfs/EQ0ILqTJKp0Mw3qKEbS9rB2XaLwa/eteZAeZBuypJDH9XLY
 GkJDeX51jLynjA7mp10p7bf1v6/p8JXcBUaz/vvPwYIM2oV46PHw9dbtzuPzz9iD
 O12reYGhssuVRTN8fCm+T82Jo99TiWrhagJG3gTqtrFQrs19w341Vetb7wDn14+z
 rL88pCo7xHLYwPGKXfup2GaGVt5GP6zEr6REnelw9yGmuxbAWajwWK2x64TAReGV
 8rOUt1VQyaY874dQ0iulrs+bKwaaPnpDgEzUeB6b4LG6zYoupQFD1+dfIzRq8k42
 wnAg5QdzcWFWzBOH0neUkyq7iZvLL3S5pLRWTENV8rLvEiNIPzWAMPHGFeYO8xm2
 lx+6B5XVfGd3oMze8mFwbrkLlpzbRS1j8bIV6kwlbcw44mw0w/EKtNW8Qlxw8HWA
 lvR9M/+NzniaCM8yJVZcB97k5r5ukZ6rSfQWCm9htIzdvLW09iM=
 =HT19
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.2' of 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-21 09:19:24 -08:00
Arnd Bergmann
fc45720334 mfd: Remove dm355evm_msp driver
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-12-07 13:28:08 +00:00
Arnd Bergmann
97e78b64d1 rtc: remove davinci rtc driver
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-11-15 21:01:51 +01:00
Mia Lin
5adbaed16c rtc: Add NCT3018Y real time clock driver
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-26 17:07:04 +02:00
Thomas Bogendoerfer
2a692245b6 rtc: vr41xx: remove driver
Commit d3164e2f3b ("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-07-26 16:34:12 +02:00
Nishanth Menon
b09d633575 rtc: Introduce ti-k3-rtc
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-24 21:35:31 +02:00
Conor Dooley
0b31d70359 rtc: Add driver for Microchip PolarFire SoC
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-06-24 21:24:02 +02:00
Michel Pollet
deeb4b5393 rtc: rzn1: Add new RTC driver
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-05-17 23:11:44 +02:00
Clément Léger
81c2f059ab rtc: optee: add RTC driver for OP-TEE RTC PTA
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-25 11:42:50 +01:00
Vincent Shih
fad6cbe9b2 rtc: Add driver for RTC in Sunplus SP7021
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
2022-01-05 01:00:29 +01:00
Emmanuel Gil Peyrot
86559400b3 rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U
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-12-16 10:46:35 +01:00
Dmitry Osipenko
005870f46c rtc: tps80031: Remove driver
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-23 23:52:48 +02:00
Daniel Palmer
be7d9c9161 rtc: Add support for the MSTAR MSC313 RTC
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-26 00:17:25 +02:00
Alexandre Belloni
b02c96464f rtc: move RTC_LIB_KUNIT_TEST to proper location
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-10 23:22:20 +02:00
Cassio Neri
1d1bb12a8b rtc: Improve performance of rtc_time64_to_tm(). Add tests.
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-08-10 00:09:21 +02:00
Jonathan Neuschäfer
435af89786 rtc: New driver for RTC in Netronix embedded controller
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-03-10 11:06:33 +00:00
Linus Torvalds
0328b5f2ef RTC for 5.12
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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEycoQi/giopmpPgB12wIijOdRNOUFAmAzAIAACgkQ2wIijOdR
 NOXVDhAArDkq1P46RK6GDQV6w++RTwqMRTVTCZLG0r+gOv6BiAo8TjEb+VMlJFi5
 4D4qVEo5BDxMxNRsB/vyWIrvXDpGW/vxTH3W4G/4lGHZObYluAGeoZ+qswRPaPHU
 upJd4OXK7AThjf9lhOuhiuea6oAGfhIl4keTu3pVUAfYMYBlS9zmU45pF4KESXzm
 6Wmed2QKx3+iUcBdwToMaDpd4uJcZ9HSPP/SPlO0P1KwhfUolCfFrHjY2oGuRVCN
 dYDZ995c5jx1PU5AlEBWXcWG7mWVEpESearUCjEKYiRgpJu85EJpDmoROa4XjL49
 XJYbfnM/ZFMVJpAKPGBuOX/PYMMyOOkiYQ0GE5iHYWBctzQr3cm6D9SMynymsJHY
 mo0abVSmWU6FmUH2+n4je7ixXfuf/H0T4/xYw+1xejwGk3XpWEVYwzU6YznCXKMn
 djPO6hL+87vJC8BaQNwdAGACrO4ludJdsX2XTNg89U8eUseuFb+xJjQ06ZJCHeFL
 zrdmHdkJkLqp7Zu/HnVTT74ZQ+bp/hn9voR19HFrMqwKtbPQUfOZhWjwJOcft/rk
 jFOdPadE+OwHDB8rvBshdqNbeyJ5AUeP+6+C6xgVAuLHWtpgG4UibXp+9MWbFcgk
 219o0s2ZI/rkX9n1K/3gmgp2Y4HlSOrYIkGiybvFl0cOpLJqoZk=
 =bK2K
 -----END PGP SIGNATURE-----

Merge tag 'rtc-5.12' of 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-22 09:54:19 -08:00
Andy Shevchenko
c5158358df rtc: mrst: Remove driver for deprecated platform
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
05f4434bc1 ("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-25 20:05:31 +02:00
Arnd Bergmann
2f58f5eea8 rtc: remove ste ab3100 driver
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-23 14:57:21 +01:00
Arnd Bergmann
dd2d3b4003 rtc: remove ste coh901 driver
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-23 14:57:21 +01:00
Arnd Bergmann
9d0735519f rtc: remove sirfsoc driver
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-23 14:57:21 +01:00
Thomas Bogendoerfer
446667df28 rtc: tx4939: Remove driver
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
2021-01-13 00:31:52 +01:00
Thomas Gleixner
33e62e8323 ntp, rtc: Move rtc_set_ntp_time() to ntp code
rtc_set_ntp_time() is not really RTC functionality as the code is just a
user of RTC. Move it into the NTP code which allows further cleanups.

Requested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201206220542.166871172@linutronix.de
2020-12-11 10:40:52 +01:00
Alexandre Belloni
2eeaa532ac rtc: rv3032: Add a driver for Microcrystal RV-3032
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-10-19 22:47:56 +02:00
Mike Rapoport
fa4b9519f0 rtc: remove fb-puv3 driver
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-07-01 12:10:59 +03:00
Linus Torvalds
8645f09bad - 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; intel-lpss-pci
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAl6MSwsACgkQUa+KL4f8
 d2GklhAAk1e0tYu1w4yS0IE40mReDk5ycOE1O8Q75qWw5Af2dK48qvSHGDwaU4ES
 WNYZ3Mr/OUrvd+/XU8EXI6NXAi9W75ye2J2KmmDDL6yXnDuHbzBZF8ifEtXQKSOp
 rElzCJVnXehpjSfwa4cp5f1Msox/rFg1Kpmaas48j8U2JYCmn51GsQCCG6qMIx2i
 0ZvXNZuz+eTY3V7l6pRLfTYqwR8E5Y11ryWJaeliyDcVpUlZaykiXuxD7pbqLjJo
 8v9ISm67rzf6X5zmi6YhdvpIAzpomdRaaxHfVDkeCKqDgpuWGiq0xXA86vDKwjah
 qVx6rK/wg4YM5uSEomxIgVj9uvvLSytDqvRlPe7vFKgkR0Xhl5SdkiwadI4P9zkr
 zrRGNRAUHsZ4ZrlObD0QJWOQYnIg5oCmRouRKcHtQVZYP3rSdRz/1oC6FN8LVqUw
 3NfLB/S6uBCJ3uahckrgnjQughnvmsAzlflcNV2t+P8di8Cwyh2A5N9qkT/oI67o
 Xf7NODSdu0JzzTgsM+EJ2JphSLMYaekWs06qAXyibPrrS2SoThE79igCmNOkyyR7
 obJfN2SM5k4LkhMGlYbPfbRT2Hoa+9OJozBe3WgiW3kwTdFVB9aen2U230tHplbB
 g/NuVS+PrReR5lfzT+O8dodH7lj5/GhmGsapdguFVhXYIE+2CMg=
 =hJ2o
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-5.7' of 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-07 19:48:52 -07:00
Linus Torvalds
bdabb68931 RTC for 5.7
Subsystem:
  - The rtc_time_to_tm and rtc_tm_to_time wrappers have finally been removed and
    only the 64bit version remain.
  - hctosys now works with drivers compiled as modules
 
 New driver:
  - MediaTek MT2712 SoC based RTC
 
 Drivers:
  - set range for 88pm860x, au1xxx, cpcap, da9052, davinci, ds1305, ds1374,
    mcp5121, pl030, pl031, pm8xxx, puv3, sa1100, sirfsoc, starfire, sun6i
  - ds1307: DS1388 oscillator failure detection and watchdog support
  - jz4740: JZ4760 support
  - pcf85063: clock out pin support
  - sun6i: external 32k oscillator is now optional, the range is now handled by
    the core, providing a solution for 2034.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEycoQi/giopmpPgB12wIijOdRNOUFAl6IgdAACgkQ2wIijOdR
 NOVH9Q//evfZmRDQb9Lm8YuSOt+U6lBaCuvRP8H4s7i02jsw0tt1oT6+rGo+1N+k
 pi64+iwPqDj7h+eds06jVur7yWZDNNfCSywlMU8ODGLQcc/hXMTvaIeJtdXG+I+7
 dpIVTs9Artiey2Qb3qZalSMYzrE2rQG6Yuyb/tHx7Pohvje1wKnAE3T64W6sfvir
 zjAwAr/+s9n82mjGtGLapz0onao7dSN4p6b3UIkph9KxPdeHjItd7cRiJuzioysj
 LE8WRUek++uha32PzghK9MoUpRKf8PJtGbsAIRhdwvmwub1Pqs6Uvk5IHQvdiFZx
 af1Qnw/4qUH03HVUuq8VdEkwa8mdthcZ72b8uzUWOqP+uPkeTTlQOGOd1dRECijK
 Qic+SKlEznwgKC9WuDufUQg5i2WjFBnBlA+dCE12/t91SbSlZdYjb53nQLHve1b9
 e4VfyKnS5Ghn/dfizzzSPdcWuPW1rqq2dHTiOvFVqlLn1Fkt1AKaJzGAeCe6PWp4
 AJVqPu+D1eQ/qmvEPXI7dQpCxdI+p6FNJgQvQLMssaq7mpf2fiRoLx23ikFG0v0k
 BeNkNWpLz2ACwHpsOa/RWLwa/FC2+KBHaRWf+As7te63byeDQC8hUEi7F5K78lSS
 yhfZ8SJR04SIIGKjuwAzPmaaIJ0hJT+eaxkFAJU7P5hD7KElsuM=
 =6Veu
 -----END PGP SIGNATURE-----

Merge tag 'rtc-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni:
 "More cleanup this cycle, with the final goal of removing the
  rtc_time_to_tm and rtc_tm_to_time wrappers. All the drivers that have
  been modified for this now are ready for the end of times (whether it
  happens in 2033, 2038, 2106, 2127 or even 4052). There is also a
  single new driver and the usual fixes and features.

  Summary:

  Subsystem:

   - The rtc_time_to_tm and rtc_tm_to_time wrappers have finally been
     removed and only the 64bit version remain.

   - hctosys now works with drivers compiled as modules

  New driver:

   - MediaTek MT2712 SoC based RTC

  Drivers:

   - set range for 88pm860x, au1xxx, cpcap, da9052, davinci, ds1305,
     ds1374, mcp5121, pl030, pl031, pm8xxx, puv3, sa1100, sirfsoc,
     starfire, sun6i

   - ds1307: DS1388 oscillator failure detection and watchdog support

   - jz4740: JZ4760 support

   - pcf85063: clock out pin support

   - sun6i: external 32k oscillator is now optional, the range is now
     handled by the core, providing a solution for 2034"

* tag 'rtc-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (87 commits)
  rtc: ds1307: check for failed memory allocation on wdt
  rtc: class: remove redundant assignment to variable err
  rtc: remove rtc_time_to_tm and rtc_tm_to_time
  rtc: sun6i: let the core handle rtc range
  rtc: sun6i: switch to rtc_time64_to_tm/rtc_tm_to_time64
  rtc: ds1307: add support for watchdog timer on ds1388
  rtc: da9052: switch to rtc_time64_to_tm/rtc_tm_to_time64
  rtc: da9052: set range
  rtc: da9052: convert to devm_rtc_allocate_device
  rtc: imx-sc: Align imx sc msg structs to 4
  rtc: fsl-ftm-alarm: report alarm to core
  rtc: pcf85063: Add pcf85063 clkout control to common clock framework
  rtc: make definitions in include/uapi/linux/rtc.h actually useful for user space
  rtc: class: avoid unnecessary lookup in hctosys
  dt-bindings: rtc: Convert and update jz4740-rtc doc to YAML
  rtc: jz4740: Rename vendor-specific DT properties
  rtc: jz4740: Add support for JZ4760 SoC
  rtc: class: support hctosys from modular RTC drivers
  rtc: pm8xxx: clear alarm register when alarm is not enabled
  rtc: omap: drop unused dt-bindings header
  ...
2020-04-04 10:38:01 -07:00
Andreas Kemnade
540d1e1539 rtc: rc5t619: Add Ricoh RC5T619 RTC driver
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-27 09:42:30 +00:00
Steve Muckle
f9b2a4d6a5 rtc: class: support hctosys from modular RTC drivers
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-23 21:14:34 +01:00
Ran Bi
64823360a8 rtc: add support for the MediaTek MT2712 RTC
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-16 11:55:40 +01:00
Ard Biesheuvel
e5c3b1cc99 efi: Register EFI rtc platform device only when available
Drop the separate driver that registers the EFI rtc on all EFI
systems that have runtime services available, and instead, move
the registration into the core EFI code, and make it conditional
on whether the actual time related services are available.

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2020-02-23 21:59:42 +01:00
Biwen Li
7b0b551dbc rtc: fsl-ftm-alarm: add FTM alarm driver
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-23 16:20:50 +02:00
Neil Armstrong
6ef35398e8 rtc: Add Amlogic Virtual Wake RTC
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-22 23:08:32 +02:00
Arnd Bergmann
cb3cab0614 rtc: remove w90x900/nuc900 driver
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-08-12 22:56:07 +02:00
Matti Vaittinen
32a4a4ebf7 rtc: bd70528: Initial support for ROHM bd70528 RTC
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-27 10:57:24 +01:00
Joel Stanley
184a182ed5 rtc: Add ASPEED RTC driver
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-04 10:07:10 +02:00
Linus Torvalds
f47d633134 chrome platform changes for v5.1
1. SPDX identifier cleanup for platform/chrome
 2. Cleanup series between mfd and chrome/platform, moving
    cros-ec attributes from mfd/cros_ec_dev to sub-drivers in platform/chrome.
 3. Wilco EC driver
 4. Maintainership change to new group repository.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE6gYDF28Li+nEiKLaHwn1ewov5lgFAlyG4dIACgkQHwn1ewov
 5lhoqA//SXO5HU1qkhfvwUKyNsYxtIj4wDQF+j9tAPbVaOOaztq0b5D1PQgDGcEL
 SDl9FAXZtwhmPr5xiGPrPUxwn4JG+tUcgSSgIOCtClpA/SZUPt2wekAB64hLt1ui
 nkBRSgeRnXeeRE0nDh7EUrwAeaYj6yCg4AS8FMHmjWTG0tI6iivhuc39v/zDV8Br
 f4chOu/KEWS/EhItVlDBHE0mYDW2JGLSD3nqJR9MdujvYzbkN5WusJIXBDK6MOUl
 z1gqptVYyq/FQOQOCZ+vHjTNVYQ3N3NbPOnnQn4xAyYiqTQJVJv+x6dd7htncjVO
 567PFbbqbKzqrGWZOrdksxVa4JkIGfcgNG2mskRYKpEtHVOpMlHxwHqKv/93TQvw
 F0z4+43ZeAo0Fx2k+oOiDylpClDvUVOeH0z5suqIK15MZbpfWZF6d38Pz1Zwd8hY
 0TEldpyH83HiXylEuYabBwq3ABfj4VncYcMWfaW517LUrnH9nkJDNOlXQFreGTPt
 uHQPz+Xzfirk9wNwlEtfhqh3fjRWIfmiHc8bLmCB2XuJqavF0pozoQnJprw+72LR
 h4ALkUBr8laVfXYgG8SzNm/K4DlMjKqvJRY6m2b7AY8CTVgMur7ct0WJsvmECF+4
 2XDDvHwkQJt3XifVLpLgFRfR5YRlFxjwMNS8Zq0Bb/gjRqSSCo4=
 =2nC0
 -----END PGP SIGNATURE-----

Merge tag 'tag-chrome-platform-for-v5.1' of 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-12 09:46:32 -07:00
Nick Crews
0d2f2a3da1 platform/chrome: wilco_ec: Add RTC driver
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-21 21:36:53 +01:00
Artem Panfilov
67075b63cc rtc: add AB-RTCMC-32.768kHz-EOZ9 RTC support
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-18 22:39:30 +01:00
Alexandre Belloni
e6e7376cfd rtc: rv3028: add new driver
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-17 21:29:10 +01:00
Martin Blumenstingl
d8fe6009aa rtc: support for the Amlogic Meson RTC
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-11 09:41:21 +01:00
Jan Kotas
42986fb811 rtc: Add Cadence RTC driver
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-22 19:18:27 +01:00
Dianlong Li
1d67a23210 rtc: sd3078: new driver.
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>
2019-01-10 21:51:22 +01:00
Alexandre Belloni
36e14f5fdf rtc: rename core files
Rename core files so there is a clearer separation between the RTC core and
the RTC drivers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-12-31 11:36:16 +01:00
Anson Huang
e01b578195 rtc: add i.MX system controller RTC support
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-12-20 12:47:40 +01:00
Alexandre Belloni
db7a67b9c3 rtc: reorder Makefile entries
A few entries are not placed correctly, reorder them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-09-28 14:20:58 +02:00
Linus Torvalds
fbe173e3ff RTC for 4.17
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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEXx9Viay1+e7J/aM4AyWl4gNJNJIFAlrL3s4ACgkQAyWl4gNJ
 NJI+MxAAgc56UEXi5chqKpHE6GHL2aPWan9duHB6FmGrKWt/FJmpJ8UGylLFlvaW
 dpRGvW0Dynz45UztegcrbHMU6+B2O0hboL4/GVZpYAkcNAcu7Lf0ULho2rsQSDmW
 WJpemmdRxyQY1IkWmw7z7KAkMzhAfYZiVmWmVwMRZfMcKJ3DLEldfgRtkN+g0UdB
 tayWQY3mS02ki16e2figsgwZRmUUhQslDfpKlesInXOzUMmLgVWhf1QxJSEUcfs0
 AMp75vD2YvVJ/RHy/6BilQbqP9EVnaG4NHqJGFSOddazA7u+3HGubEFboI8NuPXb
 2fCvfrNux7pgtQsBF9dnpCqWlukE7sF5aDyIUvjYnr0vUm2D/CwdXglGvQSQVWea
 5GxPTWBdaCL0V7GD5OSZcfUGyz1TN/7NSUItdLSr9YK13dL+tqhcYYm5ytXJLzvO
 Z4GyUEoCOMprMJ9j5KU/TXSjauDmPDl8YZ5B93lPcNOh7y+b/2r3umBaInyZrFzX
 1WJ6FWtuhbRfEwuQtgQHBsobt9eTwZfo8C2y22HBo/fdWfBv45feiiHNXt3OVrA+
 aws6pwfVf1H0UsvpQkXtlPthAx3sbOTndDKAUhntb/U/zA9c7fTrfUyVOQ1bArJy
 p6tl/cmlpq68AjZB+0d3zUXQkQH4Syu+EqZrWItkE6XxZm+khDE=
 =l9i8
 -----END PGP SIGNATURE-----

Merge tag 'rtc-4.17' of 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-04-10 10:22:27 -07:00