public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Macpaul Lin <macpaul.lin@mediatek.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>
Cc: Bear Wang <bear.wang@mediatek.com>,
	Pablo Sun <pablo.sun@mediatek.com>,
	Macpaul Lin <macpaul@gmail.com>, Sen Chu <sen.chu@mediatek.com>,
	Jason-ch Chen <Jason-ch.Chen@mediatek.com>,
	Chris-qj chen <chris-qj.chen@mediatek.com>,
	MediaTek Chromebook Upstream
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
	Alexandre Mergnat <amergnat@baylibre.com>,
	Chen-Yu Tsai <wenst@chromium.org>
Subject: Re: [PATCH] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format
Date: Thu, 8 Aug 2024 14:04:30 +0200	[thread overview]
Message-ID: <2d89c86b-28b4-439f-824b-1d0560ff36bd@kernel.org> (raw)
In-Reply-To: <20240808105722.7222-1-macpaul.lin@mediatek.com>

On 08/08/2024 12:57, Macpaul Lin wrote:
> Convert the mfd: mediatek: mt6397 binding to DT schema format.
> 
> New updates in this conversion:
>  - Align generic names of DT schema "audio-codec" and "regulators".
>  - mt6397-regulators: Replace the "txt" reference with newly added DT
>    schema.
> 
> Signed-off-by: Sen Chu <sen.chu@mediatek.com>
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  .../bindings/mfd/mediatek,mt6397.yaml         | 202 ++++++++++++++++++
>  .../devicetree/bindings/mfd/mt6397.txt        | 110 ----------

You are doing conversions in odd order... and ignore my comments. The
example from your regulator binding is supposed to be here - I wrote it
last time.

Due to doing changes totally unsynchronized, this CANNOT be merged
without unnecessary maintainer coordination, because of dependency.

Sorry, that's not how it works for MFD devices.

Perform conversion of entire device in ONE patchset.

>  2 files changed, 202 insertions(+), 110 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>  delete mode 100644 Documentation/devicetree/bindings/mfd/mt6397.txt
> 
> Changes for v1:
>  - This patch depends on conversion of mediatek,mt6397-regulator.yaml
>    [1] https://lore.kernel.org/lkml/20240807091738.18387-1-macpaul.lin@mediatek.com/T/
> 
> diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
> new file mode 100644
> index 0000000..cfbf2215
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
> @@ -0,0 +1,202 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT6397/MT6323 Multifunction Device
> +
> +maintainers:
> +  - Sen Chu <sen.chu@mediatek.com>
> +  - Macpaul Lin <macpaul.lin@mediatek.com>
> +
> +description: |
> +  MT6397/MT6323 is a multifunction device with the following sub modules:

MFD is Linuxism, avoid it.

> +  - Regulator
> +  - RTC
> +  - Audio codec
> +  - GPIO
> +  - Clock
> +  - LED
> +  - Keys
> +  - Power controller
> +
> +  It is interfaced to host controller using SPI interface by a proprietary hardware
> +  called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap.
> +  See the following for pwarp node definitions:
> +  ../soc/mediatek/mediatek,pwrap.yaml

Drop, instead add proper ref or compatible in parent node.

> +
> +  This document describes the binding for MFD device and its sub module.

Drop

> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - mediatek,mt6323
> +          - mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
> +          - mediatek,mt6357
> +          - mediatek,mt6358
> +          - mediatek,mt6359
> +          - mediatek,mt6397
> +      - items:
> +          - enum:
> +              - mediatek,mt6366 # "mediatek,mt6366", "mediatek,mt6358" for PMIC MT6366

Drop comment, it is obvious. Don't repeat constraints in free form text.

> +          - const: mediatek,mt6358
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  interrupt-controller: true
> +
> +  "#interrupt-cells":
> +    const: 2
> +
> +  rtc:
> +    type: object
> +    unevaluatedProperties: false
> +    description:
> +      Real Time Clock (RTC)
> +      See ../rtc/rtc-mt6397.txt

No, convert the binding.

> +    properties:
> +      compatible:
> +        oneOf:
> +          - enum:
> +              - mediatek,mt6323-rtc
> +              - mediatek,mt6331-rtc
> +              - mediatek,mt6358-rtc
> +              - mediatek,mt6397-rtc
> +          - items:
> +              - enum:
> +                  - mediatek,mt6366-rtc # RTC MT6366

Drop all such comments.

