linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] ChromeOS Embedded Controller charge control driver
@ 2024-06-10 15:51 Thomas Weißschuh
  2024-06-10 15:51 ` [PATCH v3 1/5] ACPI: battery: add devm_battery_hook_register() Thomas Weißschuh
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Thomas Weißschuh @ 2024-06-10 15:51 UTC (permalink / raw)
  To: Benson Leung, Guenter Roeck, Sebastian Reichel,
	Thomas Weißschuh, Rafael J. Wysocki, Len Brown, Robert Moore,
	Tzung-Bi Shih
  Cc: chrome-platform, linux-kernel, linux-pm, Mario Limonciello,
	Dustin Howett, Stephen Horvath, Rajas Paranjpe, linux-acpi,
	acpica-devel, Matt Hartley, Thomas Weißschuh

Note:
To be useful, this series depends on
commit 08dbad2c7c32 ("mfd: cros_ec: Register charge control subdevice")
from the MFD tree [0].

Add a power supply driver that supports charge thresholds and behaviour
configuration.

This is a complete rework of
"platform/chrome: cros_ec_framework_laptop: new driver" [1], which used
Framework specific EC commands.

The driver propsed in this series only uses upstream CrOS functionality.

Tested on a Framework 13 AMD, Firmware 3.05.

This driver should go through the chrome-platform tree.
Otherwise "platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions()"
will conflict with
commit a14a569a9918 ("platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_readmem()")
from chrome-platform/for-next.

The patch
"platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions()"
is also part of my series
"hwmon: (cros_ec): fan target, fan pwm control and temperature thresholds"[2].

Based on chrome-platform/for-next.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/commit/?h=for-mfd-next&id=08dbad2c7c3275e0e79190dca139bc65ce775a92
[1] https://lore.kernel.org/lkml/20240505-cros_ec-framework-v1-0-402662d6276b@weissschuh.net/
[2] https://lore.kernel.org/lkml/20240608-cros_ec-hwmon-pwm-v1-0-d29dfc26fbc3@weissschuh.net/

Changes in v3:
- Drop MFD patch that was already applied
  (therefore drop Lee from series recipients)
- Introduce and use devm_battery_hook_register()
- Note that the driver should go through the chrome-platform tree
- Introduce and use cros_ec_cmd_versions()
- Drop logging about impossible charge behaviours
- Use sysfs_attr_init()
- Disable probing on incompatible Framework devices by default
- Link to v2: https://lore.kernel.org/r/20240528-cros_ec-charge-control-v2-0-81fb27e1cff4@weissschuh.net

Changes in v2:
- Accept "0" as charge_start_threshold
- Don't include linux/kernel.h
- Only bind to the first found battery
- Import EC_CMD_CHARGE_CONTROL v3 headers
- Add support for v1 and v3 commands
- Sort mfd cell entry alphabetically
- Link to v1: https://lore.kernel.org/r/20240519-cros_ec-charge-control-v1-0-baf305dc79b8@weissschuh.net

---
Thomas Weißschuh (5):
      ACPI: battery: add devm_battery_hook_register()
      platform/chrome: Update binary interface for EC-based charge control
      platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions()
      power: supply: add ChromeOS EC based charge control driver
      power: supply: cros_charge-control: don't probe if Framework control is present

 MAINTAINERS                                    |   6 +
 drivers/acpi/battery.c                         |  15 ++
 drivers/platform/chrome/cros_ec_proto.c        |  26 ++
 drivers/power/supply/Kconfig                   |  12 +
 drivers/power/supply/Makefile                  |   1 +
 drivers/power/supply/cros_charge-control.c     | 359 +++++++++++++++++++++++++
 include/acpi/battery.h                         |   2 +
 include/linux/platform_data/cros_ec_commands.h |  49 +++-
 include/linux/platform_data/cros_ec_proto.h    |   2 +
 9 files changed, 470 insertions(+), 2 deletions(-)
---
base-commit: c8a4bdca928debacf49524d1b09dbf27e88e1f18
change-id: 20240506-cros_ec-charge-control-685617e8ed87

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


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

end of thread, other threads:[~2024-06-13 19:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 15:51 [PATCH v3 0/5] ChromeOS Embedded Controller charge control driver Thomas Weißschuh
2024-06-10 15:51 ` [PATCH v3 1/5] ACPI: battery: add devm_battery_hook_register() Thomas Weißschuh
2024-06-13 19:33   ` Rafael J. Wysocki
2024-06-10 15:51 ` [PATCH v3 2/5] platform/chrome: Update binary interface for EC-based charge control Thomas Weißschuh
2024-06-10 15:51 ` [PATCH v3 3/5] platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions() Thomas Weißschuh
2024-06-11  6:32   ` Tzung-Bi Shih
2024-06-11  7:23     ` Thomas Weißschuh
2024-06-11 10:14       ` Tzung-Bi Shih
2024-06-11 11:35   ` Tzung-Bi Shih
2024-06-11 12:14     ` Thomas Weißschuh
2024-06-12  2:25       ` Tzung-Bi Shih
2024-06-10 15:51 ` [PATCH v3 4/5] power: supply: add ChromeOS EC based charge control driver Thomas Weißschuh
2024-06-10 15:51 ` [PATCH v3 5/5] power: supply: cros_charge-control: don't probe if Framework control is present Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).