Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Luca Leonardo Scorcia" <l.scorcia@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v8 3/9] regulator: dt-bindings: Add MediaTek MT6392 PMIC
Date: Sat, 20 Jun 2026 20:15:20 +0000	[thread overview]
Message-ID: <20260620201521.01B531F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260620200032.334192-4-l.scorcia@gmail.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Invalid use of array validation keywords (`items`, `maxItems`) on the scalar `regulator-initial-mode` property, allowing any integer value to bypass the intended enum constraints.
- [Low] The dt-binding YAML file is completely missing an `examples:` section.
- [Low] Exposing an internal, hardwired connection (`avddldo-supply`) as an external device tree property.
--

commit 17d808769b24018a674d4068d9bab99043b30c55
Author: Luca Leonardo Scorcia <l.scorcia@gmail.com>

regulator: dt-bindings: Add MediaTek MT6392 PMIC

Add bindings for the regulators found in the MediaTek MT6392 PMIC,
usually found in board designs using the MediaTek MT8516/MT8167 SoCs.

> diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
> new file mode 100644
> index 0000000000000..f3d5a3498d184
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6392-regulator.yaml
> @@ -0,0 +1,118 @@

[ ... ]

> +  vproc-supply:
> +    description: Supply for buck regulator vproc
> +  vcore-supply:
> +    description: Supply for buck regulator vcore
> +  vsys-supply:
> +    description: Supply for buck regulator vsys
> +  avddldo-supply:
> +    description:
> +      Supply for AVDD LDOs (vm, vio18, vcn18, vcamd, vcamio). According to the data sheet
> +      this is an internal supply derived from vsys.

[Severity: Low]
Should this internal supply be exposed as an external device tree property?

Since the description notes this is an internal supply derived from vsys,
exposing it here requires board device trees to describe internal IC routing
instead of external hardware wiring.

[ ... ]

> +patternProperties:
> +  "^v(core|proc|sys)$":
> +    description: Buck regulators
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +    properties:
> +      regulator-allowed-modes:
> +        description:
> +          BUCK regulators can set regulator-allowed-modes to values specified in
> +          dt-bindings/regulator/mediatek,mt6392-regulator.h
> +        items:
> +          enum: [0, 1]
> +        minItems: 1
> +        maxItems: 2
> +      regulator-initial-mode:
> +        description:
> +          BUCK regulators can set regulator-initial-mode to values specified in
> +          dt-bindings/regulator/mediatek,mt6392-regulator.h
> +        items:
> +          enum: [0, 1]
> +        maxItems: 1

[Severity: Medium]
Is it correct to use array validation keywords like items and maxItems for
regulator-initial-mode?

Since regulator-initial-mode is defined as a scalar uint32 in regulator.yaml,
applying array constraints to it causes the schema validation to ignore them.
This allows any arbitrary integer value to bypass the enum constraints.

[ ... ]

> +  "^v(adc18|camio|cn18|io18|xo22|m25|aud28|io28|rtc|usb)$":
> +    description: LDOs with fixed output and mode setting
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +    properties:
> +      regulator-allowed-modes:

[ ... ]

> +      regulator-initial-mode:
> +        description:
> +          LDO regulators can set regulator-initial-mode to values specified in
> +          dt-bindings/regulator/mediatek,mt6392-regulator.h
> +        items:
> +          enum: [0, 2]
> +        maxItems: 1

[Severity: Medium]
Does this have the same issue with array validation keywords being applied to
a scalar property?

[ ... ]

> +  "^v(aud22|camaf|camd|cn35|efuse|emc3v3|gp1|gp2|m|mc|mch)$":
> +    description: LDOs with adjustable output and mode setting
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +    properties:
> +      regulator-allowed-modes:

[ ... ]

> +      regulator-initial-mode:
> +        description:
> +          LDO regulators can set regulator-initial-mode to values specified in
> +          dt-bindings/regulator/mediatek,mt6392-regulator.h
> +        items:
> +          enum: [0, 2]
> +        maxItems: 1

[Severity: Medium]
This regulator-initial-mode property also appears to be using array validation
keywords for a scalar value.

> +
> +required:
> +  - compatible
> +
> +additionalProperties: false

[Severity: Low]
Is there an examples section missing from this file?

Device tree binding guidelines require every standalone schema file to include
an examples section to provide a validated example of the device node and to
pass dt_binding_check validation.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260620200032.334192-1-l.scorcia@gmail.com?part=3

  reply	other threads:[~2026-06-20 20:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-20 19:56 [PATCH v8 0/9] Add support for MT6392 PMIC Luca Leonardo Scorcia
2026-06-20 19:56 ` [PATCH v8 1/9] dt-bindings: mfd: mt6397: Add " Luca Leonardo Scorcia
2026-06-20 20:14   ` sashiko-bot
2026-06-20 19:56 ` [PATCH v8 2/9] dt-bindings: input: mtk-pmic-keys: Add MT6392 PMIC keys Luca Leonardo Scorcia
2026-06-20 19:56 ` [PATCH v8 3/9] regulator: dt-bindings: Add MediaTek MT6392 PMIC Luca Leonardo Scorcia
2026-06-20 20:15   ` sashiko-bot [this message]
2026-06-20 19:56 ` [PATCH v8 4/9] mfd: mt6397: Use MFD_CELL_* to describe sub-devices Luca Leonardo Scorcia
2026-06-20 19:56 ` [PATCH v8 5/9] mfd: mt6397: Add support for MT6392 PMIC Luca Leonardo Scorcia
2026-06-20 20:20   ` sashiko-bot
2026-06-20 19:56 ` [PATCH v8 6/9] input: keyboard: mtk-pmic-keys: Add MT6392 support Luca Leonardo Scorcia
2026-06-20 20:16   ` sashiko-bot
2026-06-20 19:56 ` [PATCH v8 7/9] pinctrl: mediatek: mt6397: Add MediaTek MT6392 Luca Leonardo Scorcia
2026-06-20 20:16   ` sashiko-bot
2026-06-20 19:56 ` [PATCH v8 8/9] regulator: Add MediaTek MT6392 regulator Luca Leonardo Scorcia
2026-06-20 20:13   ` sashiko-bot
2026-06-20 19:56 ` [PATCH v8 9/9] arm64: dts: mediatek: Add MediaTek MT6392 PMIC dtsi Luca Leonardo Scorcia
2026-06-20 20:19   ` sashiko-bot

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=20260620201521.01B531F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=l.scorcia@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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