linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Zhang <william.zhang@broadcom.com>
To: "Linus Walleij" <linus.walleij@linaro.org>,
	"Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Anand Gore" <anand.gore@broadcom.com>,
	"Kursad Oney" <kursad.oney@broadcom.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org
Subject: RE: [PATCH 3/4] leds: bcm63128: Handle shift register config
Date: Wed, 25 Sep 2024 17:17:46 -0700	[thread overview]
Message-ID: <3083039c1f8ec79e8e0803fc43d84156@mail.gmail.com> (raw)
In-Reply-To: <20240920-bcm63138-leds-v1-3-c150871324a0@linaro.org>

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

> -----Original Message-----
> From: Linus Walleij <linus.walleij@linaro.org>
> Sent: Friday, September 20, 2024 2:59 PM
> To: Pavel Machek <pavel@ucw.cz>; Lee Jones <lee@kernel.org>; Rob
> Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>;
> Conor Dooley <conor+dt@kernel.org>; William Zhang
> <william.zhang@broadcom.com>; Anand Gore
> <anand.gore@broadcom.com>; Kursad Oney
> <kursad.oney@broadcom.com>; Florian Fainelli
> <florian.fainelli@broadcom.com>; Rafał Miłecki <rafal@milecki.pl>;
> Broadcom internal kernel review list <bcm-kernel-feedback-
> list@broadcom.com>
> Cc: linux-leds@vger.kernel.org; devicetree@vger.kernel.org; Linus Walleij
> <linus.walleij@linaro.org>
> Subject: [PATCH 3/4] leds: bcm63128: Handle shift register config
typo:  bcm63128 -> bcm63138

>
> This adds code to optionally read the width of the shift register
> chain from the device tree and use it to set up the register
> controlling the shifter hardware.
>
> If the property is not present, the boot-time default is used so
> existing device trees keep working as this is what they assume.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/leds/blink/leds-bcm63138.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/leds/blink/leds-bcm63138.c b/drivers/leds/blink/leds-
> bcm63138.c
> index 374f68f4f277..bf170a5bb12a 100644
> --- a/drivers/leds/blink/leds-bcm63138.c
> +++ b/drivers/leds/blink/leds-bcm63138.c
> @@ -2,6 +2,7 @@
>  /*
>   * Copyright (C) 2021 Rafał Miłecki <rafal@milecki.pl>
>   */
> +#include <linux/bits.h>
>  #include <linux/cleanup.h>
>  #include <linux/delay.h>
>  #include <linux/io.h>
> @@ -254,6 +255,7 @@ static int bcm63138_leds_probe(struct
> platform_device *pdev)
>  	struct device_node *np = dev_of_node(&pdev->dev);
>  	struct device *dev = &pdev->dev;
>  	struct bcm63138_leds *leds;
> +	u32 shift_bits;
>
>  	leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL);
>  	if (!leds)
> @@ -267,6 +269,12 @@ static int bcm63138_leds_probe(struct
> platform_device *pdev)
>
>  	spin_lock_init(&leds->lock);
>
> +	/* If this property is not present, we use boot defaults */
> +	if (!of_property_read_u32(np, "brcm,serial-shift-bits", &shift_bits)) {
> +		bcm63138_leds_write(leds,
> BCM63138_SERIAL_LED_SHIFT_SEL,
> +				    GENMASK(32 - shift_bits - 1, 0));
> +	}
> +
>  	bcm63138_leds_write(leds, BCM63138_GLB_CTRL,
>  			    BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL |
>  			    BCM63138_GLB_CTRL_SERIAL_LED_EN_POL);
>
> --
> 2.46.0

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

  parent reply	other threads:[~2024-09-26  0:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 21:59 [PATCH 0/4] leds: bcm63138: Add some new bindings and code Linus Walleij
2024-09-20 21:59 ` [PATCH 1/4] dt-bindings: leds: bcm63128: Add shift register bits Linus Walleij
2024-09-20 23:25   ` Rob Herring (Arm)
2024-09-20 21:59 ` [PATCH 2/4] leds: bcm63138: Use scopes and guards Linus Walleij
2024-09-25 17:45   ` Florian Fainelli
2024-09-20 21:59 ` [PATCH 3/4] leds: bcm63128: Handle shift register config Linus Walleij
2024-09-25 17:46   ` Florian Fainelli
2024-09-26  0:17   ` William Zhang [this message]
2024-09-20 21:59 ` [PATCH 4/4] leds: bcm63128: Add some register defines Linus Walleij

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=3083039c1f8ec79e8e0803fc43d84156@mail.gmail.com \
    --to=william.zhang@broadcom.com \
    --cc=anand.gore@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=krzk+dt@kernel.org \
    --cc=kursad.oney@broadcom.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafal@milecki.pl \
    --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;
as well as URLs for NNTP newsgroup(s).