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: Move Ayaneo devices from oxpec to ayaneo-ec

Currently, the oxpec driver contains Ayaneo devices. Move them to the
new ayaneo-ec driver, which is dedicated to them.

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.

In addition, update the readmes of oxpec to reflect this change.

Link: https://github.com/ShadowBlip/ayaneo-platform
Tested-by: Derek J. Clark <derekjohn.clark@gmail.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://patch.msgid.link/20251119174505.597218-6-lkml@antheas.dev
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Antheas Kapenekakis and committed by
Ilpo Järvinen
02c15e3d e921a8b4

+67 -117
+1 -3
drivers/platform/x86/Kconfig
··· 1038 1038 help 1039 1039 Enables support for the platform EC of OneXPlayer and AOKZOE 1040 1040 handheld devices. This includes fan speed, fan controls, and 1041 - disabling the default TDP behavior of the device. Due to legacy 1042 - reasons, this driver also provides hwmon functionality to Ayaneo 1043 - devices and the OrangePi Neo. 1041 + disabling the default TDP behavior of the device. 1044 1042 1045 1043 source "drivers/platform/x86/tuxedo/Kconfig" 1046 1044
+65
drivers/platform/x86/ayaneo-ec.c
··· 54 54 struct acpi_battery_hook battery_hook; 55 55 }; 56 56 57 + static const struct ayaneo_ec_quirk quirk_fan = { 58 + .has_fan_control = true, 59 + }; 60 + 61 + static const struct ayaneo_ec_quirk quirk_charge_limit = { 62 + .has_fan_control = true, 63 + .has_charge_control = true, 64 + }; 65 + 57 66 static const struct ayaneo_ec_quirk quirk_ayaneo3 = { 58 67 .has_fan_control = true, 59 68 .has_charge_control = true, ··· 70 61 }; 71 62 72 63 static const struct dmi_system_id dmi_table[] = { 64 + { 65 + .matches = { 66 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 67 + DMI_MATCH(DMI_BOARD_NAME, "AYANEO 2"), 68 + }, 69 + .driver_data = (void *)&quirk_fan, 70 + }, 71 + { 72 + .matches = { 73 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 74 + DMI_MATCH(DMI_BOARD_NAME, "FLIP"), 75 + }, 76 + .driver_data = (void *)&quirk_fan, 77 + }, 78 + { 79 + .matches = { 80 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 81 + DMI_MATCH(DMI_BOARD_NAME, "GEEK"), 82 + }, 83 + .driver_data = (void *)&quirk_fan, 84 + }, 85 + { 86 + .matches = { 87 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 88 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR"), 89 + }, 90 + .driver_data = (void *)&quirk_charge_limit, 91 + }, 92 + { 93 + .matches = { 94 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 95 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR 1S"), 96 + }, 97 + .driver_data = (void *)&quirk_charge_limit, 98 + }, 99 + { 100 + .matches = { 101 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 102 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "AB05-Mendocino"), 103 + }, 104 + .driver_data = (void *)&quirk_charge_limit, 105 + }, 106 + { 107 + .matches = { 108 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 109 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR Pro"), 110 + }, 111 + .driver_data = (void *)&quirk_charge_limit, 112 + }, 113 + { 114 + .matches = { 115 + DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 116 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "KUN"), 117 + }, 118 + .driver_data = (void *)&quirk_charge_limit, 119 + }, 73 120 { 74 121 .matches = { 75 122 DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
+1 -114
drivers/platform/x86/oxpec.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0+ 2 2 /* 3 - * Platform driver for OneXPlayer and AOKZOE devices. For the time being, 4 - * it also exposes fan controls for AYANEO, and OrangePi Handhelds via 5 - * hwmon sysfs. 3 + * Platform driver for OneXPlayer and AOKZOE devices. 6 4 * 7 5 * Fan control is provided via pwm interface in the range [0-255]. 8 6 * Old AMD boards use [0-100] as range in the EC, the written value is ··· 41 43 42 44 enum oxp_board { 43 45 aok_zoe_a1 = 1, 44 - aya_neo_2, 45 - aya_neo_air, 46 - aya_neo_air_1s, 47 - aya_neo_air_plus_mendo, 48 - aya_neo_air_pro, 49 - aya_neo_flip, 50 - aya_neo_geek, 51 - aya_neo_kun, 52 46 orange_pi_neo, 53 47 oxp_2, 54 48 oxp_fly, ··· 120 130 DMI_EXACT_MATCH(DMI_BOARD_NAME, "AOKZOE A1X"), 121 131 }, 122 132 .driver_data = (void *)oxp_fly, 123 - }, 124 - { 125 - .matches = { 126 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 127 - DMI_MATCH(DMI_BOARD_NAME, "AYANEO 2"), 128 - }, 129 - .driver_data = (void *)aya_neo_2, 130 - }, 131 - { 132 - .matches = { 133 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 134 - DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR"), 135 - }, 136 - .driver_data = (void *)aya_neo_air, 137 - }, 138 - { 139 - .matches = { 140 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 141 - DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR 1S"), 142 - }, 143 - .driver_data = (void *)aya_neo_air_1s, 144 - }, 145 - { 146 - .matches = { 147 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 148 - DMI_EXACT_MATCH(DMI_BOARD_NAME, "AB05-Mendocino"), 149 - }, 150 - .driver_data = (void *)aya_neo_air_plus_mendo, 151 - }, 152 - { 153 - .matches = { 154 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 155 - DMI_EXACT_MATCH(DMI_BOARD_NAME, "AIR Pro"), 156 - }, 157 - .driver_data = (void *)aya_neo_air_pro, 158 - }, 159 - { 160 - .matches = { 161 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 162 - DMI_MATCH(DMI_BOARD_NAME, "FLIP"), 163 - }, 164 - .driver_data = (void *)aya_neo_flip, 165 - }, 166 - { 167 - .matches = { 168 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 169 - DMI_MATCH(DMI_BOARD_NAME, "GEEK"), 170 - }, 171 - .driver_data = (void *)aya_neo_geek, 172 - }, 173 - { 174 - .matches = { 175 - DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 176 - DMI_EXACT_MATCH(DMI_BOARD_NAME, "KUN"), 177 - }, 178 - .driver_data = (void *)aya_neo_kun, 179 133 }, 180 134 { 181 135 .matches = { ··· 606 672 case orange_pi_neo: 607 673 return write_to_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, PWM_MODE_MANUAL); 608 674 case aok_zoe_a1: 609 - case aya_neo_2: 610 - case aya_neo_air: 611 - case aya_neo_air_plus_mendo: 612 - case aya_neo_air_pro: 613 - case aya_neo_flip: 614 - case aya_neo_geek: 615 - case aya_neo_kun: 616 675 case oxp_2: 617 676 case oxp_fly: 618 677 case oxp_mini_amd: ··· 626 699 case orange_pi_neo: 627 700 return write_to_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, PWM_MODE_AUTO); 628 701 case aok_zoe_a1: 629 - case aya_neo_2: 630 - case aya_neo_air: 631 - case aya_neo_air_1s: 632 - case aya_neo_air_plus_mendo: 633 - case aya_neo_air_pro: 634 - case aya_neo_flip: 635 - case aya_neo_geek: 636 - case aya_neo_kun: 637 702 case oxp_2: 638 703 case oxp_fly: 639 704 case oxp_mini_amd: ··· 646 727 case orange_pi_neo: 647 728 return read_from_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, 1, val); 648 729 case aok_zoe_a1: 649 - case aya_neo_2: 650 - case aya_neo_air: 651 - case aya_neo_air_1s: 652 - case aya_neo_air_plus_mendo: 653 - case aya_neo_air_pro: 654 - case aya_neo_flip: 655 - case aya_neo_geek: 656 - case aya_neo_kun: 657 730 case oxp_2: 658 731 case oxp_fly: 659 732 case oxp_mini_amd: ··· 685 774 case oxp_g1_i: 686 775 return read_from_ec(OXP_2_SENSOR_FAN_REG, 2, val); 687 776 case aok_zoe_a1: 688 - case aya_neo_2: 689 - case aya_neo_air: 690 - case aya_neo_air_1s: 691 - case aya_neo_air_plus_mendo: 692 - case aya_neo_air_pro: 693 - case aya_neo_flip: 694 - case aya_neo_geek: 695 - case aya_neo_kun: 696 777 case oxp_fly: 697 778 case oxp_mini_amd: 698 779 case oxp_mini_amd_a07: ··· 713 810 /* scale to range [0-184] */ 714 811 val = (val * 184) / 255; 715 812 return write_to_ec(OXP_SENSOR_PWM_REG, val); 716 - case aya_neo_2: 717 - case aya_neo_air: 718 - case aya_neo_air_1s: 719 - case aya_neo_air_plus_mendo: 720 - case aya_neo_air_pro: 721 - case aya_neo_flip: 722 - case aya_neo_geek: 723 - case aya_neo_kun: 724 813 case oxp_mini_amd: 725 814 case oxp_mini_amd_a07: 726 815 /* scale to range [0-100] */ ··· 749 854 /* scale from range [0-184] */ 750 855 *val = (*val * 255) / 184; 751 856 break; 752 - case aya_neo_2: 753 - case aya_neo_air: 754 - case aya_neo_air_1s: 755 - case aya_neo_air_plus_mendo: 756 - case aya_neo_air_pro: 757 - case aya_neo_flip: 758 - case aya_neo_geek: 759 - case aya_neo_kun: 760 857 case oxp_mini_amd: 761 858 case oxp_mini_amd_a07: 762 859 ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val);