RE: [PATCH V2] dt-bindings: thermal: Convert i.MX to json-schema

From: Anson Huang
Date: Wed May 13 2020 - 02:55:40 EST


Hi, Rob

> Subject: RE: [PATCH V2] dt-bindings: thermal: Convert i.MX to json-schema
>
> Hi, Rob
>
>
> > Subject: Re: [PATCH V2] dt-bindings: thermal: Convert i.MX to
> > json-schema
> >
> > On Fri, Apr 10, 2020 at 09:07:24AM +0800, Anson Huang wrote:
> > > Convert the i.MX thermal binding to DT schema format using
> > > json-schema
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@xxxxxxx>
> > > ---
> > > Changes since V1:
> > > - make clock property optional.
> > > ---
> > > .../devicetree/bindings/thermal/imx-thermal.txt | 61 --------------
> > > .../devicetree/bindings/thermal/imx-thermal.yaml | 96
> > ++++++++++++++++++++++
> > > 2 files changed, 96 insertions(+), 61 deletions(-) delete mode
> > > 100644 Documentation/devicetree/bindings/thermal/imx-thermal.txt
> > > create mode 100644
> > > Documentation/devicetree/bindings/thermal/imx-thermal.yaml
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/thermal/imx-thermal.txt
> > > b/Documentation/devicetree/bindings/thermal/imx-thermal.txt
> > > deleted file mode 100644
> > > index 823e417..0000000
> > > +
> > > +title: NXP i.MX Thermal Binding
> > > +
> > > +maintainers:
> > > + - Anson Huang <Anson.Huang@xxxxxxx>
> > > +
> > > +properties:
> > > + compatible:
> > > + oneOf:
> > > + - items:
> > > + - enum:
> > > + - fsl,imx6q-tempmon
> > > + - fsl,imx6sx-tempmon
> > > + - fsl,imx7d-tempmon
> > > +
> > > + interrupts:
> > > + description: |
> > > + The interrupt output of the controller, the IRQ will be triggered
> > > + when temperature is higher than high threshold.
> > > + maxItems: 1
> > > +
> > > + nvmem-cells:
> > > + description: |
> > > + Phandle to the calibration cells provided by ocotp for calibration
> > > + data and temperature grade.
> > > + maxItems: 2
> > > +
> > > + nvmem-cell-names:
> > > + maxItems: 2
> > > + items:
> > > + - const: calib
> > > + - const: temp_grade
> > > +
> > > + fsl,tempmon:
> > > + $ref: '/schemas/types.yaml#/definitions/phandle'
> > > + description: |
> > > + Phandle pointer to system controller that contains TEMPMON
> > control
> > > + registers, e.g. ANATOP on imx6q.
> >
> > Really, this should have been a child of the system controller. Not
> > too late to do that, but you'd need to keep this for compatibility.
>
> Sorry, I don't quite get your point, can you provide more details or example,
> thanks.

I guess you meant the tempmon node should be put inside anatop node? Then
DT files also needs to be changed? Right?

anatop: anatop@20c8000 {
compatible = "fsl,imx6sx-anatop", "fsl,imx6q-anatop",
"syscon", "simple-mfd";
reg = <0x020c8000 0x1000>;
interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
...
};

tempmon: tempmon {
compatible = "fsl,imx6sx-tempmon", "fsl,imx6q-tempmon";
interrupt-parent = <&gpc>;
interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
fsl,tempmon = <&anatop>;
nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
nvmem-cell-names = "calib", "temp_grade";
clocks = <&clks IMX6SX_CLK_PLL3_USB_OTG>;
};

Thanks,
Anson