Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for Ayaneo Flip KB/DS. #10

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6f29aaf
ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER
heftig Sep 16, 2019
ac72431
drivers/firmware: skip simpledrm if nvidia-drm.modeset=1 is set
martinezjavier May 19, 2022
fec4baf
arch/Kconfig: Default to maximum amount of ASLR bits
heftig Jan 13, 2024
6de0c75
Arch Linux kernel v6.9.3-arch1
heftig May 31, 2024
60b00e1
amdgpu: enable overdrive by default
BoukeHaarsma23 Dec 12, 2023
056fef6
drm: panel-orientation-quirks: Add quirk for AYA NEO 2 model
Samsagax Jun 21, 2023
41bb558
drm: panel-orientation-quirks: Add quirk for AYA NEO Founder edition
Samsagax Jun 21, 2023
df8eb7d
drm: panel-orientation-quirks: Add quirk for AYA NEO GEEK
Samsagax Jun 21, 2023
f9ab95b
drm: panel-orientation-quirks: Add quirk for Ayn Loki Zero
BoukeHaarsma23 Oct 7, 2023
0230f30
drm: panel-orientation-quirks: Add quirk for Ayn Loki Max
BoukeHaarsma23 Oct 7, 2023
cfa4570
Ayaneo geek headset patch
BoukeHaarsma23 Sep 22, 2023
2fbf485
ayaneo 2 headphone fix
BoukeHaarsma23 Sep 22, 2023
1439ec0
HID: asus: fix more n-key report descriptors if n-key quirked
flukejones Dec 2, 2023
299bf23
HID: asus: make asus_kbd_init() generic, remove rog_nkey_led_init()
flukejones Dec 2, 2023
4449974
HID: asus: add ROG Ally N-Key ID and keycodes
flukejones Nov 29, 2023
02710fa
HID: asus: add ROG Ally xpad settings
flukejones Dec 1, 2023
f580aa6
HACK: add KConfig to enable driver-specific color mgmt props
melissawen Apr 22, 2023
2218ee8
Don't create color_mgmt_properties on asics < SIENNA_CICHLID
BoukeHaarsma23 Dec 15, 2023
61c0e23
drm: Add GPU reset sysfs event
contactshashanksharma Mar 7, 2022
6d18d99
drm/amdgpu: add work function for GPU reset event
contactshashanksharma Mar 7, 2022
3bad8cb
drm/amdgpu: schedule GPU reset event work function
Mar 10, 2022
c40ac81
oxp-sensors: hwmon: Add OrangePi Neo PWM fan control
pastaq Mar 28, 2024
e258f00
oxp-sensors: hwmon: Add OneXPlayer 2 and OneXFly
pastaq Mar 28, 2024
8f52f0c
oxp-sensors: hwmon: Add support for AYANEO 2s, air 1s, geek 1s and ku…
pastaq Mar 28, 2024
a64705f
oxp-sensors: hwmon: Add GPD Win Mini
pastaq Mar 28, 2024
38d36b6
platform/x86: asus-wmi: add support for 2024 ROG Mini-LED
flukejones Mar 10, 2024
e4b41fc
platform/x86: asus-wmi: add support for Vivobook GPU MUX
flukejones Mar 10, 2024
c360d44
platform/x86: asus-wmi: add support variant of TUF RGB
flukejones Mar 10, 2024
95b1517
platform/x86: asus-wmi: support toggling POST sound
flukejones Mar 10, 2024
622c3de
platform/x86: asus-wmi: store a min default for ppt options
flukejones Mar 10, 2024
6d607e8
platform/x86: asus-wmi: adjust formatting of ppt-<name>() functions
flukejones Mar 25, 2024
bd24a07
platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave
flukejones Mar 24, 2024
0c61fb5
platform/x86: asus-wmi: Add support for MCU powersave
flukejones Mar 25, 2024
f620831
platform/x86: asus-wmi: cleanup main struct to avoid some holes
flukejones Mar 25, 2024
0091984
bump the sensitivity of AMD SFH
antheas Mar 3, 2024
48963d0
IIO: add aya neo tablet identifier
BoukeHaarsma23 Apr 10, 2024
2992433
iio: imu: Add driver for Bosch BMI260 IMU
justinweiss Feb 14, 2024
bc44322
Codec: Add aw87xxx codec with partial acpi implementation
ruineka Apr 25, 2024
fa04166
Updated AW87xxx driver to be more verbose for debugging purposes, but…
CVMagic May 16, 2024
196f497
drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations
mohamexiety May 9, 2024
b6ae17d
Updated AW87xxx driver to automatically enumerate a second I2C chip i…
CVMagic May 19, 2024
93ec07e
Updated AW87xxx driver to implement Suspend and Resume.
CVMagic May 22, 2024
e25c445
Added Realtek HDA patch for AYN Loki MiniPro and AYANEO AIR PLUS
CVMagic May 26, 2024
bb33c69
Replaced DMI Matching via struct and just using vendor matching.
CVMagic Jun 5, 2024
1c5b0df
Add Atari VCS quirk
fewtarius May 28, 2024
cfbe064
linux-chimeraos v6.9.3-chos2
BoukeHaarsma23 May 27, 2024
893856c
Adds support for Ayaneo Flip KB/DS.
fewtarius Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
oxp-sensors: hwmon: Add GPD Win Mini
Add GPD Win Mini. GPD devices don't have a separate enable register, the PWM
register is used for this purpose. A write value of 0 puts the PWM into auto
mode, writing anything 1-244 puts the PWM into manual mode, and 245-255 are
undefined. We scale to 1-255 and handle manual by writing a value to 70% as a
common sense default.
  • Loading branch information
