[PATCH v2 0/8] Add sysfs entry for system load control

Waqar Hameed posted 8 patches 3 weeks, 3 days ago
Documentation/ABI/testing/sysfs-class-power   | 25 ++++++
.../ABI/testing/sysfs-class-power-ltc4162l    |  2 +
.../ABI/testing/sysfs-class-power-rt9467      |  2 +
.../ABI/testing/sysfs-class-power-rt9471      |  2 +
drivers/power/supply/bq24190_charger.c        | 62 ++++++++++++++
drivers/power/supply/bq24257_charger.c        | 43 +++++++++-
drivers/power/supply/bq25630_charger.c        | 84 +++++++++++++++++++
drivers/power/supply/ltc4162-l-charger.c      | 56 +++++++++++--
drivers/power/supply/power_supply_sysfs.c     | 17 ++++
drivers/power/supply/rt9467-charger.c         | 54 ++++++++++--
drivers/power/supply/rt9471.c                 | 54 ++++++++++--
include/linux/power_supply.h                  | 18 +++-
12 files changed, 397 insertions(+), 22 deletions(-)
[PATCH v2 0/8] Add sysfs entry for system load control
Posted by Waqar Hameed 3 weeks, 3 days ago
During discussions of the development of a new driver [1], it was
concluded that a new `sysfs` ABI for controlling the connection from
power to system load is wanted. This patchset introduces this.

There are already several drivers that are controlling this, but with
their own custom `sysfs` entries. The drivers in this patchset were find
with a simple `grep` for `bat\s?fet` (there might be more?), and then
converted to use this new `sysfs` ABI. The old custom ABIs are left
untouched of course, for backward compatibility.

[1] https://lore.kernel.org/lkml/cover.1772201049.git.waqar.hameed@axis.com/

Changes in v2:

* Drop already merged patches (picked up by Sebastian in v1).
* Pack `struct power_supply_desc` so that an extra member doesn't
  increase the size unnecessarily too much.
* Use `power_supply_show_enum_with_available()` for
  `POWER_SUPPLY_LOAD_SWITCH`.
* Drop commit for selftest since properties using
  `power_supply_show_enum_with_available()` don't have any helper test
  functions. Should we add this (in a separate patch set)? I'll others
  decide if it's worth the churn...
* Add implementation for bq25630.

Link to v1: https://lore.kernel.org/lkml/cover.1782683551.git.waqar.hameed@axis.com/

Waqar Hameed (8):
  power: supply: Pack power_supply_desc to eliminate holes
  power: supply: Add sysfs entry for system load control
  power: supply: ltc4162-l: Use POWER_SUPPLY_PROP_LOAD_SWITCH
  power: supply: rt9471: Use POWER_SUPPLY_PROP_LOAD_SWITCH
  power: supply: rt9467: Use POWER_SUPPLY_PROP_LOAD_SWITCH
  power: supply: bq24257: Use POWER_SUPPLY_PROP_LOAD_SWITCH
  power: supply: bq24190: Use POWER_SUPPLY_PROP_LOAD_SWITCH
  power: supply: bq25630: Add support for BATFET control

 Documentation/ABI/testing/sysfs-class-power   | 25 ++++++
 .../ABI/testing/sysfs-class-power-ltc4162l    |  2 +
 .../ABI/testing/sysfs-class-power-rt9467      |  2 +
 .../ABI/testing/sysfs-class-power-rt9471      |  2 +
 drivers/power/supply/bq24190_charger.c        | 62 ++++++++++++++
 drivers/power/supply/bq24257_charger.c        | 43 +++++++++-
 drivers/power/supply/bq25630_charger.c        | 84 +++++++++++++++++++
 drivers/power/supply/ltc4162-l-charger.c      | 56 +++++++++++--
 drivers/power/supply/power_supply_sysfs.c     | 17 ++++
 drivers/power/supply/rt9467-charger.c         | 54 ++++++++++--
 drivers/power/supply/rt9471.c                 | 54 ++++++++++--
 include/linux/power_supply.h                  | 18 +++-
 12 files changed, 397 insertions(+), 22 deletions(-)


base-commit: 73e3f0710014fe6d4ed98cfc02292f6121db7558
-- 
2.43.0
Re: [PATCH v2 0/8] Add sysfs entry for system load control
Posted by Sebastian Reichel 2 weeks, 2 days ago
On Tue, 01 Sep 2026 21:35:07 +0200, Waqar Hameed wrote:
> During discussions of the development of a new driver [1], it was
> concluded that a new `sysfs` ABI for controlling the connection from
> power to system load is wanted. This patchset introduces this.
> 
> There are already several drivers that are controlling this, but with
> their own custom `sysfs` entries. The drivers in this patchset were find
> with a simple `grep` for `bat\s?fet` (there might be more?), and then
> converted to use this new `sysfs` ABI. The old custom ABIs are left
> untouched of course, for backward compatibility.
> 
> [...]

Applied, thanks!

[1/8] power: supply: Pack power_supply_desc to eliminate holes
      commit: 1948a667e2b9e2628a73f7b594bc2461b3062471
[2/8] power: supply: Add sysfs entry for system load control
      commit: eb16583b98416ea8472a48356e5eeeecbd7ab2e2
[3/8] power: supply: ltc4162-l: Use POWER_SUPPLY_PROP_LOAD_SWITCH
      commit: 63ca332b361df73d0f69ebf20a325e8f014d8982
[4/8] power: supply: rt9471: Use POWER_SUPPLY_PROP_LOAD_SWITCH
      commit: 63c85b1ae2f602d7865964e078b35b24196409f7
[5/8] power: supply: rt9467: Use POWER_SUPPLY_PROP_LOAD_SWITCH
      commit: 22baf7437615b94a4dad8288b14ae8815761d70d
[6/8] power: supply: bq24257: Use POWER_SUPPLY_PROP_LOAD_SWITCH
      commit: f7259dbf1e73f759c4a0c972a402bec3f6756b28
[7/8] power: supply: bq24190: Use POWER_SUPPLY_PROP_LOAD_SWITCH
      commit: 22d3111d524958c849e8105a8201ef40bd86c1ff
[8/8] power: supply: bq25630: Add support for BATFET control
      commit: 800ab4aa3ebc56333d65d158aa61bae56f9b79ec

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>