From: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
sre@kernel.org, hansg@kernel.org, ilpo.jarvinen@linux.intel.com,
linux@roeck-us.net, andersson@kernel.org, konradybcio@kernel.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: bryan.odonoghue@linaro.org, platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 1/3] drivers/platform: lenovo-t14s-ec: Add hwmon support for temperatures and fan speed
Date: Thu, 25 Jun 2026 10:06:22 +0200 [thread overview]
Message-ID: <1758c25f-869e-4500-9fa9-899f6fd121db@oss.qualcomm.com> (raw)
In-Reply-To: <1d26c917-917e-41b8-ad52-8c1f3e306ce6@oss.qualcomm.com>
Le 25/06/2026 à 10:03, Konrad Dybcio a écrit :
> On 6/24/26 11:08 PM, Daniel Lezcano wrote:
>> Expose the Lenovo ThinkPad T14s EC environmental sensors through
>> the hwmon subsystem.
>>
>> The driver now registers a hwmon device providing access to six EC
>> temperature sensors corresponding to the SoC, keyboard area, base
>> cover, PMIC/charging circuitry, QTM module and SSD. Sensor labels
>> are exported to allow user space to identify each measurement.
>>
>> Additionally, expose the system fan speed by reading the fan RPM
>> registers from the embedded controller.
>>
>> This allows standard monitoring tools such as lm-sensors to report
>> platform temperatures and fan speed.
>>
>> Signed-off-by: Daniel Lezcano daniel.lezcano@oss.qualcomm.com
>> ---
>
> [...]
>
>> + case hwmon_fan:
>> + if (attr == hwmon_fan_input) {
>> + int lsb, msb;
>> + ret = t14s_ec_read(ec, T14S_EC_FAN_RPM_LSB, &lsb);
>> + if (ret)
>> + return ret;
>> +
>> + ret = t14s_ec_read(ec, T14S_EC_FAN_RPM_MSB, &msb);
>> + if (ret)
>> + return ret;
>> +
>> + *val = 0;
>> + *val = lsb + (msb << 8);
>
> '+' looks funny here.. although t14s_ec_read() only reads a
> single byte and assigns a u8 value to the u32 that's being passed
> to it, so it never *actually* breaks..
>
> [...]
>
>> +static const struct hwmon_channel_info *t14s_ec_hwmon_info[] = {
>> + HWMON_CHANNEL_INFO(temp,
>> + HWMON_T_INPUT | HWMON_T_LABEL,
>> + HWMON_T_INPUT | HWMON_T_LABEL,
>> + HWMON_T_INPUT | HWMON_T_LABEL,
>> + HWMON_T_INPUT | HWMON_T_LABEL,
>> + HWMON_T_INPUT | HWMON_T_LABEL,
>> + HWMON_T_INPUT | HWMON_T_LABEL),
>> + HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT),
>> + NULL
>> +};
>> +
>> +static const struct hwmon_chip_info t14s_ec_chip_info = {
>> + .ops = &t14s_ec_hwmon_ops,
>> + .info = t14s_ec_hwmon_info,
>> +};
>> +
>> +static int t14s_ec_hwmon_probe(struct t14s_ec *ec)
>> +{
>> + struct device *dev;
>> + struct t14s_ec_hwmon_sys_thermx sys_thermx[] = {
>> + { T14S_EC_SYS_THERM0, "soc" },
>> + { T14S_EC_SYS_THERM1, "keyboard" },
>> + { T14S_EC_SYS_THERM2, "base" },
>> + { T14S_EC_SYS_THERM3, "pmbm" },
>> + { T14S_EC_SYS_THERM6, "qtm" },
>> + { T14S_EC_SYS_THERM7, "ssd" },
>
> Makes one wonder what happened to THERM4/5 - may they be dedicated to
> the 5G modem, perhaps?
May be, I sticked to the documentation description which is not
describing THERM4/5
next prev parent reply other threads:[~2026-06-25 8:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 21:08 [PATCH v1 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration Daniel Lezcano
2026-06-24 21:08 ` [PATCH v1 1/3] drivers/platform: lenovo-t14s-ec: Add hwmon support for temperatures and fan speed Daniel Lezcano
2026-06-25 8:03 ` Konrad Dybcio
2026-06-25 8:06 ` Daniel Lezcano [this message]
2026-06-28 13:50 ` Sebastian Reichel
2026-06-28 14:02 ` Guenter Roeck
2026-06-29 8:26 ` Konrad Dybcio
2026-06-29 8:50 ` Daniel Lezcano
2026-06-28 17:31 ` Daniel Lezcano
2026-06-24 21:08 ` [PATCH v1 2/3] platform: arm64: thinkpad-t14s-ec: Wire EC thermal events to hwmon Daniel Lezcano
2026-06-24 21:08 ` [PATCH v1 3/3] arm64: dts: qcom: x1e78100-t14s: Add thermal zones for keyboard skin and charging sensors Daniel Lezcano
2026-06-25 11:36 ` Konrad Dybcio
2026-06-25 13:20 ` Daniel Lezcano
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=1758c25f-869e-4500-9fa9-899f6fd121db@oss.qualcomm.com \
--to=daniel.lezcano@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=platform-driver-x86@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sre@kernel.org \
/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
all inboxes | Powered by JetHome®