Linux USB
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for Battery Status AMS
@ 2026-05-15  5:48 Amit Sunil Dhamne via B4 Relay
  2026-05-15  5:48 ` [PATCH 1/3] power: Add power_supply_get_battery_all() to fetch battery psy handles Amit Sunil Dhamne via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Amit Sunil Dhamne via B4 Relay @ 2026-05-15  5:48 UTC (permalink / raw)
  To: Sebastian Reichel, Badhri Jagan Sridharan, Heikki Krogerus,
	Greg Kroah-Hartman, Hans de Goede, Krzysztof Kozlowski,
	Marek Szyprowski, Sebastian Krzyszkowiak, Purism Kernel Team
  Cc: linux-pm, linux-kernel, linux-usb, André Draszik,
	Tudor Ambarus, Peter Griffin, RD Babiera, Kyle Tso,
	Amit Sunil Dhamne

PD 3.1 v1.8 Spec necessitates a response to Get_Battery_Status request
from the port partner (see "6.13.2 Applicability of Data Message").
This patchset adds support to get all the battery type power supplies
and query them to report the telemetry required to build a Battery
Status Message. Right now, this submission assumes all the battery type
power supplies that exist in the system are fixed (meaning cannot be hot
swapped).

Previously, I had sent a patch series [1]. However there were some
concerns. Broadly:
  * No client drivers
  * Duplicating dt properties
To address the above issues, we now have Fuel Gauge and Charger drivers.
Also, I have rectified my approach to fetch information about batteries
from the power supply core.

While, the original patch series [1] added support for Battery Caps as
well, this patch series only adds support for Battery Status. Therefore,
I am sending it as a new series while incorporating relevant feedback.

[1] https://lore.kernel.org/all/20250507-batt_ops-v2-0-8d06130bffe6@google.com/

Patches in series:
[A] "power: supply: core: Add power_supply_get_battery_all()"
[B] "usb: typec: tcpm: Add support for Battery Status response message"
[C] "power: supply: max17042: add handler for energy_now property"

Technical dependency of patches:
[C] is independent and can be applied in any order.
[B] depends on [A] due to `power_supply_get_battery_all` symbol.

Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
---
Amit Sunil Dhamne (3):
      power: Add power_supply_get_battery_all() to fetch battery psy handles
      usb: typec: tcpm: Add support for Battery Status response message
      power: supply: max17042: add handler for energy_now property

 drivers/power/supply/max17042_battery.c  |  60 ++++++++++---
 drivers/power/supply/power_supply_core.c | 122 +++++++++++++++++++++++++++
 drivers/usb/typec/tcpm/tcpm.c            | 140 ++++++++++++++++++++++++++++++-
 include/linux/power_supply.h             |   9 ++
 include/linux/usb/pd.h                   |  29 +++++++
 5 files changed, 344 insertions(+), 16 deletions(-)
---
base-commit: 57b8e2d666a31fa201432d58f5fe3469a0dd83ba
change-id: 20260501-batt-status-16b6761c0bb1

Best regards,
-- 
Amit Sunil Dhamne <amitsd@google.com>



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

end of thread, other threads:[~2026-05-15  7:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  5:48 [PATCH 0/3] Add support for Battery Status AMS Amit Sunil Dhamne via B4 Relay
2026-05-15  5:48 ` [PATCH 1/3] power: Add power_supply_get_battery_all() to fetch battery psy handles Amit Sunil Dhamne via B4 Relay
2026-05-15  7:15   ` Hans de Goede
2026-05-15  5:48 ` [PATCH 2/3] usb: typec: tcpm: Add support for Battery Status response message Amit Sunil Dhamne via B4 Relay
2026-05-15  5:48 ` [PATCH 3/3] power: supply: max17042: add handler for energy_now property Amit Sunil Dhamne via B4 Relay
2026-05-15  7:25   ` Hans de Goede

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