hwmon: (oxp-sensors) Add AYANEO 2 and Geek models
authorJoaquín Ignacio Aramendía <samsagax@gmail.com>
Wed, 26 Apr 2023 18:44:20 +0000 (15:44 -0300)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 8 Jun 2023 13:41:16 +0000 (06:41 -0700)
Add support for handhelds with same EC registers
  - AYANEO 2
  - AYANEO GEEK

All functionality tests succeed on AYANEO 2 by "pastaq" user on Discord
and AYANEO GEEK tested by "oneoc" Discord user.

Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com>
Link: https://lore.kernel.org/r/20230426184420.99945-1-samsagax@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/oxp-sensors.rst
drivers/hwmon/oxp-sensors.c

index 566a8d5..4ab4423 100644 (file)
@@ -25,8 +25,10 @@ Supported devices
 Currently the driver supports the following handhelds:
 
  - AOK ZOE A1
+ - Aya Neo 2
  - Aya Neo AIR
  - Aya Neo AIR Pro
+ - Aya Neo Geek
  - OneXPlayer AMD
  - OneXPlayer mini AMD
  - OneXPlayer mini AMD PRO
index ae67207..9093c60 100644 (file)
@@ -42,8 +42,10 @@ static bool unlock_global_acpi_lock(void)
 
 enum oxp_board {
        aok_zoe_a1 = 1,
+       aya_neo_2,
        aya_neo_air,
        aya_neo_air_pro,
+       aya_neo_geek,
        oxp_mini_amd,
        oxp_mini_amd_pro,
 };
@@ -65,6 +67,13 @@ static const struct dmi_system_id dmi_table[] = {
        {
                .matches = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
+                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "AYANEO 2"),
+               },
+               .driver_data = (void *) &(enum oxp_board) {aya_neo_2},
+       },
+       {
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
                        DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR"),
                },
                .driver_data = (void *) &(enum oxp_board) {aya_neo_air},
@@ -78,6 +87,13 @@ static const struct dmi_system_id dmi_table[] = {
        },
        {
                .matches = {
+                       DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
+                       DMI_EXACT_MATCH(DMI_BOARD_NAME, "GEEK"),
+               },
+               .driver_data = (void *) &(enum oxp_board) {aya_neo_geek},
+       },
+       {
+               .matches = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"),
                        DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONE XPLAYER"),
                },
@@ -178,8 +194,10 @@ static int oxp_platform_read(struct device *dev, enum hwmon_sensor_types type,
                        if (ret)
                                return ret;
                        switch (board) {
+                       case aya_neo_2:
                        case aya_neo_air:
                        case aya_neo_air_pro:
+                       case aya_neo_geek:
                        case oxp_mini_amd:
                                *val = (*val * 255) / 100;
                                break;
@@ -217,8 +235,10 @@ static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type,
                        if (val < 0 || val > 255)
                                return -EINVAL;
                        switch (board) {
+                       case aya_neo_2:
                        case aya_neo_air:
                        case aya_neo_air_pro:
+                       case aya_neo_geek:
                        case oxp_mini_amd:
                                val = (val * 100) / 255;
                                break;