Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Recent Ayaneo devices feature an ACPI mapped Embedded Controller (EC)
with standard addresses across models that provides access to fan
speed, fan control, battery charge limits, and controller power
controls. Introduce a new driver stub that will handle these driver
features.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://patch.msgid.link/20251119174505.597218-2-lkml@antheas.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Antheas Kapenekakis and committed by
Ilpo Järvinen
70a4a815 a9b08697

+109
+6
MAINTAINERS
··· 4187 4187 F: Documentation/devicetree/bindings/pwm/adi,axi-pwmgen.yaml 4188 4188 F: drivers/pwm/pwm-axi-pwmgen.c 4189 4189 4190 + AYANEO PLATFORM EC DRIVER 4191 + M: Antheas Kapenekakis <lkml@antheas.dev> 4192 + L: platform-driver-x86@vger.kernel.org 4193 + S: Maintained 4194 + F: drivers/platform/x86/ayaneo-ec.c 4195 + 4190 4196 AZ6007 DVB DRIVER 4191 4197 M: Mauro Carvalho Chehab <mchehab@kernel.org> 4192 4198 L: linux-media@vger.kernel.org
+10
drivers/platform/x86/Kconfig
··· 311 311 If you have an Asus TF103C tablet say Y or M here, for a generic x86 312 312 distro config say M here. 313 313 314 + config AYANEO_EC 315 + tristate "Ayaneo EC platform control" 316 + depends on DMI 317 + help 318 + Enables support for the platform EC of Ayaneo devices. This 319 + includes fan control, fan speed, charge limit, magic 320 + module detection, and controller power control. 321 + 322 + If you have an Ayaneo device, say Y or M here. 323 + 314 324 config MERAKI_MX100 315 325 tristate "Cisco Meraki MX100 Platform Driver" 316 326 depends on GPIOLIB
+3
drivers/platform/x86/Makefile
··· 39 39 obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o 40 40 obj-$(CONFIG_EEEPC_WMI) += eeepc-wmi.o 41 41 42 + # Ayaneo 43 + obj-$(CONFIG_AYANEO_EC) += ayaneo-ec.o 44 + 42 45 # Cisco/Meraki 43 46 obj-$(CONFIG_MERAKI_MX100) += meraki-mx100.o 44 47
+90
drivers/platform/x86/ayaneo-ec.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Platform driver for the Embedded Controller (EC) of Ayaneo devices. Handles 4 + * hwmon (fan speed, fan control), battery charge limits, and magic module 5 + * control (connected modules, controller disconnection). 6 + * 7 + * Copyright (C) 2025 Antheas Kapenekakis <lkml@antheas.dev> 8 + */ 9 + 10 + #include <linux/dmi.h> 11 + #include <linux/err.h> 12 + #include <linux/init.h> 13 + #include <linux/kernel.h> 14 + #include <linux/module.h> 15 + #include <linux/platform_device.h> 16 + 17 + struct ayaneo_ec_quirk { 18 + }; 19 + 20 + struct ayaneo_ec_platform_data { 21 + struct platform_device *pdev; 22 + struct ayaneo_ec_quirk *quirks; 23 + }; 24 + 25 + static const struct ayaneo_ec_quirk quirk_ayaneo3 = { 26 + }; 27 + 28 + static const struct dmi_system_id dmi_table[] = { 29 + { 30 + .matches = { 31 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 32 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "AYANEO 3"), 33 + }, 34 + .driver_data = (void *)&quirk_ayaneo3, 35 + }, 36 + {}, 37 + }; 38 + 39 + static int ayaneo_ec_probe(struct platform_device *pdev) 40 + { 41 + const struct dmi_system_id *dmi_entry; 42 + struct ayaneo_ec_platform_data *data; 43 + 44 + dmi_entry = dmi_first_match(dmi_table); 45 + if (!dmi_entry) 46 + return -ENODEV; 47 + 48 + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 49 + if (!data) 50 + return -ENOMEM; 51 + 52 + data->pdev = pdev; 53 + data->quirks = dmi_entry->driver_data; 54 + platform_set_drvdata(pdev, data); 55 + 56 + return 0; 57 + } 58 + 59 + static struct platform_driver ayaneo_platform_driver = { 60 + .driver = { 61 + .name = "ayaneo-ec", 62 + }, 63 + .probe = ayaneo_ec_probe, 64 + }; 65 + 66 + static struct platform_device *ayaneo_platform_device; 67 + 68 + static int __init ayaneo_ec_init(void) 69 + { 70 + ayaneo_platform_device = 71 + platform_create_bundle(&ayaneo_platform_driver, 72 + ayaneo_ec_probe, NULL, 0, NULL, 0); 73 + 74 + return PTR_ERR_OR_ZERO(ayaneo_platform_device); 75 + } 76 + 77 + static void __exit ayaneo_ec_exit(void) 78 + { 79 + platform_device_unregister(ayaneo_platform_device); 80 + platform_driver_unregister(&ayaneo_platform_driver); 81 + } 82 + 83 + MODULE_DEVICE_TABLE(dmi, dmi_table); 84 + 85 + module_init(ayaneo_ec_init); 86 + module_exit(ayaneo_ec_exit); 87 + 88 + MODULE_AUTHOR("Antheas Kapenekakis <lkml@antheas.dev>"); 89 + MODULE_DESCRIPTION("Ayaneo Embedded Controller (EC) platform features"); 90 + MODULE_LICENSE("GPL");