pastaq authored and Samsagax committed Jun 3, 2024
commit a64705f6b3742f75b0d072a3a9317bd9cad0089a
43 changes: 43 additions & 0 deletions drivers/hwmon/oxp-sensors.c
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ enum oxp_board {
aya_neo_geek,
aya_neo_geek_1s,
aya_neo_kun,
gpd_win_mini,
orange_pi_neo,
oxp_2,
oxp_fly,
@@ -69,8 +70,19 @@ static enum oxp_board board;
#define ORANGEPI_SENSOR_PWM_ENABLE_REG 0x40 /* PWM enable is 1 register long */
#define ORANGEPI_SENSOR_PWM_REG 0x38 /* PWM reading is 1 register long */

/* GPD devices don't have a separate enable register for the fan.
* For the PWM register, 0 is auto, 1+ is a manual value, up to 255
* depending on the specific model. This driver will scale to 0-255
* and treat PWM enable without a value as "set to manual, 70%."
* The mini uses the same fan register as the OrangePi NEO.
*/
#define GPD_MINI_SENSOR_PWM_REG 0x7A /* PWM reading is 1 register long */
/* Values for fan auto mode */
#define PWM_MODE_AUTO 0x00

/* Values for fan manual mode */
#define PWM_MODE_MANUAL 0x01
#define GPD_MINI_PWM_MODE_MANUAL 0xAA /* 70% */
/* Turbo button takeover function
* Different boards have different values and EC registers
* for the same function
@@ -161,6 +173,13 @@ static const struct dmi_system_id dmi_table[] = {
},
.driver_data = (void *)aya_neo_kun,
},
{
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "GPD"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "G1617-01"),
},
.driver_data = (void *)gpd_win_mini,
},
{
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "OrangePi"),
@@ -388,6 +407,11 @@ static DEVICE_ATTR_RW(tt_toggle);
static int oxp_pwm_enable(void)
{
switch (board) {
/* GPD has no separate enable register, instead, set the fan to
* a safe default.
*/
case gpd_win_mini:
return write_to_ec(GPD_MINI_SENSOR_PWM_REG, GPD_MINI_PWM_MODE_MANUAL);
case orange_pi_neo:
return write_to_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, PWM_MODE_MANUAL);
case aok_zoe_a1:
@@ -414,6 +438,8 @@ static int oxp_pwm_enable(void)
static int oxp_pwm_disable(void)
{
switch (board) {
case gpd_win_mini:
return write_to_ec(GPD_MINI_SENSOR_PWM_REG, PWM_MODE_AUTO);
case orange_pi_neo:
return write_to_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, PWM_MODE_AUTO);
case aok_zoe_a1:
@@ -461,6 +487,7 @@ static int oxp_platform_read(struct device *dev, enum hwmon_sensor_types type,
switch (attr) {
case hwmon_fan_input:
switch (board) {
case gpd_win_mini:
case orange_pi_neo:
return read_from_ec(ORANGEPI_SENSOR_FAN_REG, 2, val);
case aok_zoe_a1:
@@ -490,6 +517,14 @@ static int oxp_platform_read(struct device *dev, enum hwmon_sensor_types type,
switch (attr) {
case hwmon_pwm_input:
switch (board) {
case gpd_win_mini:
ret = read_from_ec(GPD_MINI_SENSOR_PWM_REG, 1, val);
if (ret)
return ret;
if (*val != PWM_MODE_AUTO)
/* scale from range [1-244] */
*val = ((*val - 1) * 254 / 243) + 1;
break;
case orange_pi_neo:
ret = read_from_ec(ORANGEPI_SENSOR_PWM_REG, 1, val);
if (ret)
@@ -522,6 +557,10 @@ static int oxp_platform_read(struct device *dev, enum hwmon_sensor_types type,
return 0;
case hwmon_pwm_enable:
switch (board) {
case gpd_win_mini:
ret = read_from_ec(GPD_MINI_SENSOR_PWM_REG, 1, val);
*val = (*val != PWM_MODE_AUTO);
return ret;
case orange_pi_neo:
return read_from_ec(ORANGEPI_SENSOR_PWM_ENABLE_REG, 1, val);
case aok_zoe_a1:
@@ -569,6 +608,10 @@ static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type,
if (val < 0 || val > 255)
return -EINVAL;
switch (board) {
case gpd_win_mini:
/* scale to range [1-244] */
val = ((val - 1) * 243 / 254) + 1;
return write_to_ec(GPD_MINI_SENSOR_PWM_REG, val);
case orange_pi_neo:
/* scale to range [1-244] */
val = ((val - 1) * 243 / 254) + 1;