lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFqHKTksD_J0M1fTJm3rYa3i=Or2xnz0n2P8b2TkcdvuDfExAA@mail.gmail.com>
Date: Fri, 22 Aug 2025 17:07:25 -0700
From: Derek John Clark <derekjohn.clark@...il.com>
To: Antheas Kapenekakis <lkml@...heas.dev>
Cc: platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-hwmon@...r.kernel.org, Hans de Goede <hansg@...nel.org>, 
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, 
	Joaquín Ignacio Aramendía <samsagax@...il.com>, 
	Jean Delvare <jdelvare@...e.com>, Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH v1 5/5] platform/x86: ayaneo-ec: Move Ayaneo devices from
 oxpec to ayaneo-ec

On Wed, Aug 20, 2025 at 9:06 AM Antheas Kapenekakis <lkml@...heas.dev> wrote:
>
> Currently, the oxpec driver contains Ayaneo devices. Move them to the
> new ayaneo-ec driver, which is dedicated to them.
>
Hi Antheas,

Fan control is still functional under the ayaneo_ec driver in hwmon
with this patch. Tested on my AYANEO 2S.

> As this driver supports charge inhibition for Ayaneo, add support for it
> for the AIR, AIR 1S, AB05-Medoncino, AIR Pro, and Kun, referenced from
> the out-of-tree ayaneo-platform driver.
>

Works on my AYANEO AIR.

Tested-by: Derek J. Clark <derekjohn.clark@...il.com>

Cheers,
Derek

