devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Junhao Xie <bigfoot@classfun.cn>,
	devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Cc: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Lee Jones <lee@kernel.org>, Sebastian Reichel <sre@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Heiko Stuebner <heiko@sntech.de>, Chukun Pan <amadeus@jmu.edu.cn>
Subject: Re: [PATCH 8/9] dt-bindings: Add documentation for Photonicat PMU
Date: Fri, 6 Sep 2024 11:51:59 +0200	[thread overview]
Message-ID: <dbc6af20-886a-46fb-a16c-dbcb5861478c@kernel.org> (raw)
In-Reply-To: <20240906093630.2428329-9-bigfoot@classfun.cn>

On 06/09/2024 11:36, Junhao Xie wrote:
> Add device tree binding documentation for Photonicat PMU MFD, LEDs,
> hardware monitor, power off, power supply, real-time clock watchdog.
> 
> Signed-off-by: Junhao Xie <bigfoot@classfun.cn>
> ---
>  .../hwmon/ariaboard,photonicat-pmu-hwmon.yaml |  40 +++++++
>  .../leds/ariaboard,photonicat-pmu-leds.yaml   |  41 +++++++
>  .../mfd/ariaboard,photonicat-pmu.yaml         | 107 ++++++++++++++++++
>  .../ariaboard,photonicat-pmu-poweroff.yaml    |  34 ++++++
>  .../ariaboard,photonicat-pmu-supply.yaml      |  55 +++++++++
>  .../rtc/ariaboard,photonicat-pmu-rtc.yaml     |  37 ++++++
>  .../ariaboard,photonicat-pmu-watchdog.yaml    |  37 ++++++
>  7 files changed, 351 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/ariaboard,photonicat-pmu-hwmon.yaml
>  create mode 100644 Documentation/devicetree/bindings/leds/ariaboard,photonicat-pmu-leds.yaml
>  create mode 100644 Documentation/devicetree/bindings/mfd/ariaboard,photonicat-pmu.yaml
>  create mode 100644 Documentation/devicetree/bindings/power/reset/ariaboard,photonicat-pmu-poweroff.yaml
>  create mode 100644 Documentation/devicetree/bindings/power/supply/ariaboard,photonicat-pmu-supply.yaml
>  create mode 100644 Documentation/devicetree/bindings/rtc/ariaboard,photonicat-pmu-rtc.yaml
>  create mode 100644 Documentation/devicetree/bindings/watchdog/ariaboard,photonicat-pmu-watchdog.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/ariaboard,photonicat-pmu-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/ariaboard,photonicat-pmu-hwmon.yaml
> new file mode 100644
> index 000000000000..c9b1bab20c31
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/ariaboard,photonicat-pmu-hwmon.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/ariaboard,photonicat-pmu-hwmon.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Photonicat PMU Hardware Monitor
> +
> +maintainers:
> +  - Junhao Xie <bigfoot@classfun.cn>
> +
> +description:
> +  Board temperature sensor on the Photonicat PMU MCU
> +
> +properties:
> +  compatible:
> +    const: ariaboard,photonicat-pmu-hwmon
> +
> +  label:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: Label for hwmon device

No resources here. Fold it into parent binding.

> +
> +required:
> +  - compatible
> +  - label
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +      serial {
> +          mcu {
> +              compatible = "ariaboard,photonicat-pmu";

Drop, no need.

> +

Messed indentation.

Entire example is redundant. Merge it to parent binding.


> +              hwmon {
> +                  compatible = "ariaboard,photonicat-pmu-hwmon";
> +                  label = "pcat_board";
> +              };
> +          };
> +      };
> diff --git a/Documentation/devicetree/bindings/leds/ariaboard,photonicat-pmu-leds.yaml b/Documentation/devicetree/bindings/leds/ariaboard,photonicat-pmu-leds.yaml
> new file mode 100644
> index 000000000000..6ccb0e691b09
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/ariaboard,photonicat-pmu-leds.yaml
> @@ -0,0 +1,41 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/ariaboard,photonicat-pmu-leds.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Photonicat PMU LEDs
> +
> +maintainers:
> +  - Junhao Xie <bigfoot@classfun.cn>
> +
> +description:
> +  LEDs on the Photonicat PMU MCU
> +
> +allOf:
> +  - $ref: common.yaml#
> +
> +properties:
> +  compatible:
> +    const: ariaboard,photonicat-pmu-leds

