devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Alexander Kurz <akurz@blala.de>
Cc: "Lee Jones" <lee@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Dzmitry Sankouski" <dsankouski@gmail.com>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	devicetree@vger.kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/9] dt-bindings: mfd: fsl,mc13xxx: convert txt to DT schema
Date: Tue, 26 Aug 2025 18:03:20 -0500	[thread overview]
Message-ID: <20250826230320.GA646158-robh@kernel.org> (raw)
In-Reply-To: <20250823144441.12654-6-akurz@blala.de>

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@blala.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@blala.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;
> +                };
> +            };
> +        };
> +    };

  reply	other threads:[~2025-08-26 23:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-23 14:44 [PATCH v2 0/9] Fix, extend and support OF to mc13xxx pwrbutton Alexander Kurz
2025-08-23 14:44 ` [PATCH v2 1/9] Input: mc13783-pwrbutton: fix irq mixup Alexander Kurz
2025-08-23 14:44 ` [PATCH v2 2/9] Input: mc13783-pwrbutton: use managed resources Alexander Kurz
2025-08-23 14:44 ` [PATCH v2 3/9] Input: mc13783-pwrbutton: convert pdata members to array Alexander Kurz
2025-08-23 14:44 ` [PATCH v2 4/9] Input: mc13783-pwrbutton: enable other mc13xxx PMIC Alexander Kurz
2025-08-23 14:44 ` [PATCH v2 5/9] dt-bindings: mfd: fsl,mc13xxx: convert txt to DT schema Alexander Kurz
2025-08-26 23:03   ` Rob Herring [this message]
2025-08-23 14:44 ` [PATCH v2 6/9] dt-bindings: mfd: fsl,mc13xxx: add buttons node Alexander Kurz
2025-08-26 23:08   ` Rob Herring
2025-08-23 14:44 ` [PATCH v2 7/9] ARM: dts: imx: Use fsl,led-control as mc13xxx node name Alexander Kurz
2025-08-23 14:44 ` [PATCH v2 8/9] leds: mc13783: use fsl,led-control as " Alexander Kurz
2025-09-03 11:59   ` Lee Jones
2025-08-23 14:44 ` [PATCH v2 9/9] Input: mc13783-pwrbutton: add OF support Alexander Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250826230320.GA646158-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=akurz@blala.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dsankouski@gmail.com \
    --cc=heiko@sntech.de \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).