Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Oleg Keri" <okerixx@gmail.com>
Cc: conor+dt@kernel.org, linux-hwmon@vger.kernel.org,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver
Date: Tue, 08 Sep 2026 09:28:05 +0000	[thread overview]
Message-ID: <20260908092805.E15781F00A3F@smtp.kernel.org> (raw)
In-Reply-To: <20260908091752.5508-3-okerixx@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Hardware monitoring device registered directly from a platform driver outside of drivers/hwmon/.
- [Low] Missing dependency on CONFIG_INPUT in Kconfig.
--

commit f4e16083031d59790bcde21682359e0fb96b3392
Author: Oleg Keri <okerixx@gmail.com>

platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver

This commit adds a new embedded controller driver for the Lenovo Yoga Slim
7x Gen 11 laptop. It exposes thermistors, battery cell voltages, and CPU
fan speed as hardware monitoring channels, as well as keyboard backlight and
hotkey input events.

> diff --git a/drivers/platform/arm64/Kconfig b/drivers/platform/arm64/Kconfig
> index e32e01b2a9bdd..9d8e875413fa6 100644
> --- a/drivers/platform/arm64/Kconfig
> +++ b/drivers/platform/arm64/Kconfig
> @@ -90,6 +90,28 @@ config EC_LENOVO_THINKPAD_T14S
>  
>  	  Say M or Y here to include this support.
>  
> +config EC_LENOVO_YOGA_SLIM7X_GEN11
> +	tristate "Lenovo Yoga Slim 7x Gen 11 Embedded Controller driver"
> +	depends on ARCH_QCOM || COMPILE_TEST
> +	depends on I2C
> +	depends on HWMON
> +	select NEW_LEDS
> +	select LEDS_CLASS

[Severity: Low]
Does this Kconfig entry need a dependency on INPUT?

If CONFIG_EC_LENOVO_YOGA_SLIM7X_GEN11 is built-in (=y) but CONFIG_INPUT is
built as a module (=m), will this cause a linker error since the driver
unconditionally calls input_register_device() and devm_input_allocate_device()
in yoga_ec_register_keys()?

[ ... ]

> diff --git a/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c b/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c
> new file mode 100644
> index 0000000000000..521a7fb8f3562
> --- /dev/null
> +++ b/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c

[ ... ]

> +static int yoga_ec_probe(struct i2c_client *client)
> +{

[ ... ]

> +	dev_dbg(dev, "thermistors present: %#lx\n", ec->temp_present);
> +
> +	hwmon = devm_hwmon_device_register_with_info(dev, "yoga_slim7x_ec", ec,
> +						     &yoga_ec_chip_info, NULL);

[Severity: Medium]
Does this violate the hardware monitoring subsystem layout rules?

The hwmon architectural guidelines specify that if the main functionality of
a chip is not hardware monitoring, its hardware monitoring functionality
should be implemented as an auxiliary device driver, and that driver should
reside in drivers/hwmon/.

Registering the hwmon device directly from this platform driver in
drivers/platform/arm64/ bypasses these layering boundaries. Should this be
split into an auxiliary device architecture for the hwmon components?

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

  reply	other threads:[~2026-09-08  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08  9:17 [PATCH 0/2] platform/arm64: Lenovo Yoga Slim 7x Gen 11 embedded controller Oleg Keri
2026-09-08  9:17 ` [PATCH 1/2] dt-bindings: embedded-controller: add Lenovo Yoga Slim 7x Gen 11 EC Oleg Keri
2026-09-08  9:24   ` sashiko-bot
2026-09-08 17:55   ` Conor Dooley
2026-09-08  9:17 ` [PATCH 2/2] platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver Oleg Keri
2026-09-08  9:28   ` sashiko-bot [this message]
2026-09-08 15:53   ` Uwe Kleine-König

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=20260908092805.E15781F00A3F@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=okerixx@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