Commit aef3952e authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Alexandre Belloni
Browse files

dt-bindings: rtc: convert MT7622 RTC to the json-schema



This helps validating DTS files. Introduced changes:
1. Reworded title
2. Dropper redundant properties descriptions
3. Added required #include-s and adjusted "reg" in example

Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240123125043.27192-1-zajec5@gmail.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent e8c04985
Loading
Loading
Loading
Loading
+52 −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/mediatek,mt7622-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT7622 on-SoC RTC

allOf:
  - $ref: rtc.yaml#

maintainers:
  - Sean Wang <sean.wang@mediatek.com>

properties:
  compatible:
    items:
      - const: mediatek,mt7622-rtc
      - const: mediatek,soc-rtc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    const: rtc

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/mt7622-clk.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    rtc@10212800 {
        compatible = "mediatek,mt7622-rtc", "mediatek,soc-rtc";
        reg = <0x10212800 0x200>;
        interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_LOW>;
        clocks = <&topckgen CLK_TOP_RTC>;
        clock-names = "rtc";
    };
+0 −21
Original line number Diff line number Diff line
Device-Tree bindings for MediaTek SoC based RTC

Required properties:
- compatible	    : Should be
			"mediatek,mt7622-rtc", "mediatek,soc-rtc" : for MT7622 SoC
- reg 		    : Specifies base physical address and size of the registers;
- interrupts	    : Should contain the interrupt for RTC alarm;
- clocks	    : Specifies list of clock specifiers, corresponding to
		      entries in clock-names property;
- clock-names	    : Should contain "rtc" entries

Example:

rtc: rtc@10212800 {
	compatible = "mediatek,mt7622-rtc",
		     "mediatek,soc-rtc";
	reg = <0 0x10212800 0 0x200>;
	interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_LOW>;
	clocks = <&topckgen CLK_TOP_RTC>;
	clock-names = "rtc";
};