public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
Cc: "Support Opensource" <support.opensource@diasemi.com>,
	"Lee Jones" <lee@kernel.org>, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	"Michal Simek" <michal.simek@amd.com>,
	"Wensheng Wang" <wenswang@yeah.net>,
	"Rodrigo Gobbi" <rodrigo.gobbi.7@gmail.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Naresh Solanki" <naresh.solanki@9elements.com>,
	"Grant Peltier" <grantpeltier93@gmail.com>,
	"Vasileios Amoiridis" <vassilisamir@gmail.com>,
	"Dixit Parmar" <dixitparmar19@gmail.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	imx@lists.linux.dev
Subject: Re: [PATCH 1/1] dt-bindings: mfd: Convert dlg,da9052-i2c.txt to yaml format
Date: Thu, 6 Nov 2025 17:39:47 +0000	[thread overview]
Message-ID: <20251106-hull-petri-42878717ee85@spud> (raw)
In-Reply-To: <20251106013358.421809-1-Frank.Li@nxp.com>

[-- Attachment #1: Type: text/plain, Size: 7485 bytes --]

On Wed, Nov 05, 2025 at 08:33:56PM -0500, Frank Li wrote:
> Convert dlg,da9052-i2c.txt to yaml format.
> Additional changes:
> - compatible string fallback to dlg,da9052 to align existing dts files.
> - Add interrupts property.
> - Add ref to /schemas/spi/spi-peripheral-props.yaml#
> 
> Remove dlg,da9053 from trivial-devices.yaml.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  .../devicetree/bindings/mfd/da9052-i2c.txt    | 67 -------------
>  .../devicetree/bindings/mfd/dlg,da9052.yaml   | 93 +++++++++++++++++++
>  .../devicetree/bindings/trivial-devices.yaml  |  2 -
>  3 files changed, 93 insertions(+), 69 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/mfd/da9052-i2c.txt
>  create mode 100644 Documentation/devicetree/bindings/mfd/dlg,da9052.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/da9052-i2c.txt b/Documentation/devicetree/bindings/mfd/da9052-i2c.txt
> deleted file mode 100644
> index 07c69c0c6624c..0000000000000
> --- a/Documentation/devicetree/bindings/mfd/da9052-i2c.txt
> +++ /dev/null
> @@ -1,67 +0,0 @@
> -* Dialog DA9052/53 Power Management Integrated Circuit (PMIC)
> -
> -Required properties:
> -- compatible : Should be "dlg,da9052", "dlg,da9053-aa",
> -			 "dlg,da9053-ab", or "dlg,da9053-bb"
> -
> -Optional properties:
> -- dlg,tsi-as-adc : Boolean, if set the X+, X-, Y+, Y- touchscreen
> -                    input lines are used as general purpose analogue
> -					input.
> -- tsiref-supply: Phandle to the regulator, which provides the reference
> -                 voltage for the TSIREF pin. Must be provided when the
> -			     touchscreen pins are used for ADC purposes.
> -
> -Sub-nodes:
> -- regulators : Contain the regulator nodes. The DA9052/53 regulators are
> -  bound using their names as listed below:
> -
> -    buck1     : regulator BUCK CORE
> -    buck2     : regulator BUCK PRO
> -    buck3     : regulator BUCK MEM
> -    buck4     : regulator BUCK PERI
> -    ldo1      : regulator LDO1
> -    ldo2      : regulator LDO2
> -    ldo3      : regulator LDO3
> -    ldo4      : regulator LDO4
> -    ldo5      : regulator LDO5
> -    ldo6      : regulator LDO6
> -    ldo7      : regulator LDO7
> -    ldo8      : regulator LDO8
> -    ldo9      : regulator LDO9
> -    ldo10     : regulator LDO10
> -
> -  The bindings details of individual regulator device can be found in:
> -  Documentation/devicetree/bindings/regulator/regulator.txt
> -
> -Examples:
> -
> -i2c@63fc8000 { /* I2C1 */
> -
> -	pmic: dialog@48 {
> -		compatible = "dlg,da9053-aa";
> -		reg = <0x48>;
> -
> -		regulators {
> -			buck1 {
> -				regulator-min-microvolt = <500000>;
> -				regulator-max-microvolt = <2075000>;
> -			};
> -
> -			buck2 {
> -				regulator-min-microvolt = <500000>;
> -				regulator-max-microvolt = <2075000>;
> -			};
> -
> -			buck3 {
> -				regulator-min-microvolt = <925000>;
> -				regulator-max-microvolt = <2500000>;
> -			};
> -
> -			buck4 {
> -				regulator-min-microvolt = <925000>;
> -				regulator-max-microvolt = <2500000>;
> -			};
> -		};
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/mfd/dlg,da9052.yaml b/Documentation/devicetree/bindings/mfd/dlg,da9052.yaml
> new file mode 100644
> index 0000000000000..4ecd498864e4e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/dlg,da9052.yaml
> @@ -0,0 +1,93 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/dlg,da9052.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Dialog DA9052/53 Power Management Integrated Circuit (PMIC)
> +
> +maintainers:
> +  - Frank Li <Frank.Li@nxp.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - dlg,da9053

Should this actually exist? It was never in any drivers etc at all, and
as far as I can tell any users use the -XX suffixed ones. Probably this
is the only compatible that /should/ have been used, but it might be
pointless to add now.

> +              - dlg,da9053-aa
> +              - dlg,da9053-ab
> +              - dlg,da9053-bb

The driver also has a bc, I think that should be added.

> +          - const: dlg,da9052

Is this actually a correct fallback?
I know it is being used, but looking at the drivers I see things like:
	/* Select the appropriate current limit range */
	if (regulator->da9052->chip_id == DA9052)
		row = 0;
	else if (offset == 0)
		row = 1;
in both the battery and regulator drivers.
Might actually be the devicetrees are wrong here?

> +      - enum:
> +          - dlg,da9052
> +          - dlg,da9053-aa # Just for match existed old platform

Could you just change that one old platform using it?
Otherwise, conversion looks okay to me.

pw-bot: changes-requested

Cheers,
Conor.

> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  dlg,tsi-as-adc:
> +    type: boolean
> +    description:
> +      if set the X+, X-, Y+, Y- touchscreen input lines are used as general
> +      purpose analogue input.
> +
> +  tsiref-supply:
> +    description: The reference voltage for the TSIREF pin.
> +
> +  regulators:
> +    type: object
> +    additionalProperties: false
> +
> +    patternProperties:
> +      "^(ldo([1-9]|10)|buck[1-4])$":
> +        type: object
> +        $ref: /schemas/regulator/regulator.yaml#
> +        unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - regulators
> +
> +allOf:
> +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        pmic@48 {
> +            compatible = "dlg,da9053-aa";
> +            reg = <0x48>;
> +
> +            regulators {
> +                buck1 {
> +                    regulator-min-microvolt = <500000>;
> +                    regulator-max-microvolt = <2075000>;
> +                };
> +
> +                buck2 {
> +                    regulator-min-microvolt = <500000>;
> +                    regulator-max-microvolt = <2075000>;
> +                };
> +
> +                buck3 {
> +                    regulator-min-microvolt = <925000>;
> +                    regulator-max-microvolt = <2500000>;
> +                };
> +
> +                buck4 {
> +                    regulator-min-microvolt = <925000>;
> +                    regulator-max-microvolt = <2500000>;
> +                };
> +            };
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index 2eff6f274302a..17b72a8028e08 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -103,8 +103,6 @@ properties:
>            - dfrobot,sen0322
>              # DH electronics GmbH on-board CPLD trivial SPI device
>            - dh,dhcom-board
> -            # DA9053: flexible system level PMIC with multicore support
> -          - dlg,da9053
>              # DMARD05: 3-axis I2C Accelerometer
>            - domintech,dmard05
>              # DMARD06: 3-axis I2C Accelerometer
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-11-06 17:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  1:33 [PATCH 1/1] dt-bindings: mfd: Convert dlg,da9052-i2c.txt to yaml format Frank Li
2025-11-06 17:39 ` Conor Dooley [this message]
2025-11-06 19:22   ` Frank Li
2025-11-07 18:20     ` Conor Dooley

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=20251106-hull-petri-42878717ee85@spud \
    --to=conor@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dixitparmar19@gmail.com \
    --cc=grantpeltier93@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=michal.simek@amd.com \
    --cc=naresh.solanki@9elements.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=rodrigo.gobbi.7@gmail.com \
    --cc=support.opensource@diasemi.com \
    --cc=vassilisamir@gmail.com \
    --cc=wenswang@yeah.net \
    /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