Commit bdabb689 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents 828907ef 1821b79d
Loading
Loading
Loading
Loading
+0 −37
Original line number Diff line number Diff line
JZ4740 and similar SoCs real-time clock driver

Required properties:

- compatible: One of:
  - "ingenic,jz4740-rtc" - for use with the JZ4740 SoC
  - "ingenic,jz4780-rtc" - for use with the JZ4780 SoC
- reg: Address range of rtc register set
- interrupts: IRQ number for the alarm interrupt
- clocks: phandle to the "rtc" clock
- clock-names: must be "rtc"

Optional properties:
- system-power-controller: To use this component as the
  system power controller
- reset-pin-assert-time-ms: Reset pin low-level assertion
  time after wakeup (default 60ms; range 0-125ms if RTC clock
  at 32 kHz)
- min-wakeup-pin-assert-time-ms: Minimum wakeup pin assertion
  time (default 100ms; range 0-2s if RTC clock at 32 kHz)

Example:

rtc@10003000 {
	compatible = "ingenic,jz4740-rtc";
	reg = <0x10003000 0x40>;

	interrupt-parent = <&intc>;
	interrupts = <32>;

	clocks = <&rtc_clock>;
	clock-names = "rtc";

	system-power-controller;
	reset-pin-assert-time-ms = <60>;
	min-wakeup-pin-assert-time-ms = <100>;
};
+83 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/ingenic,rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Ingenic SoCs Real-Time Clock DT bindings

maintainers:
  - Paul Cercueil <paul@crapouillou.net>

allOf:
  - $ref: rtc.yaml#

properties:
  compatible:
    oneOf:
      - enum:
        - ingenic,jz4740-rtc
        - ingenic,jz4760-rtc
      - items:
        - const: ingenic,jz4725b-rtc
        - const: ingenic,jz4740-rtc
      - items:
        - enum:
          - ingenic,jz4770-rtc
          - ingenic,jz4780-rtc
        - const: ingenic,jz4760-rtc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    const: rtc

  system-power-controller:
    description: |
      Indicates that the RTC is responsible for powering OFF
      the system.
    type: boolean

  ingenic,reset-pin-assert-time-ms:
    minimum: 0
    maximum: 125
    default: 60
    description: |
      Reset pin low-level assertion time after wakeup
      (assuming RTC clock at 32 kHz)

  ingenic,min-wakeup-pin-assert-time-ms:
    minimum: 0
    maximum: 2000
    default: 100
    description: |
      Minimum wakeup pin assertion time
      (assuming RTC clock at 32 kHz)

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names

examples:
  - |
    #include <dt-bindings/clock/jz4740-cgu.h>
    rtc_dev: rtc@10003000 {
      compatible = "ingenic,jz4740-rtc";
      reg = <0x10003000 0x40>;

      interrupt-parent = <&intc>;
      interrupts = <15>;

      clocks = <&cgu JZ4740_CLK_RTC>;
      clock-names = "rtc";
    };
+14 −0
Original line number Diff line number Diff line
Device-Tree bindings for MediaTek SoC based RTC

Required properties:
- compatible	    : Should be "mediatek,mt2712-rtc" : for MT2712 SoC
- reg 		    : Specifies base physical address and size of the registers;
- interrupts	    : Should contain the interrupt for RTC alarm;

Example:

rtc: rtc@10011000 {
	compatible = "mediatek,mt2712-rtc";
	reg = <0 0x10011000 0 0x1000>;
	interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_LOW>;
};
+2 −0
Original line number Diff line number Diff line
@@ -2015,7 +2015,9 @@ M: Sean Wang <sean.wang@mediatek.com>
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
L:	linux-mediatek@lists.infradead.org (moderated for non-subscribers)
S:	Maintained
F:	Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
F:	Documentation/devicetree/bindings/rtc/rtc-mt7622.txt
F:	drivers/rtc/rtc-mt2712.c
F:	drivers/rtc/rtc-mt6397.c
F:	drivers/rtc/rtc-mt7622.c
+13 −4
Original line number Diff line number Diff line
@@ -41,9 +41,6 @@ config RTC_HCTOSYS_DEVICE
	  device should record time in UTC, since the kernel won't do
	  timezone correction.

	  The driver for this RTC device must be loaded before late_initcall
	  functions run, so it must usually be statically linked.

	  This clock should be battery-backed, so that it reads the correct
	  time when the system boots from a power-off state. Otherwise, your
	  system will need an external clock source (like an NTP server).
@@ -241,6 +238,7 @@ config RTC_DRV_AS3722
config RTC_DRV_DS1307
	tristate "Dallas/Maxim DS1307/37/38/39/40/41, ST M41T00, EPSON RX-8025, ISL12057"
	select REGMAP_I2C
	select WATCHDOG_CORE if WATCHDOG
	help
	  If you say yes here you get support for various compatible RTC
	  chips (often with battery backup) connected with I2C. This driver
@@ -1335,7 +1333,7 @@ config RTC_DRV_IMXDI

config RTC_DRV_FSL_FTM_ALARM
	tristate "Freescale FlexTimer alarm timer"
	depends on ARCH_LAYERSCAPE || SOC_LS1021A
	depends on ARCH_LAYERSCAPE || SOC_LS1021A || COMPILE_TEST
	help
	   For the FlexTimer in LS1012A, LS1021A, LS1028A, LS1043A, LS1046A,
	   LS1088A, LS208xA, we can use FTM as the wakeup source.
@@ -1762,6 +1760,7 @@ config RTC_DRV_MXC_V2
config RTC_DRV_SNVS
	tristate "Freescale SNVS RTC support"
	select REGMAP_MMIO
	depends on ARCH_MXC || COMPILE_TEST
	depends on HAS_IOMEM
	depends on OF
	help
@@ -1807,6 +1806,16 @@ config RTC_DRV_MOXART
	   This driver can also be built as a module. If so, the module
	   will be called rtc-moxart

config RTC_DRV_MT2712
	tristate "MediaTek MT2712 SoC based RTC"
	depends on ARCH_MEDIATEK || COMPILE_TEST
	help
	  This enables support for the real time clock built in the MediaTek
	  SoCs for MT2712.

	  This drive can also be built as a module. If so, the module
	  will be called rtc-mt2712.

config RTC_DRV_MT6397
	tristate "MediaTek PMIC based RTC"
	depends on MFD_MT6397 || (COMPILE_TEST && IRQ_DOMAIN)
Loading