All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Peter LaDow" <pladow@gmail.com>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH v3] leds: rgb: lp5860: Add I2C interface support
Date: Thu, 03 Dec 2026 20:31:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-248637@kernel.org> (raw)
In-Reply-To: <20261203-add-i2c-support-for-lp5860-v3-1-eb466df3300a@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] leds: lp5860: missing I2C interface and reg contract in DT
  binding
- [Low] leds: lp5860: duplicate core probe setup in lp5860_i2c_probe()
--

commit 4d964912338fc686818afe035b061a2a5a66a794
Author: Peter LaDow <pladow@gmail.com>

leds: rgb: lp5860: Add I2C interface support

This commit adds an I2C bus front-end driver for the TI LP5860 RGB LED matrix
controller, mapping its 10-bit register space across four consecutive 7-bit
I2C addresses via dummy clients and a custom regmap.

> diff --git a/drivers/leds/rgb/leds-lp5860-i2c.c b/drivers/leds/rgb/leds-lp5860-i2c.c
> new file mode 100644
> index 0000000000000..1fd08691d2628
> --- /dev/null
> +++ b/drivers/leds/rgb/leds-lp5860-i2c.c

[ ... ]

> +static int lp5860_i2c_probe(struct i2c_client *client)
> +{
> +	struct device *dev = &client->dev;
> +	struct i2c_client **clients;
> +	struct lp5860 *lp5860;
> +	unsigned int multi_leds;
> +	int ret;
> +
> +	if ((client->flags & I2C_CLIENT_TEN) || (client->addr & LP5860_I2C_PAGE_MASK))
> +		return dev_err_probe(dev, -EINVAL,
> +				     "Invalid I2C address: must be a 7-bit page-zero base address.\n");

[Severity: Low]
Should Documentation/devicetree/bindings/leds/leds-lp5860.yaml be updated
alongside this driver to document I2C usage and the reg address contract?

The binding currently includes spi-peripheral-props.yaml unconditionally and
only has an SPI example.  Since lp5860_i2c_probe() requires a 4-aligned 7-bit
base address whereas sibling ti,lp5812.yaml uses a 5-bit shifted address, the
I2C reg convention needs to be documented explicitly.

[ ... ]

> +	multi_leds = device_get_child_node_count(dev);
> +	if (!multi_leds)
> +		return dev_err_probe(dev, -ENODEV, "LEDs are not defined in Device Tree!\n");
> +
> +	if (multi_leds > LP5860_MAX_LED)
> +		return dev_err_probe(dev, -EINVAL, "Too many LEDs specified.\n");
> +
> +	lp5860 = devm_kzalloc(dev, struct_size(lp5860, leds, multi_leds), GFP_KERNEL);
> +	if (!lp5860)
> +		return -ENOMEM;

[Severity: Low]
Could the child-node validation, struct lp5860 allocation, mutex setup,
and drvdata assignment be consolidated into lp5860_device_init() instead
of duplicating them from leds-lp5860-spi.c?

Passing the initialized struct regmap * directly into
lp5860_device_init(dev, regmap) in leds-lp5860-core.c would keep that
setup in one place for both bus front-ends.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-add-i2c-support-for-lp5860-v3-1-eb466df3300a@gmail.com?part=1

      reply	other threads:[~2026-12-03 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 20:17 [PATCH v3] leds: rgb: lp5860: Add I2C interface support Peter LaDow
2026-12-03 20:17 ` Peter LaDow via B4 Relay
2026-12-03 20:31 ` 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-248637@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pladow@gmail.com \
    --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.