Chrome platform driver development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ChromeOS Embedded controller hwmon driver
@ 2024-05-07 16:29 Thomas Weißschuh
  2024-05-07 16:29 ` [PATCH v2 1/2] hwmon: add ChromeOS EC driver Thomas Weißschuh
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Thomas Weißschuh @ 2024-05-07 16:29 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Benson Leung, Lee Jones
  Cc: Guenter Roeck, linux-kernel, linux-hwmon, chrome-platform,
	Dustin Howett, Mario Limonciello, Moritz Fischer,
	Thomas Weißschuh

Add a hwmon driver that reports fan and temperature readings from the
ChromeOS Embedded controller.

There was an earlier effort in 2017 to add such a driver [0], but there
was no followup after v1.
The new driver is complete reimplementation based on newer APIs and with
more features (temp sensor names).

It only works on LPC-connected ECs, as only those implement direct
memory-map access.
For other busses the data would need to be read with a command.
Adding some helpers was discussed in the previous patchset [1].

The EC protocols also support reading and writing fan curves but that is
not implemented.

Tested on a Framework 13 AMD, Firmware 3.05.

[0] https://lore.kernel.org/all/1491602410-31518-1-git-send-email-moritz.fischer@ettus.com/
[1] https://lore.kernel.org/all/ac61bfca-bfa0-143b-c9ca-365b8026ce8d@roeck-us.net/

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v2:
- drop unnecessary range checks (Guenter)
- only validate thermal_version during probing
- reorder some variable declarations
- validate thermal_version directly in cros_ec_hwmon_probe (Mario)
- drop return value from probe_temp_sensors as it can't fail anymore
- fail with -ENODEV if cmd_readmem is missing to avoid spurious warnings
- Link to v1: https://lore.kernel.org/r/20240507-cros_ec-hwmon-v1-0-2c47c5ce8e85@weissschuh.net

---
Thomas Weißschuh (2):
      hwmon: add ChromeOS EC driver
      mfd: cros_ec: Register hardware monitoring subdevice

 Documentation/hwmon/cros_ec_hwmon.rst |  26 ++++
 Documentation/hwmon/index.rst         |   1 +
 MAINTAINERS                           |   8 +
 drivers/hwmon/Kconfig                 |  11 ++
 drivers/hwmon/Makefile                |   1 +
 drivers/hwmon/cros_ec_hwmon.c         | 269 ++++++++++++++++++++++++++++++++++
 drivers/mfd/cros_ec_dev.c             |   1 +
 7 files changed, 317 insertions(+)
---
base-commit: 2fbe479c0024e1c6b992184a799055e19932aa48
change-id: 20240506-cros_ec-hwmon-24634b07cf6f

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-05-29 17:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 16:29 [PATCH v2 0/2] ChromeOS Embedded controller hwmon driver Thomas Weißschuh
2024-05-07 16:29 ` [PATCH v2 1/2] hwmon: add ChromeOS EC driver Thomas Weißschuh
2024-05-07 20:55   ` Guenter Roeck
2024-05-07 21:59     ` Thomas Weißschuh
2024-05-24 23:13   ` Stephen Horvath
2024-05-27 19:24     ` Thomas Weißschuh
2024-05-28  0:15       ` Stephen Horvath
2024-05-28 15:50         ` Guenter Roeck
2024-05-28 16:15           ` Thomas Weißschuh
2024-05-28 23:29             ` Guenter Roeck
2024-05-29  0:58               ` Stephen Horvath
2024-05-29  6:23                 ` Thomas Weißschuh
2024-05-29  7:40                   ` Stephen Horvath
2024-05-29 17:00                     ` Guenter Roeck
2024-05-07 16:29 ` [PATCH v2 2/2] mfd: cros_ec: Register hardware monitoring subdevice Thomas Weißschuh
2024-05-07 19:03 ` [PATCH v2 0/2] ChromeOS Embedded controller hwmon driver Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox