Skip to content

RFC ACPI: platform_profile: Let drivers dynamically refresh choices

Kurt Borja linux-acpi lkml platform-driver-x86 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ACPI: platform_profile: Add ops member to handlersdrivers/acpi/platform_profile.c drivers/platform/surface/surface_platform_profile.c drivers/platform/x86/acer-wmi.c +9 more+86 -330 replies
2/3ACPI: platform_profile: Add `choices` to platform_profile_opsdrivers/acpi/platform_profile.c drivers/platform/surface/surface_platform_profile.c drivers/platform/x86/acer-wmi.c +9 more+133 -710 replies
3/3ACPI: platform_profile: Add platform_profile_refresh_choices()drivers/acpi/platform_profile.c include/linux/platform_profile.h+24 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] ACPI: platform_profile: Let drivers dynamically refresh choices

Hello,

Some drivers may need to dynamically modify their selected choices. Such is the case of the acer-wmi driver, which implemented their own profile cycling method, because users expect different profiles to be available whether the laptop is on AC or not [1].

These series would allow acer-wmi to simplify this custom cycling method to use platform_profile_cycle(), as it's already being proposed in these series [2]; without changing expected behaviors, by refreshing their selected choices on AC connect/disconnect events, which would also solve this discussion [3].

Additionally, I think the platform_profile_ops approach would enable us to hide the platform_profile_handler in the future, and instead just pass the class device to get/set methods like the HWMON subsystem does.

I think having this kind of flexibility is valuable. Let me know what you think!

These series are based on top of pdx86/for-next branch.

~ Kurt

[1] https://lore.kernel.org/platform-driver-x86/[email protected]/
[2] https://lore.kernel.org/platform-driver-x86/[email protected]/
[3] https://lore.kernel.org/platform-driver-x86/[email protected]/

Kurt Borja (3):
ACPI: platform_profile: Add ops member to handlers
ACPI: platform_profile: Add choices to platform_profile_ops
ACPI: platform_profile: Add platform_profile_refresh_choices()

 drivers/acpi/platform_profile.c               | 39 ++++++++++++--
 .../surface/surface_platform_profile.c        | 24 ++++++---
 drivers/platform/x86/acer-wmi.c               | 35 ++++++------
 drivers/platform/x86/amd/pmf/sps.c            | 23 +++++---
 drivers/platform/x86/asus-wmi.c               | 24 ++++++---
 drivers/platform/x86/dell/alienware-wmi.c     | 19 ++++---
 drivers/platform/x86/dell/dell-pc.c           | 34 +++++++-----
 drivers/platform/x86/hp/hp-wmi.c              | 53 +++++++++++++------
 drivers/platform/x86/ideapad-laptop.c         | 23 +++++---
 .../platform/x86/inspur_platform_profile.c    | 22 +++++---
 drivers/platform/x86/thinkpad_acpi.c          | 23 +++++---
 include/linux/platform_profile.h              | 16 ++++--
 12 files changed, 237 insertions(+), 98 deletions(-)

base-commit: 6b228cfc52a6e9b7149cf51e247076963d6561cd

Signature · 1 line
2.47.1