Devicetree
 help / color / mirror / Atom feed
From: Dhruva G <goledhruva@gmail.com>
To: Eduard Bostina <egbostina@gmail.com>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Lee Jones <lee@kernel.org>,
	linux-kernel@vger.kernel.org, mfd@lists.linux.dev,
	Rob Herring <robh@kernel.org>
Cc: daniel.baluta@nxp.com, simona.toaca@nxp.com, m-chawdhry@ti.com
Subject: Re: [PATCH v2] dt-bindings: mfd: Convert TI TWL6040 to DT schema
Date: Sun, 16 Aug 2026 21:30:24 +0530	[thread overview]
Message-ID: <031e1ccd-c4d6-4dfe-8920-fa7b0e5deb7a@gmail.com> (raw)
In-Reply-To: <20260816092847.2522994-1-egbostina@gmail.com>

Hi Eduard,

On 16-08-2026 14:58, Eduard Bostina wrote:
> Convert the Texas Instruments TWL6040 audio codecs family bindings to DT
> schema.
> 
> During the conversion, the following updates were made:
> - Changed 'twl6040,audpwron-gpio' to 'ti,audpwron-gpio', which was
>   misnamed in the old txt binding.
> - Made 'gpio-controller', '#gpio-cells', and 'ti,audpwron-gpio' optional
>   because modern platforms do not require them.
> - Renamed the vibra 'vddvibl_uV'/'vddvibr_uV' properties to
>   'ti,vddvibl-uV'/'ti,vddvibr-uV', the names actually read by the
>   twl6040-vibra driver.
> 
> Signed-off-by: Eduard Bostina <egbostina@gmail.com>
> ---
> Changes in v2:
> - Renamed the vibra 'vddvibl_uV'/'vddvibr_uV' properties to 
>   'ti,vddvibl-uV'/'ti,vddvibr-uV', the names actually read by the
>   twl6040-vibra driver.
> 
> Link to v1: https://lore.kernel.org/all/20260815083451.2147129-1-egbostina@gmail.com/
> 
>  .../devicetree/bindings/mfd/ti,twl6040.yaml   | 142 ++++++++++++++++++
>  .../devicetree/bindings/mfd/twl6040.txt       |  67 ---------
>  2 files changed, 142 insertions(+), 67 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/ti,twl6040.yaml
>  delete mode 100644 Documentation/devicetree/bindings/mfd/twl6040.txt
> 
> diff --git a/Documentation/devicetree/bindings/mfd/ti,twl6040.yaml b/Documentation/devicetree/bindings/mfd/ti,twl6040.yaml
> new file mode 100644
[..snip..]
> +
> +  vddvibl-supply:
> +    description: Regulator for the left vibra motor
> +
> +  vddvibr-supply:
> +    description: Regulator for the right vibra motor
> +
> +  vibra:
> +    type: object
> +    additionalProperties: false
> +    properties:
> +      ti,vibldrv-res:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: Resistance parameter for left driver
> +      ti,vibrdrv-res:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: Resistance parameter for right driver
> +      ti,viblmotor-res:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: Resistance parameter for left motor
> +      ti,vibrmotor-res:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: Resistance parameter for right motor
> +      ti,vddvibl-uV:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: vddvibl default voltage if it needs to be changed
> +      ti,vddvibr-uV:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: vddvibr default voltage if it needs to be changed
> +
> +    required:
> +      - ti,vibldrv-res
> +      - ti,vibrdrv-res
> +      - ti,viblmotor-res
> +      - ti,vibrmotor-res
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#clock-cells"
> +  - vio-supply
> +  - v2v1-supply

I think the vibra supplies need to be conditionally required when the vibra child is present. 
twl6040_has_vibra() uses the presence of this child to instantiate twl6040-vibra, whose probe
then unconditionally gets both vddvibl and vddvibr.

Would something like this make sense?

allOf:
  - if:
      required:
        - vibra
    then:
      required:
        - vddvibl-supply
        - vddvibr-supply

This would still allow TWL6040 users without vibra, while retaining the dependency for users which enable it.

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        audio-codec@4b {
> +            compatible = "ti,twl6040";
> +            reg = <0x4b>;
> +            interrupts = <0 119 IRQ_TYPE_LEVEL_HIGH>;
> +            interrupt-parent = <&gic>;
> +            gpio-controller;
> +            #gpio-cells = <1>;
> +            #clock-cells = <0>;
> +            ti,audpwron-gpio = <&gpio4 31 0>;
> +
> +            vio-supply = <&v1v8>;
> +            v2v1-supply = <&v2v1>;
> +            enable-active-high;
> +
> +            /* regulators for vibra motor */
> +            vddvibl-supply = <&vbat>;
> +            vddvibr-supply = <&vbat>;
> +
> +            vibra {
> +                ti,vibldrv-res = <8>;
> +                ti,vibrdrv-res = <3>;
> +                ti,viblmotor-res = <10>;
> +                ti,vibrmotor-res = <10>;
> +            };
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/mfd/twl6040.txt b/Documentation/devicetree/bindings/mfd/twl6040.txt
> deleted file mode 100644

[..snip..]

      parent reply	other threads:[~2026-08-16 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16  9:28 [PATCH v2] dt-bindings: mfd: Convert TI TWL6040 to DT schema Eduard Bostina
2026-08-16  9:36 ` sashiko-bot
2026-08-16 16:00 ` Dhruva G [this message]

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=031e1ccd-c4d6-4dfe-8920-fa7b0e5deb7a@gmail.com \
    --to=goledhruva@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=egbostina@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-chawdhry@ti.com \
    --cc=mfd@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=simona.toaca@nxp.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