Your compatibles per device do not make much sense. You organized
bindings per drivers, but that's not what we want.

> +
> +  label: true

Drop

> +
> +required:
> +  - compatible
> +  - label
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +      serial {
> +          mcu {
> +              compatible = "ariaboard,photonicat-pmu";
> +
> +              leds-status {
> +                  compatible = "ariaboard,photonicat-pmu-leds";
> +                  label = "net-status";
> +              };
> +          };
> +      };
> diff --git a/Documentation/devicetree/bindings/mfd/ariaboard,photonicat-pmu.yaml b/Documentation/devicetree/bindings/mfd/ariaboard,photonicat-pmu.yaml
> new file mode 100644
> index 000000000000..df16d9507821
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/ariaboard,photonicat-pmu.yaml
> @@ -0,0 +1,107 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/ariaboard,photonicat-pmu.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Ariaboard Photonicat PMU
> +
> +maintainers:
> +  - Junhao Xie <bigfoot@classfun.cn>
> +
> +description:
> +  Driver for the Power Management MCU in the Ariaboard Photonicat,

Bindings are for hardware, not drivers. Drop it everywhere and explain
hardware.

> +  which provides battery and charger power supply, real-time clock,
> +  watchdog, hardware shutdown.
> +
> +properties:
> +  compatible:
> +    const: ariaboard,photonicat-pmu

That's the only compatible you should have. Drop all others.

> +
> +  current-speed:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 115200
> +    description: PMU Serial baudrate
> +
> +  local-address:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1
> +    maximum: 127
> +    default: 1
> +    description: CPU board address

Address of what? In which notation? It's part of this hardware.


> +
> +  remote-address:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1
> +    maximum: 127
> +    default: 1
> +    description: PMU board address

Eee, no. Your board knows its address. You do not have to tell it.

> +
> +  hwmon:
> +    $ref: /schemas/hwmon/ariaboard,photonicat-pmu-hwmon.yaml
> +
> +  poweroff:
> +    $ref: /schemas/power/reset/ariaboard,photonicat-pmu-poweroff.yaml
> +
> +  rtc:
> +    $ref: /schemas/rtc/ariaboard,photonicat-pmu-rtc.yaml
> +
> +  watchdog:
> +    $ref: /schemas/watchdog/ariaboard,photonicat-pmu-watchdog.yaml
> +
> +patternProperties:
> +  '^leds-(status)':

That's not a pattern.

> +    $ref: /schemas/leds/ariaboard,photonicat-pmu-leds.yaml
> +
> +  '^supply-(battery|charger)$':
> +    $ref: /schemas/power/supply/ariaboard,photonicat-pmu-supply.yaml

Why two nodes?

