All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: linux-leds@vger.kernel.org, dri-devel@lists.freedesktop.org,
	lee@kernel.org
Subject: Re: [PATCH v2] video: leds: backlight: lm3533: Support getting LED sources from DT
Date: Thu, 12 Nov 2026 08:27:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-210718@kernel.org> (raw)
In-Reply-To: <20261112081941.41363-1-clamor95@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] leds: lm3533: logical AND instead of bitwise AND in
  lm3533_led_setup()
--

commit 2dcd9488633f844daaa29902962d2a0a3e964633
Author: Svyatoslav Ryhel <clamor95@gmail.com>

video: leds: backlight: lm3533: Support getting LED sources from DT

This commit adds support for configuring LM3533 Control Bank to HVLED and
LVLED output muxing from the led-sources Device Tree property.

> diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c
> index d5997cbd88dfc..72fc839d8b604 100644
> --- a/drivers/leds/leds-lm3533.c
> +++ b/drivers/leds/leds-lm3533.c
> @@ -26,6 +26,13 @@
>  #define LM3533_ALS_CHANNEL_LV_MIN	1
>  #define LM3533_ALS_CHANNEL_LV_MAX	2
>  
> +#define LM3533_REG_OUTPUT_CONF1			0x10
> +#define   OUTPUT_CONF1_SHIFT			2
> +#define   OUTPUT_LVLED_MASK			0x3
> +#define   OUTPUT_CONF1_PREP(x)			(((x) << OUTPUT_CONF1_SHIFT) && 0xff)
> +#define LM3533_REG_OUTPUT_CONF2			0x11
> +#define   OUTPUT_CONF2_SHIFT			6
> +#define   OUTPUT_CONF2_PREP(x)			(((x) >> OUTPUT_CONF2_SHIFT) && 0xff)

[Severity: High]
Should OUTPUT_CONF1_PREP() and OUTPUT_CONF2_PREP() use bitwise AND (& 0xff)
instead of logical AND (&& 0xff)?

With && 0xff, both macros evaluate to 0 or 1, so lm3533_led_setup() passes a
mask of 0x01 to regmap_update_bits() on LM3533_REG_OUTPUT_CONF1 and
LM3533_REG_OUTPUT_CONF2.  That leaves LVLED1..LVLED5 unconfigured and
overwrites bit 0 of LM3533_REG_OUTPUT_CONF1, which controls HVLED1 backlight
muxing.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112081941.41363-1-clamor95@gmail.com?part=1

      reply	other threads:[~2026-11-12  8:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  8:19 [PATCH v2] video: leds: backlight: lm3533: Support getting LED sources from DT Svyatoslav Ryhel
2026-11-12  8:27 ` sashiko-bot [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=sashiko-outbox-210718@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=clamor95@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.