> In addition, update the readmes of oxpec to reflect this change.
>
> Link: https://github.com/ShadowBlip/ayaneo-platform
> Signed-off-by: Antheas Kapenekakis <lkml@...heas.dev>
> ---
>  drivers/platform/x86/Kconfig     |   4 +-
>  drivers/platform/x86/ayaneo-ec.c |  66 ++++++++++++++++++
>  drivers/platform/x86/oxpec.c     | 115 +------------------------------
>  3 files changed, 68 insertions(+), 117 deletions(-)
>
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index c871a722e5ef..06b53b0a3818 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1031,9 +1031,7 @@ config OXP_EC
>         help
>                 Enables support for the platform EC of OneXPlayer and AOKZOE
>                 handheld devices. This includes fan speed, fan controls, and
> -               disabling the default TDP behavior of the device. Due to legacy
> -               reasons, this driver also provides hwmon functionality to Ayaneo
> -               devices and the OrangePi Neo.
> +               disabling the default TDP behavior of the device.
>
>  source "drivers/platform/x86/tuxedo/Kconfig"
>
> diff --git a/drivers/platform/x86/ayaneo-ec.c b/drivers/platform/x86/ayaneo-ec.c
> index eb7f9ae03b4f..d70fd0bd620e 100644
> --- a/drivers/platform/x86/ayaneo-ec.c
> +++ b/drivers/platform/x86/ayaneo-ec.c
> @@ -83,6 +83,15 @@ struct ayaneo_fw_attr {
>         struct kobj_attribute current_value;
>  };
>
> +static const struct ayaneo_ec_quirk quirk_fan = {
> +       .has_fan_control = true,
> +};
> +
> +static const struct ayaneo_ec_quirk quirk_charge_limit = {
> +       .has_fan_control = true,
> +       .has_charge_control = true,
> +};
> +
>  static const struct ayaneo_ec_quirk ayaneo3 = {
>         .has_fan_control = true,
>         .has_charge_control = true,
> @@ -91,6 +100,63 @@ static const struct ayaneo_ec_quirk ayaneo3 = {
>  };
>
>  static const struct dmi_system_id dmi_table[] = {
> +
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_MATCH(DMI_BOARD_NAME, "AYANEO 2"),
> +               },
> +               .driver_data = (void *)&quirk_fan,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_MATCH(DMI_BOARD_NAME, "FLIP"),
> +               },
> +               .driver_data = (void *)&quirk_fan,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_MATCH(DMI_BOARD_NAME, "GEEK"),
> +               },
> +               .driver_data = (void *)&quirk_fan,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR"),
> +               },
> +               .driver_data = (void *)&quirk_charge_limit,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR 1S"),
> +               },
> +               .driver_data = (void *)&quirk_charge_limit,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AB05-Mendocino"),
> +               },
> +               .driver_data = (void *)&quirk_charge_limit,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR Pro"),
> +               },
> +               .driver_data = (void *)&quirk_charge_limit,
> +       },
> +       {
> +               .matches = {
> +                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> +                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "KUN"),
> +               },
> +               .driver_data = (void *)&quirk_charge_limit,
> +       },
>         {
>                 .matches = {
>                         DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> diff --git a/drivers/platform/x86/oxpec.c b/drivers/platform/x86/oxpec.c
> index eb076bb4099b..2074650f5ba0 100644
> --- a/drivers/platform/x86/oxpec.c
> +++ b/drivers/platform/x86/oxpec.c
> @@ -1,8 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
> - * Platform driver for OneXPlayer and AOKZOE devices. For the time being,
> - * it also exposes fan controls for AYANEO, and OrangePi Handhelds via
> - * hwmon sysfs.
> + * Platform driver for OneXPlayer and AOKZOE devices.
>   *
>   * Fan control is provided via pwm interface in the range [0-255].
>   * Old AMD boards use [0-100] as range in the EC, the written value is
> @@ -43,14 +41,6 @@ static bool unlock_global_acpi_lock(void)
>
>  enum oxp_board {
>         aok_zoe_a1 = 1,
> -       aya_neo_2,
> -       aya_neo_air,
> -       aya_neo_air_1s,
> -       aya_neo_air_plus_mendo,
> -       aya_neo_air_pro,
> -       aya_neo_flip,
> -       aya_neo_geek,
> -       aya_neo_kun,
>         orange_pi_neo,
>         oxp_2,
>         oxp_fly,
> @@ -124,62 +114,6 @@ static const struct dmi_system_id dmi_table[] = {
>                 },
>                 .driver_data = (void *)aok_zoe_a1,
>         },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_MATCH(DMI_BOARD_NAME, "AYANEO 2"),
> -               },
> -               .driver_data = (void *)aya_neo_2,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR"),
> -               },
> -               .driver_data = (void *)aya_neo_air,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR 1S"),
> -               },
> -               .driver_data = (void *)aya_neo_air_1s,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AB05-Mendocino"),
> -               },
> -               .driver_data = (void *)aya_neo_air_plus_mendo,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR Pro"),
> -               },
> -               .driver_data = (void *)aya_neo_air_pro,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_MATCH(DMI_BOARD_NAME, "FLIP"),
> -               },
> -               .driver_data = (void *)aya_neo_flip,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_MATCH(DMI_BOARD_NAME, "GEEK"),
> -               },
> -               .driver_data = (void *)aya_neo_geek,
> -       },
> -       {
> -               .matches = {
> -                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
> -                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "KUN"),
> -               },
> -               .driver_data = (void *)aya_neo_kun,
> -       },
>         {
>                 .matches = {
>                         DMI_MATCH(DMI_BOARD_VENDOR, "OrangePi"),
> @@ -658,13 +592,6 @@ static int oxp_pwm_enable(void)
>         case orange_pi_neo:
>                 return write_to_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, PWM_MODE_MANUAL);
>         case aok_zoe_a1:
> -       case aya_neo_2:
> -       case aya_neo_air:
> -       case aya_neo_air_plus_mendo:
> -       case aya_neo_air_pro:
> -       case aya_neo_flip:
> -       case aya_neo_geek:
> -       case aya_neo_kun:
>         case oxp_2:
>         case oxp_fly:
>         case oxp_mini_amd:
> @@ -685,14 +612,6 @@ static int oxp_pwm_disable(void)
>         case orange_pi_neo:
>                 return write_to_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, PWM_MODE_AUTO);
>         case aok_zoe_a1:
> -       case aya_neo_2:
> -       case aya_neo_air:
> -       case aya_neo_air_1s:
> -       case aya_neo_air_plus_mendo:
> -       case aya_neo_air_pro:
> -       case aya_neo_flip:
> -       case aya_neo_geek:
> -       case aya_neo_kun:
>         case oxp_2:
>         case oxp_fly:
>         case oxp_mini_amd:
> @@ -713,14 +632,6 @@ static int oxp_pwm_read(long *val)
>         case orange_pi_neo:
>                 return read_from_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, 1, val);
>         case aok_zoe_a1:
> -       case aya_neo_2:
> -       case aya_neo_air:
> -       case aya_neo_air_1s:
> -       case aya_neo_air_plus_mendo:
> -       case aya_neo_air_pro:
> -       case aya_neo_flip:
> -       case aya_neo_geek:
> -       case aya_neo_kun:
>         case oxp_2:
>         case oxp_fly:
>         case oxp_mini_amd:
> @@ -760,14 +671,6 @@ static int oxp_pwm_fan_speed(long *val)
>         case oxp_g1_i:
>                 return read_from_ec(OXP_2_SENSOR_FAN_REG, 2, val);
>         case aok_zoe_a1:
> -       case aya_neo_2:
> -       case aya_neo_air:
> -       case aya_neo_air_1s:
> -       case aya_neo_air_plus_mendo:
> -       case aya_neo_air_pro:
> -       case aya_neo_flip:
> -       case aya_neo_geek:
> -       case aya_neo_kun:
>         case oxp_fly:
>         case oxp_mini_amd:
>         case oxp_mini_amd_a07:
> @@ -796,14 +699,6 @@ static int oxp_pwm_input_write(long val)
>                 /* scale to range [0-184] */
>                 val = (val * 184) / 255;
>                 return write_to_ec(OXP_SENSOR_PWM_REG, val);
> -       case aya_neo_2:
> -       case aya_neo_air:
> -       case aya_neo_air_1s:
> -       case aya_neo_air_plus_mendo:
> -       case aya_neo_air_pro:
> -       case aya_neo_flip:
> -       case aya_neo_geek:
> -       case aya_neo_kun:
>         case oxp_mini_amd:
>         case oxp_mini_amd_a07:
>                 /* scale to range [0-100] */
> @@ -840,14 +735,6 @@ static int oxp_pwm_input_read(long *val)
>                 /* scale from range [0-184] */
>                 *val = (*val * 255) / 184;
>                 break;
> -       case aya_neo_2:
> -       case aya_neo_air:
> -       case aya_neo_air_1s:
> -       case aya_neo_air_plus_mendo:
> -       case aya_neo_air_pro:
> -       case aya_neo_flip:
> -       case aya_neo_geek:
> -       case aya_neo_kun:
>         case oxp_mini_amd:
>         case oxp_mini_amd_a07:
>                 ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val);
> --
> 2.50.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