> +
> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +      serial {
> +          photonicat-pmu {
> +              compatible = "ariaboard,photonicat-pmu";
> +              current-speed = <115200>;
> +              local-address = <1>;
> +              remote-address = <1>;
> +
> +              supply-battery {
> +                  compatible = "ariaboard,photonicat-pmu-supply";
> +                  label = "battery";

Nope, drop label.

> +                  type = "battery";

No, there is no type property.

Missing monitored battery.

> +              };
> +
> +              supply-charger {
> +                  compatible = "ariaboard,photonicat-pmu-supply";
> +                  label = "charger";
> +                  type = "charger";
> +              };
> +
> +              hwmon {
> +                  compatible = "ariaboard,photonicat-pmu-hwmon";
> +                  label = "pcat_board";
> +              };
> +
> +              leds-status {
> +                  compatible = "ariaboard,photonicat-pmu-leds";
> +                  label = "net-status";
> +              };
> +
> +              poweroff {
> +                  compatible = "ariaboard,photonicat-pmu-poweroff";
> +              };
> +
> +              rtc {
> +                  compatible = "ariaboard,photonicat-pmu-rtc";
> +              };
> +
> +              watchdog {
> +                  compatible = "ariaboard,photonicat-pmu-watchdog";
> +              };

These are seriously redundant and useless nodes.  There is nothing
beneficial from the nodes above - they are all empty, without resources.
Drop all of them.

I finish the review here.

Best regards,
Krzysztof


  reply	other threads:[~2024-09-06  9:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06  9:36 [PATCH 0/9] Introduce Photonicat power management MCU driver Junhao Xie
2024-09-06  9:36 ` [PATCH 1/9] mfd: Add driver for Photonicat power management MCU Junhao Xie
2024-09-06  9:43   ` Krzysztof Kozlowski
2024-09-06 10:40     ` Junhao Xie
2024-09-07  8:10   ` Markus Elfring
2024-09-07 14:46     ` Junhao Xie
2024-09-07  8:44   ` Markus Elfring
2024-09-07 14:33     ` Junhao Xie
2024-09-08  8:14       ` Krzysztof Kozlowski
2024-09-12  7:55         ` Lee Jones
2024-09-06  9:36 ` [PATCH 2/9] power: reset: add Photonicat PMU poweroff driver Junhao Xie
2024-09-06  9:44   ` Krzysztof Kozlowski
2024-09-06 10:05     ` Junhao Xie
2024-09-06  9:36 ` [PATCH 3/9] watchdog: Add Photonicat PMU watchdog driver Junhao Xie
2024-09-06 11:52   ` Guenter Roeck
2024-09-06 13:41     ` Junhao Xie
2024-09-06  9:36 ` [PATCH 4/9] power: supply: photonicat-supply: Add Photonicat PMU battery and charger Junhao Xie
2024-09-06  9:36 ` [PATCH 5/9] rtc: Add Photonicat PMU real-time clock Junhao Xie
2024-09-06  9:36 ` [PATCH 6/9] hwmon: Add support for Photonicat PMU board temperature sensor Junhao Xie
2024-09-06 11:41   ` Guenter Roeck
2024-09-06 13:49     ` Junhao Xie
2024-09-06 14:33       ` Guenter Roeck
2024-09-06  9:36 ` [PATCH 7/9] leds: add Photonicat PMU LED driver Junhao Xie
2024-10-02 15:35   ` Lee Jones
2024-11-08  3:48     ` Junhao Xie
2024-09-06  9:36 ` [PATCH 8/9] dt-bindings: Add documentation for Photonicat PMU Junhao Xie
2024-09-06  9:51   ` Krzysztof Kozlowski [this message]
2024-09-07 14:27     ` Junhao Xie
2024-09-08  8:13       ` Krzysztof Kozlowski
2024-09-06  9:36 ` [PATCH 9/9] arm64: dts: rockchip: add Photonicat PMU support for Ariaboard Photonicat Junhao Xie
2024-09-06  9:53   ` Krzysztof Kozlowski
2024-09-06 13:56     ` Junhao Xie
2024-09-06  9:45 ` [PATCH 0/9] Introduce Photonicat power management MCU driver Krzysztof Kozlowski
2024-09-06 10:20   ` Junhao Xie

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=dbc6af20-886a-46fb-a16c-dbcb5861478c@kernel.org \
    --to=krzk@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amadeus@jmu.edu.cn \
    --cc=bigfoot@classfun.cn \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pavel@ucw.cz \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=wim@linux-watchdog.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;
as well as URLs for NNTP newsgroup(s).