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

Antheas Kapenekakis posted 6 patches 1 week, 5 days ago
.../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
[PATCH v6 0/6] platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driver
Posted by Antheas Kapenekakis 1 week, 5 days ago
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/20251113212221.456875-1-lkml@antheas.dev/
V4: https://lore.kernel.org/all/20251110180846.1490726-1-lkml@antheas.dev/
V3: https://lore.kernel.org/all/20251031163651.1465981-1-lkml@antheas.dev/
V2: https://lore.kernel.org/all/20251015084414.1391595-1-lkml@antheas.dev/
V1: https://lore.kernel.org/all/20250820160628.99678-1-lkml@antheas.dev/

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
-- 
2.52.0
Re: [PATCH v6 0/6] platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driver
Posted by Ilpo Järvinen 1 week, 3 days ago
On Wed, 19 Nov 2025 18:44:59 +0100, Antheas Kapenekakis wrote:

> 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].
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/6] platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driver
      commit: 70a4a815d9b74f17abd1ae46c6cb93b736e02d91
[2/6] platform/x86: ayaneo-ec: Add hwmon support
      commit: 536522f0355cffe8478502ffbb041769e2f61bfe
[3/6] platform/x86: ayaneo-ec: Add charge control support
      commit: 6d710ec3584227a9c393c478b1cd4a70e74a3c88
[4/6] platform/x86: ayaneo-ec: Add controller power and modules attributes
      commit: e921a8b4dea50b9c20f1ee9b2b69cedc00b7570a
[5/6] platform/x86: ayaneo-ec: Move Ayaneo devices from oxpec to ayaneo-ec
      commit: 02c15e3ddcc5a50fbdf1e586d94f0372f5b40ed5
[6/6] platform/x86: ayaneo-ec: Add suspend hook
      commit: 2643187ccb8628144246ee9d44da5e3ac428f9c3

--
 i.