Message ID | 20190810052829.6032-3-tiny.windzz@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Zhang Rui |
Headers | show |
Series | add thermal driver for h6 | expand |
On Sat, Aug 10, 2019 at 05:28:13AM +0000, Yangtao Li wrote: > This patch adds binding document for allwinner h6 thermal controller. > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> > --- > .../bindings/thermal/sun8i-thermal.yaml | 79 +++++++++++++++++++ > 1 file changed, 79 insertions(+) > create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > new file mode 100644 > index 000000000000..e0973199ba3c > --- /dev/null > +++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml We've used so far for the schemas the first compatible to introduce that controller as the filename, we should be consistent here. In that case that would be allwinner,sun8i-a23-ths.yaml > @@ -0,0 +1,79 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Allwinner SUN8I Thermal Controller Device Tree Bindings > + > +maintainers: > + - Yangtao Li <tiny.windzz@gmail.com> > + > +description: |- > + This describes the device tree binding for the Allwinner thermal > + controller which measures the on-SoC temperatures. > + > +properties: > + compatible: > + enum: > + - allwinner,sun50i-h6-ths > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + resets: > + maxItems: 1 > + > + clocks: > + maxItems: 1 > + > + clock-names: > + const: bus > + > + "#thermal-sensor-cells": > + const: 1 > + > + nvmem-cells: You need a maxItems here too > + description: ths calibrate data What about something like this: Calibration data for the thermal sensor > + > + nvmem-cell-names: > + const: calib I'm not sure we need a abbreviation here, calibration would be more explicit > + > +required: > + - compatible > + - reg > + - reset > + - clocks > + - clock-names > + - interrupts > + - "#thermal-sensor-cells" > + > +additionalProperties: false > + > +examples: > + - | > + ths: ths@5070400 { > + compatible = "allwinner,sun50i-h6-ths"; > + reg = <0x05070400 0x100>; > + clocks = <&ccu CLK_BUS_THS>; > + clock-names = "bus"; > + resets = <&ccu RST_BUS_THS>; > + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; Those examples won't compile. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Mon, Aug 12, 2019 at 4:56 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Sat, Aug 10, 2019 at 05:28:13AM +0000, Yangtao Li wrote: > > This patch adds binding document for allwinner h6 thermal controller. > > > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> > > --- > > .../bindings/thermal/sun8i-thermal.yaml | 79 +++++++++++++++++++ > > 1 file changed, 79 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > > > diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > new file mode 100644 > > index 000000000000..e0973199ba3c > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > We've used so far for the schemas the first compatible to introduce > that controller as the filename, we should be consistent here. In that > case that would be allwinner,sun8i-a23-ths.yaml > > > @@ -0,0 +1,79 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Allwinner SUN8I Thermal Controller Device Tree Bindings > > + > > +maintainers: > > + - Yangtao Li <tiny.windzz@gmail.com> > > + > > +description: |- > > + This describes the device tree binding for the Allwinner thermal > > + controller which measures the on-SoC temperatures. > > + > > +properties: > > + compatible: > > + enum: > > + - allwinner,sun50i-h6-ths > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + resets: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 1 > > + > > + clock-names: > > + const: bus > > + > > + "#thermal-sensor-cells": > > + const: 1 > > + > > + nvmem-cells: > > You need a maxItems here too > > > + description: ths calibrate data > > What about something like this: > > Calibration data for the thermal sensor > > > + > > + nvmem-cell-names: > > + const: calib > > I'm not sure we need a abbreviation here, calibration would be more > explicit > > > + > > +required: > > + - compatible > > + - reg > > + - reset > > + - clocks > > + - clock-names > > + - interrupts > > + - "#thermal-sensor-cells" > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + ths: ths@5070400 { > > + compatible = "allwinner,sun50i-h6-ths"; > > + reg = <0x05070400 0x100>; > > + clocks = <&ccu CLK_BUS_THS>; > > + clock-names = "bus"; > > + resets = <&ccu RST_BUS_THS>; > > + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; > > Those examples won't compile. Emmm, I have some questions about this. I added this information and it can be compiled. Yours, Yangtao > > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com
On Tue, Aug 13, 2019 at 07:40:44AM +0800, Frank Lee wrote: > On Mon, Aug 12, 2019 at 4:56 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > > > On Sat, Aug 10, 2019 at 05:28:13AM +0000, Yangtao Li wrote: > > > This patch adds binding document for allwinner h6 thermal controller. > > > > > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> > > > --- > > > .../bindings/thermal/sun8i-thermal.yaml | 79 +++++++++++++++++++ > > > 1 file changed, 79 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > > new file mode 100644 > > > index 000000000000..e0973199ba3c > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml > > > > We've used so far for the schemas the first compatible to introduce > > that controller as the filename, we should be consistent here. In that > > case that would be allwinner,sun8i-a23-ths.yaml > > > > > @@ -0,0 +1,79 @@ > > > +# SPDX-License-Identifier: GPL-2.0 > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Allwinner SUN8I Thermal Controller Device Tree Bindings > > > + > > > +maintainers: > > > + - Yangtao Li <tiny.windzz@gmail.com> > > > + > > > +description: |- > > > + This describes the device tree binding for the Allwinner thermal > > > + controller which measures the on-SoC temperatures. > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - allwinner,sun50i-h6-ths > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + interrupts: > > > + maxItems: 1 > > > + > > > + resets: > > > + maxItems: 1 > > > + > > > + clocks: > > > + maxItems: 1 > > > + > > > + clock-names: > > > + const: bus > > > + > > > + "#thermal-sensor-cells": > > > + const: 1 > > > + > > > + nvmem-cells: > > > > You need a maxItems here too > > > > > + description: ths calibrate data > > > > What about something like this: > > > > Calibration data for the thermal sensor > > > > > + > > > + nvmem-cell-names: > > > + const: calib > > > > I'm not sure we need a abbreviation here, calibration would be more > > explicit > > > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - reset > > > + - clocks > > > + - clock-names > > > + - interrupts > > > + - "#thermal-sensor-cells" > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + ths: ths@5070400 { > > > + compatible = "allwinner,sun50i-h6-ths"; > > > + reg = <0x05070400 0x100>; > > > + clocks = <&ccu CLK_BUS_THS>; > > > + clock-names = "bus"; > > > + resets = <&ccu RST_BUS_THS>; > > > + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; > > > > Those examples won't compile. > > Emmm, I have some questions about this. > I added this information and it can be compiled. With your patch applied, $ ARCH=arm DT_SCHEMA_FILES=Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml make -j4 dt_binding_check CHKDT Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml DTC Documentation/devicetree/bindings/thermal/sun8i-thermal.example.dt.yaml Error: Documentation/devicetree/bindings/thermal/sun8i-thermal.example.dts:20.28-29 syntax error FATAL ERROR: Unable to parse input tree make[2]: *** [scripts/Makefile.lib:299: Documentation/devicetree/bindings/thermal/sun8i-thermal.example.dt.yaml] Error 1 make[1]: *** [/home/max/Work/src/linux/Makefile:1286: dt_binding_check] Error 2 make: *** [/home/max/Work/src/linux/Makefile:179: sub-make] Error 2 Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml new file mode 100644 index 000000000000..e0973199ba3c --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner SUN8I Thermal Controller Device Tree Bindings + +maintainers: + - Yangtao Li <tiny.windzz@gmail.com> + +description: |- + This describes the device tree binding for the Allwinner thermal + controller which measures the on-SoC temperatures. + +properties: + compatible: + enum: + - allwinner,sun50i-h6-ths + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + resets: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + const: bus + + "#thermal-sensor-cells": + const: 1 + + nvmem-cells: + description: ths calibrate data + + nvmem-cell-names: + const: calib + +required: + - compatible + - reg + - reset + - clocks + - clock-names + - interrupts + - "#thermal-sensor-cells" + +additionalProperties: false + +examples: + - | + ths: ths@5070400 { + compatible = "allwinner,sun50i-h6-ths"; + reg = <0x05070400 0x100>; + clocks = <&ccu CLK_BUS_THS>; + clock-names = "bus"; + resets = <&ccu RST_BUS_THS>; + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; + nvmem-cells = <&tsen_calib>; + nvmem-cell-names = "calib"; + #thermal-sensor-cells = <1>; + }; + + sid: sid@3006000 { + compatible = "allwinner,sun50i-h6-sid"; + reg = <0x03006000 0x400>; + #address-cells = <1>; + #size-cells = <1>; + tsen_calib: calib@14 { + reg = <0x14 6>; + }; + }; +...
This patch adds binding document for allwinner h6 thermal controller. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> --- .../bindings/thermal/sun8i-thermal.yaml | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml