Re: [PATCH v5 2/3] platform: arm64: lenovo-thinkpad-t14s-ec: Add hwmon support for temperatures
From: Krzysztof Kozlowski
Date: Tue Jul 07 2026 - 02:42:19 EST
On Mon, Jul 06, 2026 at 08:46:47PM +0200, Daniel Lezcano wrote:
> +static int t14s_ec_hwmon_probe(struct t14s_ec *ec)
> +{
> + struct device *dev;
> + struct t14s_ec_hwmon_sys_thermx sys_thermx[] = {
> + { .label = "soc", .reg = T14S_EC_SYS_THERM0 },
> + { .label = "keyboard", .reg = T14S_EC_SYS_THERM1 },
> + { .label = "base", .reg = T14S_EC_SYS_THERM2 },
> + { .label = "charging", .reg = T14S_EC_SYS_THERM3 },
> + { .label = "qtm", .reg = T14S_EC_SYS_THERM6 },
> + { .label = "ssd", .reg = T14S_EC_SYS_THERM7 },
> + };
> +
> + ec->ec_hwmon.sys_thermx = devm_kmemdup_array(ec->dev, sys_thermx,
> + ARRAY_SIZE(sys_thermx),
> + sizeof(sys_thermx[0]), GFP_KERNEL);
> + if (!ec->ec_hwmon.sys_thermx)
> + return -ENOMEM;
> +
> + dev = devm_hwmon_device_register_with_info(ec->dev, "t14s_ec", ec,
> + &t14s_ec_chip_info, NULL);
> +
> + return PTR_ERR_OR_ZERO(dev);
... and this ...
> +}
> +
> static int t14s_ec_probe(struct i2c_client *client)
> {
> struct device *dev = &client->dev;
> @@ -590,6 +717,10 @@ static int t14s_ec_probe(struct i2c_client *client)
> if (ret < 0)
> return ret;
>
> + ret = t14s_ec_hwmon_probe(ec);
> + if (ret < 0)
> + return ret;
... and this is actual implemented ABI break, if I understood hwmon and
thermal code correctly.
> +
> ret = devm_request_threaded_irq(dev, client->irq, NULL,
> t14s_ec_irq_handler,
> IRQF_ONESHOT, dev_name(dev), ec);
Best regards,
Krzysztof