> +              - const: mediatek,mt6358-rtc
> +
> +  regulators:
> +    type: object
> +    oneOf:
> +      - $ref: /schemas/regulator/mediatek,mt6358-regulator.yaml
> +      - $ref: /schemas/regulator/mediatek,mt6397-regulator.yaml

And how is it supposed to be tested?



> +    unevaluatedProperties: false
> +    description:
> +      Regulators
> +      For mt6323, see ../regulator/mt6323-regulator.txt

Drop, useless.

> +    properties:
> +      compatible:
> +        oneOf:
> +          - enum:
> +              - mediatek,mt6323-regulator
> +              - mediatek,mt6358-regulator
> +              - mediatek,mt6397-regulator
> +          - items:
> +              - enum:
> +                  - mediatek,mt6366-regulator # Regulator MT6366
> +              - const: mediatek,mt6358-regulator
> +
> +  audio-codec:
> +    type: object
> +    unevaluatedProperties: false

This does not make sense. You do not have any ref here.

> +    description:
> +      Audio codec
> +    properties:
> +      compatible:
> +        oneOf:
> +          - enum:
> +              - mediatek,mt6397-codec
> +              - mediatek,mt6358-sound
> +          - items:
> +              - enum:
> +                  - mediatek,mt6366-sound # Codec MT6366
> +              - const: mediatek,mt6358-sound

This wasn't in the old binding. Commit msg also does not explain why you
are doing changes from conversion.

> +
> +  clk:
> +    type: object
> +    unevaluatedProperties: false

Again, no, it does not work like this. See example schema for
explanation of this.

Convert all children - entire device. Then either use ref or
additionalProperties: true. See Qualcomm mdss bindings for example.

> +    description:
> +      Clock

Your descriptions are useless. You just said "clk" node is "clock". Really?

> +    properties:
> +      compatible:
> +        const: mediatek,mt6397-clk
> +
> +  led:
> +    type: object
> +    unevaluatedProperties: false
> +    description:
> +      LED
> +      See ../leds/leds-mt6323.txt for more information

No

> +    properties:
> +      compatible:
> +        const: mediatek,mt6323-led
> +
> +  keys:
> +    type: object
> +    $ref: /schemas/input/mediatek,pmic-keys.yaml
> +    unevaluatedProperties: false
> +    description: Keys

Keys are keys? Could keys be anything else?

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    pwrap {

Drop

> +        pmic {
> +            compatible = "mediatek,mt6397";
> +            interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
> +            interrupt-controller;
> +            #interrupt-cells = <2>;
> +
> +            mt6397_codec: audio-codec {
> +                compatible = "mediatek,mt6397-codec";
> +            };
> +
> +            mt6397_regulators: regulators {
> +                compatible = "mediatek,mt6397-regulator";
> +
> +                mt6397_vpca15_reg: buck_vpca15 {
> +                    regulator-name = "vpca15";
> +                    regulator-min-microvolt = <850000>;
> +                    regulator-max-microvolt = <1400000>;
> +                    regulator-ramp-delay = <12500>;
> +                    regulator-always-on;
> +                };
> +
> +                mt6397_vgp4_reg: ldo_vgp4 {
> +                    regulator-name = "vgp4";
> +                    regulator-min-microvolt = <1200000>;
> +                    regulator-max-microvolt = <3300000>;
> +                    regulator-enable-ramp-delay = <218>;
> +                };
> +            };

Incomplete.

The parent device example is supposed to be 100% complete.

Best regards,
Krzysztof


  reply	other threads:[~2024-08-08 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 10:57 [PATCH] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format Macpaul Lin
2024-08-08 12:04 ` Krzysztof Kozlowski [this message]
2024-08-23  6:44   ` Macpaul Lin
2024-08-23  8:05     ` Krzysztof Kozlowski
2024-08-08 12:16 ` Rob Herring (Arm)

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=2d89c86b-28b4-439f-824b-1d0560ff36bd@kernel.org \
    --to=krzk@kernel.org \
    --cc=Jason-ch.Chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=amergnat@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bear.wang@mediatek.com \
    --cc=chris-qj.chen@mediatek.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=macpaul.lin@mediatek.com \
    --cc=macpaul@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=pablo.sun@mediatek.com \
    --cc=robh@kernel.org \
    --cc=sen.chu@mediatek.com \
    --cc=wenst@chromium.org \
    /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