Skip to content

platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driver

Antheas Kapenekakis linux-hwmon lkml platform-driver-x86 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest6 patches 1 replyIn review
  2. v56 patches 11 repliesSuperseded
  3. v46 patches 6 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v36 patches24 repliesSuperseded
v26 patches29 repliesSuperseded
v15 patches10 repliesSuperseded

Changes in v6 from the cover letter

- Add pm include, add pm_sleep_ptr() on suspend hooks
- Change += to |= in hwmon patch (technically the same)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driverMAINTAINERS drivers/platform/x86/Kconfig drivers/platform/x86/Makefile +1 more+109 -00 replies
2/6platform/x86: ayaneo-ec: Add hwmon supportdrivers/platform/x86/Kconfig drivers/platform/x86/ayaneo-ec.c+138 -00 replies
3/6platform/x86: ayaneo-ec: Add charge control supportdrivers/platform/x86/Kconfig drivers/platform/x86/ayaneo-ec.c+113 -00 replies
4/6platform/x86: ayaneo-ec: Add controller power and modules attributesDocumentation/ABI/testing/sysfs-platform-ayaneo-ec MAINTAINERS drivers/platform/x86/ayaneo-ec.c+127 -00 replies
5/6platform/x86: ayaneo-ec: Move Ayaneo devices from oxpec to ayaneo-ecdrivers/platform/x86/Kconfig drivers/platform/x86/ayaneo-ec.c drivers/platform/x86/oxpec.c+67 -1170 replies
6/6platform/x86: ayaneo-ec: Add suspend hookdrivers/platform/x86/ayaneo-ec.c+84 -10 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchArmin WolfDerek J. ClarkIlpo Järvinen
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b T-b R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/6] platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driver

This series introduces a platform driver for Ayaneo devices, ayaneo-ec. This driver provides hwmon support, power management, and module management (for the new Ayaneo 3 device). Module management is done through the new firmware attributes sysfs interface.

Luckily, all Ayaneo devices with an ACPI mapped EC use the same registers. Older devices also use a memory mapped region for RGB[1], but that is replaced by HID in the new Ayaneo 3. Therefore, this allows for a simple driver design that provides robust future support. The memory mapped region can be upstreamed as a different RGB driver in the future or remain out-of-tree[1].

This change also allows cleaning up the oxpec driver, by removing Ayaneo devices from it. In parallel, charge limiting is added for these devices.

[1] https://github.com/ShadowBlip/ayaneo-platform

---
V5: https://lore.kernel.org/all/[email protected]/
V4: https://lore.kernel.org/all/[email protected]/
V3: https://lore.kernel.org/all/[email protected]/
V2: https://lore.kernel.org/all/[email protected]/
V1: https://lore.kernel.org/all/[email protected]/

Changes since v5:
- Add pm include, add pm_sleep_ptr() on suspend hooks
- Change += to |= in hwmon patch (technically the same)

Changes since v4:
- Use mask for modules
- add depends dmi to first patch

Changes since V3:
- Move ABI date to November
- Add mutex to suspend hook and cleanup
- Fix data access from within hwmon in suspend hook

Changes since V2:
- Fix various non-functional nits
- On hibernation restore, use restore instead of thaw, switch to bools, and restore fan pwm mode, but only after the first pwm write after hibernation. Also, release pwm when entering hibernation.

Changes since V1:
- Use plain sysfs attrs for magic module attributes
- Combine quirk for power and modules, so attribute tree is simpler
- Use switch statement in hwmon
- Add hibernation hook for charge bypass in last patch
- Restoring fan speed is a liability so it is omitted, see patch notes Note that for EC managed fan curves, it would be acceptable
- Regmap comment: Using regmap is unprecedented for ACPI mapped ECs and overkill for one value (> 100 LOC)
- fixp_linear_interpolate() comment: it requires importing an extra header, is not used for static parameters in other modules, and expands to the same equation for parameters used, so it is omitted

Antheas Kapenekakis (6):
platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform
driver
platform/x86: ayaneo-ec: Add hwmon support
platform/x86: ayaneo-ec: Add charge control support platform/x86: ayaneo-ec: Add controller power and modules attributes platform/x86: ayaneo-ec: Move Ayaneo devices from oxpec to ayaneo-ec platform/x86: ayaneo-ec: Add suspend hook

 .../ABI/testing/sysfs-platform-ayaneo-ec      |  19 +
 MAINTAINERS                                   |   7 +
 drivers/platform/x86/Kconfig                  |  17 +-
 drivers/platform/x86/Makefile                 |   3 +
 drivers/platform/x86/ayaneo-ec.c              | 593 ++++++++++++++++++
 drivers/platform/x86/oxpec.c                  | 115 +---
 6 files changed, 637 insertions(+), 117 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-ayaneo-ec
 create mode 100644 drivers/platform/x86/ayaneo-ec.c

base-commit: 6a23ae0a96a600d1d12557add110e0bb6e32730c

Signature · 1 line
2.52.0