[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250826230320.GA646158-robh@kernel.org>
Date: Tue, 26 Aug 2025 18:03:20 -0500
From: Rob Herring <robh@...nel.org>
To: Alexander Kurz <akurz@...la.de>
Cc: Lee Jones <lee@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Dzmitry Sankouski <dsankouski@...il.com>,
"Dr. David Alan Gilbert" <linux@...blig.org>,
Heiko Stuebner <heiko@...ech.de>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
devicetree@...r.kernel.org, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/9] dt-bindings: mfd: fsl,mc13xxx: convert txt to DT
schema
On Sat, Aug 23, 2025 at 02:44:37PM +0000, Alexander Kurz wrote:
> Convert the txt mc13xxx bindings to DT schema attempting to keep most
> information. The nodes codec and touchscreen are not part of the new
> schema since it was only briefly mentioned before.
> Following the convention, rename led-control to fsl,led-control.
If 'led-control' is already in use, then you can't do that. You could
support both, but then the driver has to support both forever which is
worse than not matching convention.
>
> Signed-off-by: Alexander Kurz <akurz@...la.de>
> ---
> .../devicetree/bindings/mfd/fsl,mc13xxx.yaml | 214 ++++++++++++++++++
> .../devicetree/bindings/mfd/mc13xxx.txt | 156 -------------
> 2 files changed, 214 insertions(+), 156 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/mfd/fsl,mc13xxx.yaml
> delete mode 100644 Documentation/devicetree/bindings/mfd/mc13xxx.txt
>
> diff --git a/Documentation/devicetree/bindings/mfd/fsl,mc13xxx.yaml b/Documentation/devicetree/bindings/mfd/fsl,mc13xxx.yaml
> new file mode 100644
> index 000000000000..94e2f6557376
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/fsl,mc13xxx.yaml
> @@ -0,0 +1,214 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/fsl,mc13xxx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale MC13xxx Power Management Integrated Circuits (PMIC)
> +
> +maintainers:
> + - Alexander Kurz <akurz@...la.de>
> +
> +description:
Needs a '>' modifier to preserve formatting.
> + The MC13xxx PMIC series consists of the three models MC13783, MC13892
> + and MC34708 and provide regulators and other features like RTC, ADC,
> + LED, touchscreen, codec and input buttons.
> +
> + Link to datasheets
> + https://www.nxp.com/docs/en/data-sheet/MC13783.pdf
> + https://www.nxp.com/docs/en/data-sheet/MC13892.pdf
> + https://www.nxp.com/docs/en/data-sheet/MC34708.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - fsl,mc13783
> + - fsl,mc13892
> + - fsl,mc34708
> +
> + reg:
> + description: I2C slave address or SPI chip select number.
> + maxItems: 1
> +
> + spi-max-frequency: true
> +
> + spi-cs-high: true
> +
> + system-power-controller: true
> +
> + interrupts:
> + maxItems: 1
> +
> + leds:
> + type: object
> + $ref: /schemas/leds/common.yaml#
> + description: |
> + Leds
Drop the description
blank line
> + properties:
> + reg:
> + description: |
> + One of
> + MC13783 LED IDs
> + 0: Main display
> + 1: AUX display
> + 2: Keypad
> + 3: Red 1
> + 4: Green 1
> + 5: Blue 1
> + 6: Red 2
> + 7: Green 2
> + 8: Blue 2
> + 9: Red 3
> + 10: Green 3
> + 11: Blue 3
blank line
> + MC13892 LED IDs
> + 0: Main display
> + 1: AUX display
> + 2: Keypad
> + 3: Red
> + 4: Green
> + 5: Blue
blank line
> + MC34708 LED IDs
> + 0: Charger Red
> + 1: Charger Green
> + maxItems: 1
blank line
> + fsl,led-control:
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + description: |
> + Setting for LED-Control register array length depends on model,
> + mc13783: 6, mc13892: 4, mc34708: 1
> +
> + regulators:
> + type: object
> + $ref: /schemas/regulator/regulator.yaml#
This schema applies to the child nodes, not this node. Drop.
additionalProperties:
type: object
> + description: |
> + List of child nodes specifying the regulators, depending on chip variant:
> + * MC13783: gpo[1-4], pwgt[12]spi, sw[12][ab], sw3, vaudio, vcam, vdig,
> + vesim, vgen, viohi, violo, vmmc[12], vrf[12], vrfbg, vrfcp, vrfdig,
> + vrfref, vsim and vvib.
> + * MC13892: gpo[1-4], pwgt[12]spi, sw[1-4], swbst, vaudio, vcam, vcoincell,
> + vdig, vgen[1-3], viohi, vpll, vsd, vusb, vusb2, vvideo.
> + Each child node is defined using the standard binding for regulators and
> + the optional regulator properties defined below.
Don't duplicate what the schema says below in free-form text.
> +
> + fsl,mc13xxx-uses-adc:
> + type: boolean
> + description: Indicate the ADC is being used
> +
> + fsl,mc13xxx-uses-codec:
> + type: boolean
> + description: Indicate the Audio Codec is being used
> +
> + fsl,mc13xxx-uses-rtc:
> + type: boolean
> + description: Indicate the RTC is being used
> +
> + fsl,mc13xxx-uses-touch:
> + type: boolean
> + description: Indicate the touchscreen controller is being used
> +
> +required:
> + - compatible
> + - reg
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: fsl,mc13783
> + then:
> + properties:
> + leds:
> + properties:
> + fsl,led-control:
> + minItems: 6
> + maxItems: 6
> + regulators:
> + patternProperties:
> + "^gpo[1-4]|pwgt[12]spi|sw[12][ab]|sw3|vaudio|vcam|vdig|vesim|vgen|viohi|violo|vmmc[12]|vrf[12]|vrfbg|vrfcp|vrfdig|vrfref|vsim|vvib$":
> + type: object
> + $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: fsl,mc13892
> + then:
> + properties:
> + leds:
> + properties:
> + fsl,led-control:
> + minItems: 4
> + maxItems: 4
> + regulators:
> + patternProperties:
> + "^gpo[1-4]|pwgt[12]spi|sw[1-4]|swbst|vaudio|vcam|vcoincell|vdig|vgen[1-3]|viohi|vpll|vsd|vusb|vusb2|vvideo$":
> + type: object
> + $ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: fsl,mc34708
> + then:
> + properties:
> + leds:
> + properties:
> + fsl,led-control:
> + minItems: 1
> + maxItems: 1
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/leds/common.h>
> +
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + pmic: mc13892@0 {
> + compatible = "fsl,mc13892";
> + reg = <0>;
> + spi-max-frequency = <1000000>;
> + spi-cs-high;
> + interrupt-parent = <&gpio0>;
> + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
> + fsl,mc13xxx-uses-rtc;
> + fsl,mc13xxx-uses-adc;
> +
> + leds {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + fsl,led-control = <0x000 0x000 0x0e0 0x000>;
> +
> + sysled@3 {
> + reg = <3>;
> + label = "system:red:live";
> + linux,default-trigger = "heartbeat";
> + };
> + };
> +
> + regulators {
> + sw1_reg: sw1 {
> + regulator-min-microvolt = <600000>;
> + regulator-max-microvolt = <1375000>;
> + regulator-boot-on;
> + regulator-always-on;
> + };
> +
> + sw2_reg: sw2 {
> + regulator-min-microvolt = <900000>;
> + regulator-max-microvolt = <1850000>;
> + regulator-boot-on;
> + regulator-always-on;
> + };
> + };
> + };
> + };
Powered by blists - more mailing lists