Unverified Commit b369395c authored by Antheas Kapenekakis's avatar Antheas Kapenekakis Committed by Ilpo Järvinen
Browse files

platform/x86: oxpec: Add support for the OneXPlayer G1



The OneXPlayer G1 is a new clamshell formfactor by OneXPlayer.
It has the same registers as an OneXPlayer X1, with the only
difference being the lack of a turbo led.

Tested-by: default avatarJoshua Tam <csinaction@pm.me>
Suggested-by: default avatarJoshua Tam <csinaction@pm.me>
Signed-off-by: default avatarJoshua Tam <csinaction@pm.me>
Signed-off-by: default avatarAntheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250426172955.13957-3-lkml@antheas.dev


Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent e25a982b
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ enum oxp_board {
	oxp_mini_amd_a07,
	oxp_mini_amd_pro,
	oxp_x1,
	oxp_g1,
};

static enum oxp_board board;
@@ -241,6 +242,20 @@ static const struct dmi_system_id dmi_table[] = {
		},
		.driver_data = (void *)oxp_fly,
	},
	{
		.matches = {
			DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"),
			DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONEXPLAYER G1 A"),
		},
		.driver_data = (void *)oxp_g1,
	},
	{
		.matches = {
			DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"),
			DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONEXPLAYER G1 i"),
		},
		.driver_data = (void *)oxp_g1,
	},
	{
		.matches = {
			DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"),
@@ -337,6 +352,7 @@ static umode_t tt_toggle_is_visible(struct kobject *kobj,
	case oxp_mini_amd_a07:
	case oxp_mini_amd_pro:
	case oxp_x1:
	case oxp_g1:
		return attr->mode;
	default:
		break;
@@ -370,6 +386,7 @@ static ssize_t tt_toggle_store(struct device *dev,
		break;
	case oxp_2:
	case oxp_x1:
	case oxp_g1:
		reg = OXP_2_TURBO_SWITCH_REG;
		mask = OXP_TURBO_TAKE_VAL;
		break;
@@ -414,6 +431,7 @@ static ssize_t tt_toggle_show(struct device *dev,
		break;
	case oxp_2:
	case oxp_x1:
	case oxp_g1:
		reg = OXP_2_TURBO_SWITCH_REG;
		mask = OXP_TURBO_TAKE_VAL;
		break;
@@ -502,6 +520,7 @@ static bool oxp_psy_ext_supported(void)
{
	switch (board) {
	case oxp_x1:
	case oxp_g1:
	case oxp_fly:
		return true;
	default:
@@ -640,6 +659,7 @@ static int oxp_pwm_enable(void)
	case oxp_mini_amd_a07:
	case oxp_mini_amd_pro:
	case oxp_x1:
	case oxp_g1:
		return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, PWM_MODE_MANUAL);
	default:
		return -EINVAL;
@@ -666,6 +686,7 @@ static int oxp_pwm_disable(void)
	case oxp_mini_amd_a07:
	case oxp_mini_amd_pro:
	case oxp_x1:
	case oxp_g1:
		return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, PWM_MODE_AUTO);
	default:
		return -EINVAL;
@@ -692,6 +713,7 @@ static int oxp_pwm_read(long *val)
	case oxp_mini_amd_a07:
	case oxp_mini_amd_pro:
	case oxp_x1:
	case oxp_g1:
		return read_from_ec(OXP_SENSOR_PWM_ENABLE_REG, 1, val);
	default:
		return -EOPNOTSUPP;
@@ -720,6 +742,7 @@ static int oxp_pwm_fan_speed(long *val)
		return read_from_ec(ORANGEPI_SENSOR_FAN_REG, 2, val);
	case oxp_2:
	case oxp_x1:
	case oxp_g1:
		return read_from_ec(OXP_2_SENSOR_FAN_REG, 2, val);
	case aok_zoe_a1:
	case aya_neo_2:
@@ -753,6 +776,7 @@ static int oxp_pwm_input_write(long val)
		return write_to_ec(ORANGEPI_SENSOR_PWM_REG, val);
	case oxp_2:
	case oxp_x1:
	case oxp_g1:
		/* scale to range [0-184] */
		val = (val * 184) / 255;
		return write_to_ec(OXP_SENSOR_PWM_REG, val);
@@ -792,6 +816,7 @@ static int oxp_pwm_input_read(long *val)
		break;
	case oxp_2:
	case oxp_x1:
	case oxp_g1:
		ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val);
		if (ret)
			return ret;