dt-bindings: timer: renesas: mtu2: Convert to json-schema

Convert the Renesas Multi-Function Timer Pulse Unit 2 (MTU2) Device Tree
binding documentation to json-schema.

Add missing properties.
Update the example to match reality.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Geert Uytterhoeven 2020-05-28 15:30:33 +02:00 committed by Rob Herring
parent 7536c7e03e
commit bc6b83d636
2 changed files with 76 additions and 42 deletions

View file

@ -1,42 +0,0 @@
* Renesas Multi-Function Timer Pulse Unit 2 (MTU2)
The MTU2 is a multi-purpose, multi-channel timer/counter with configurable
clock inputs and programmable compare match.
Channels share hardware resources but their counter and compare match value
are independent. The MTU2 hardware supports five channels indexed from 0 to 4.
Required Properties:
- compatible: must be one or more of the following:
- "renesas,mtu2-r7s72100" for the r7s72100 MTU2
- "renesas,mtu2" for any MTU2
This is a fallback for the above renesas,mtu2-* entries
- reg: base address and length of the registers block for the timer module.
- interrupts: interrupt specifiers for the timer, one for each entry in
interrupt-names.
- interrupt-names: must contain one entry named "tgi?a" for each enabled
channel, where "?" is the channel index expressed as one digit from "0" to
"4".
- clocks: a list of phandle + clock-specifier pairs, one for each entry
in clock-names.
- clock-names: must contain "fck" for the functional clock.
Example: R7S72100 (RZ/A1H) MTU2 node
mtu2: timer@fcff0000 {
compatible = "renesas,mtu2-r7s72100", "renesas,mtu2";
reg = <0xfcff0000 0x400>;
interrupts = <0 139 IRQ_TYPE_LEVEL_HIGH>,
<0 146 IRQ_TYPE_LEVEL_HIGH>,
<0 150 IRQ_TYPE_LEVEL_HIGH>,
<0 154 IRQ_TYPE_LEVEL_HIGH>,
<0 159 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "tgi0a", "tgi1a", "tgi2a", "tgi3a", "tgi4a";
clocks = <&mstp3_clks R7S72100_CLK_MTU2>;
clock-names = "fck";
};

View file

@ -0,0 +1,76 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/timer/renesas,mtu2.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas Multi-Function Timer Pulse Unit 2 (MTU2)
maintainers:
- Geert Uytterhoeven <geert+renesas@glider.be>
- Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
description:
The MTU2 is a multi-purpose, multi-channel timer/counter with configurable clock inputs
and programmable compare match.
Channels share hardware resources but their counter and compare match value are
independent. The MTU2 hardware supports five channels indexed from 0 to 4.
properties:
compatible:
items:
- enum:
- renesas,mtu2-r7s72100 # RZ/A1H
- const: renesas,mtu2
reg:
maxItems: 1
interrupts:
minItems: 1
maxItems: 5
description: One entry for each enabled channel.
interrupt-names:
minItems: 1
items:
- const: tgi0a
- const: tgi1a
- const: tgi2a
- const: tgi3a
- const: tgi4a
clocks:
maxItems: 1
clock-names:
const: fck
power-domains:
maxItems: 1
required:
- compatible
- reg
- interrupts
- interrupt-names
- clocks
- clock-names
- power-domains
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/r7s72100-clock.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
mtu2: timer@fcff0000 {
compatible = "renesas,mtu2-r7s72100", "renesas,mtu2";
reg = <0xfcff0000 0x400>;
interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "tgi0a";
clocks = <&mstp3_clks R7S72100_CLK_MTU2>;
clock-names = "fck";
power-domains = <&cpg_clocks>;
};