All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] power: supply: Add new "charge_types" property
@ 2024-12-11 17:44 Hans de Goede
  2024-12-11 17:44 ` [PATCH v4 1/4] power: supply: power_supply_show_enum_with_available(): Replace spaces with '_' Hans de Goede
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Hans de Goede @ 2024-12-11 17:44 UTC (permalink / raw)
  To: Ilpo Järvinen, Andy Shevchenko, Thomas Weißschuh,
	Sebastian Reichel
  Cc: Hans de Goede, Jelle van der Waa, platform-driver-x86, linux-pm

Hi,

As first discussed here:
https://lore.kernel.org/linux-pm/49993a42-aa91-46bf-acef-4a089db4c2db@redhat.com/

Some power_supply devices have a writable charge_type property, but
userspace cannot know which charge_type values are valid to write.

This series adds a new "charge_types" property, which is identical to
"charge_type" but reading returns a list of supported charge-types with
the currently active type surrounded by square brackets, e.g.:

Fast [Standard] Long_Life

this allows userspace to find out which charge-types are supported.

Patch 1/4 does some prep work and patch 2/4 is the core implementation
of "charge_types" property support.

Patch 3/4 is a standard psy-driver user of the new "charge_types"
property support. Patch 4/4 shows an ACPI battery extension driver
with support for this property using the new show()/store() helpers.

Changes in v4:
- Rebase on top of latest sre/linux-power-supply.git/for-next
- Only print current value in uevent using new uevent flag passed to
  power_supply_format_property()
- Put new POWER_SUPPLY_PROP_CHARGE_TYPES enum power_supply_property entry
  directly after the existing POWER_SUPPLY_PROP_CHARGE_TYPE entry

Changes in v3:
- Rebase on top of v6.13-rc1

Changes in v2:
- Replace spaces with '_' instead of surrounding the text-value by ""
- Add "Check charge_types to get the values supported by the battery."
  to Documentation/ABI/testing/sysfs-class-power
- Add a note about labels with spaces having these replaced by '_'
  in charge_types output to Documentation/ABI/testing/sysfs-class-power
- Use power_supply_match_string() in power_supply_charge_types_parse()

Regards,

Hans


Hans de Goede (4):
  power: supply: power_supply_show_enum_with_available(): Replace spaces
    with '_'
  power: supply: core: Add new "charge_types" property
  power: supply: bq24190_charger: Add support for "charge_types"
    property
  platform/x86: dell-laptop: Use power_supply_charge_types_show/_parse()
    helpers

 Documentation/ABI/testing/sysfs-class-power | 20 ++++++
 drivers/platform/x86/dell/dell-laptop.c     | 54 +++++++--------
 drivers/power/supply/bq24190_charger.c      |  7 ++
 drivers/power/supply/power_supply_sysfs.c   | 73 +++++++++++++++++++--
 include/linux/power_supply.h                | 23 ++++++-
 5 files changed, 143 insertions(+), 34 deletions(-)

-- 
2.47.1


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

end of thread, other threads:[~2024-12-21 13:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 17:44 [PATCH v4 0/4] power: supply: Add new "charge_types" property Hans de Goede
2024-12-11 17:44 ` [PATCH v4 1/4] power: supply: power_supply_show_enum_with_available(): Replace spaces with '_' Hans de Goede
2024-12-11 17:44 ` [PATCH v4 2/4] power: supply: core: Add new "charge_types" property Hans de Goede
2024-12-11 19:27   ` Thomas Weißschuh
2024-12-11 17:44 ` [PATCH v4 3/4] power: supply: bq24190_charger: Add support for " Hans de Goede
2024-12-11 17:44 ` [PATCH v4 4/4] platform/x86: dell-laptop: Use power_supply_charge_types_show/_parse() helpers Hans de Goede
2024-12-17 12:01   ` Ilpo Järvinen
2024-12-17 15:18     ` Hans de Goede
2024-12-17 15:24       ` Ilpo Järvinen
2024-12-17 18:49       ` Thomas Weißschuh
2024-12-21 13:02         ` Hans de Goede
2024-12-20  0:07       ` Sebastian Reichel
2024-12-12 23:51 ` (subset) [PATCH v4 0/4] power: supply: Add new "charge_types" property Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.