Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Liu Yufei" <lyf98405@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] iio: proximity: Add driver for Vishay VCNL36829
Date: Sat, 03 Oct 2026 05:12:56 +0000	[thread overview]
Message-ID: <20261003051257.4735C1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261003050453.413700-3-lyf98405@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] iio: proximity: vcnl36829: unnecessary I2C_FUNC_I2C check breaks SMBus compatibility
--

commit 31b66b302335366e3d26270b9301e19d433bfdf7
Author: Liu Yufei <lyf98405@gmail.com>

iio: proximity: Add driver for Vishay VCNL36829

This commit adds an IIO driver for the Vishay VCNL36829 proximity sensor
connected over I2C. At probe, the driver enables supplies, configures the
sensor and VCSEL, and exposes proximity data attributes.

> diff --git a/drivers/iio/proximity/vcnl36829.c b/drivers/iio/proximity/vcnl36829.c
> new file mode 100644
> index 0000000000000..c9958a594abe2
> --- /dev/null
> +++ b/drivers/iio/proximity/vcnl36829.c
[ ... ]
> +static int vcnl36829_probe(struct i2c_client *client)
> +{
> +	struct device *dev = &client->dev;
> +	struct vcnl36829_data *data;
> +	struct iio_dev *indio_dev;
> +	struct regmap *regmap;
> +
> +	int ret;
> +	unsigned int reg;
> +
> +	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> +		return dev_err_probe(dev, -EOPNOTSUPP,
> +				     "I2C adapter doesn't support plain I2C\n");

[Severity: Medium]
Does this artificially restrict the driver from probing on SMBus-only
controllers?

The devm_regmap_init_i2c() framework natively implements seamless SMBus
fallback for 8-bit register / 16-bit little-endian value devices using
I2C_FUNC_SMBUS_WORD_DATA. By manually enforcing I2C_FUNC_I2C up front,
it looks like the driver defeats this regmap feature and prevents itself
from operating on otherwise compatible SMBus hardware.

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

  reply	other threads:[~2026-10-03  5:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03  5:04 [PATCH 0/2] iio: proximity: Add Vishay VCNL36829 driver Liu Yufei
2026-10-03  5:04 ` [PATCH 1/2] dt-bindings: iio: proximity: Add Vishay VCNL36829 Liu Yufei
2026-10-04  7:39   ` Krzysztof Kozlowski
2026-10-03  5:04 ` [PATCH 2/2] iio: proximity: Add driver for " Liu Yufei
2026-10-03  5:12   ` sashiko-bot [this message]
2026-10-03 19:03   ` Andy Shevchenko

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=20261003051257.4735C1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lyf98405@gmail.com \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox