public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@codeconstruct.com.au>
To: Delphine CC Chiu <delphine_cc_chiu@wiwynn.com>,
	patrick@stwcx.xyz, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Joel Stanley <joel@jms.id.au>
Cc: Marshall Zhan <marshall.zhan.wiwynn@gmail.com>,
	 devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] ARM: dts: aspeed: yosemite4: add fan led config
Date: Wed, 08 Jan 2025 11:49:57 +1030	[thread overview]
Message-ID: <d90f338ca7a07d3e95ee6da08d84a74aeb7d866d.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20241220043852.1096074-1-delphine_cc_chiu@wiwynn.com>

Hi Marshall,

On Fri, 2024-12-20 at 12:38 +0800, Delphine CC Chiu wrote:
> From: Marshall Zhan <marshall.zhan.wiwynn@gmail.com>
> 
> Set fan led config in yosemite4 DTS.
> 
> Signed-off-by: Marshall Zhan <marshall.zhan.wiwynn@gmail.com>
> Signed-off-by: Delphine CC Chiu <delphine_cc_chiu@wiwynn.com>
> ---
>  .../aspeed/aspeed-bmc-facebook-yosemite4.dts  | 166
> +++++++++++++++++-
>  1 file changed, 163 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-
> yosemite4.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-
> yosemite4.dts
> index ab4904cf2c0e..b5865efcc80c 100644
> --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
> +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts
> @@ -73,6 +73,160 @@ tpm@0 {
>                         spi-max-frequency = <33000000>;
>                 };
>         };
> +
> +       leds {
> +               compatible = "gpio-leds";
> +
> +               led_identify {

The binding prefers naming the led nodes differently:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/leds/leds-gpio.yaml?h=v6.12#n22

If you must name the nodes this way, can you document why in a comment
in the devicetree?

> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&identify_gpio 8 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan0_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio0 4 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan0_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio0 5 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan1_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio0 10 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan1_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio0 11 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan2_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio1 4 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan2_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio1 5 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan3_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio1 10 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan3_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio1 11 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan4_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio0 2 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan4_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio0 3 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan5_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio0 8 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan5_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio0 9 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan6_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio1 2 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan6_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio1 3 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan7_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio1 8 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan7_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio1 9 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan8_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio0 0 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan8_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio0 1 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan9_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio0 6 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan9_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio0 7 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan10_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio1 0 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan10_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio1 1 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan11_blue {
> +                       retain-state-shutdown;
> +                       default-state = "on";
> +                       gpios = <&led_gpio1 6 GPIO_ACTIVE_HIGH>;
> +               };
> +
> +               led_fan11_amber {
> +                       retain-state-shutdown;
> +                       default-state = "off";
> +                       gpios = <&led_gpio1 7 GPIO_ACTIVE_HIGH>;
> +               };
> +       };
>  };
>  
>  &uart1 {
> @@ -995,11 +1149,17 @@ gpio@20 {
>                                 #gpio-cells = <2>;
>                         };
>  
> -                       gpio@21 {
> +                       identify_gpio: gpio@21 {

Does this expander really only expose the identify led?

>                                 compatible = "nxp,pca9506";
>                                 reg = <0x21>;
>                                 gpio-controller;
>                                 #gpio-cells = <2>;
> +                               gpio-line-names = "","","","",
> +                                                 "","","","",
> +                                                 "LED_IDENTIFY",
> +                                                
> "","","","","","","",
> +                                                
> "","","","","","","","",
> +                                                
> "","","","","","","","";
>                         };
>  
>                         gpio@22 {
> @@ -1173,7 +1333,7 @@ eeprom@52 {
>                                 reg = <0x52>;
>                         };
>  
> -                       gpio@61 {
> +                       led_gpio0: gpio@61 {

Bit of nitpick, but perhaps the node label could be improved?
fan_leds0? And fan_leds1 below?

>                                 compatible = "nxp,pca9552";
>                                 reg = <0x61>;
>                                 #address-cells = <1>;
> @@ -1221,7 +1381,7 @@ eeprom@52 {
>                                 reg = <0x52>;
>                         };
>  
> -                       gpio@61 {
> +                       led_gpio1: gpio@61 {
>                                 compatible = "nxp,pca9552";
>                                 reg = <0x61>;
>                                 #address-cells = <1>;

Cheers,

Andrew

      reply	other threads:[~2025-01-08  1:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20  4:38 [PATCH v1] ARM: dts: aspeed: yosemite4: add fan led config Delphine CC Chiu
2025-01-08  1:19 ` Andrew Jeffery [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=d90f338ca7a07d3e95ee6da08d84a74aeb7d866d.camel@codeconstruct.com.au \
    --to=andrew@codeconstruct.com.au \
    --cc=conor+dt@kernel.org \
    --cc=delphine_cc_chiu@wiwynn.com \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marshall.zhan.wiwynn@gmail.com \
    --cc=patrick@stwcx.xyz \
    --cc=robh@kernel.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