Skip to contentSkip to conversation

platform/x86: oxpec: Report tablet mode on OneXPlayer Super X

PATCH Superseded Alexander Egorov 3 participants 9 messages Jul 27 – Sep 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: oxpec: Report tablet mode on OneXPlayer Super X

The OneXPlayer Super X has a detachable pogo-pin keyboard which enumerates as USB device 1a86:1305. The firmware does not expose a tablet-mode input switch.

Without SW_TABLET_MODE, userspace treats the built-in controller and other pointer devices as evidence that the system is in laptop mode. Mutter consequently leaves automatic display rotation disabled after the keyboard is detached.

On the Super X DMI match, register a persistent input device and report SW_TABLET_MODE according to the pogo keyboard USB hotplug state. Report laptop mode while the keyboard is present and tablet mode while it is absent. Other USB and Bluetooth keyboards do not affect the switch.

Tested on a OneXPlayer Super X with keyboard attach and detach events. Mutter changes PanelOrientationManaged in both directions and applies accelerometer-driven display transforms only while the pogo keyboard is absent.

Development of this patch used assistance from ChatGPT 5.6 sol.

---
 drivers/platform/x86/Kconfig |   7 ++-
 drivers/platform/x86/oxpec.c | 110 +++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+), 2 deletions(-)
drivers/platform/x86/Kconfig +5 -2
index b54b521..3e30127 100644
@@ -1055,11 +1055,14 @@ config OXP_EC
 	depends on ACPI_EC
 	depends on ACPI_BATTERY
 	depends on HWMON
+	depends on INPUT
+	depends on USB
 	depends on X86
 	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.
+		handheld devices. This includes fan speed, fan controls, disabling
+		the default TDP behavior of the device, and tablet mode reporting
+		on supported detachable models.
 
 source "drivers/platform/x86/tuxedo/Kconfig"
 
drivers/platform/x86/oxpec.c +110 -0

138 lines not on this page · raw message

Signature · 1 line
2.55.0
#1 lore raw
Quoted 15 lines · Alexander Egorov

The OneXPlayer Super X has a detachable pogo-pin keyboard which enumerates as USB device 1a86:1305. The firmware does not expose a tablet-mode input switch.

Without SW_TABLET_MODE, userspace treats the built-in controller and other pointer devices as evidence that the system is in laptop mode. Mutter consequently leaves automatic display rotation disabled after the keyboard is detached.

On the Super X DMI match, register a persistent input device and report SW_TABLET_MODE according to the pogo keyboard USB hotplug state. Report laptop mode while the keyboard is present and tablet mode while it is absent. Other USB and Bluetooth keyboards do not affect the switch.

Quoted 6 lines

Tested on a OneXPlayer Super X with keyboard attach and detach events. Mutter changes PanelOrientationManaged in both directions and applies accelerometer-driven display transforms only while the pogo keyboard is absent.

Development of this patch used assistance from ChatGPT 5.6 sol.

Thanks for making this patch!

Drop, add:

Assisted-by Codex:gpt-5.6

This is a bit of a scope extension for the driver. I would like Ilpo to perhaps weigh in if this is the correct place for it.

Ideally, one of the registers changes when attaching the keyboard and you can use that instead. Can you dump the oxpec register map and check if something changes predictably when you plug in the keyboard?

Moreover, I would like to see more devices supported when this patch merges, as a large segment of onexplayer devices are either 2 in 1s or tablets. At least the X1s / X1 minis.

Quoted 45 lines
---
 drivers/platform/x86/Kconfig |   7 ++-
 drivers/platform/x86/oxpec.c | 110 +++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+), 2 deletions(-)
drivers/platform/x86/Kconfig +5 -2
index b54b521..3e30127 100644
@@ -1055,11 +1055,14 @@ config OXP_EC
        depends on ACPI_EC
        depends on ACPI_BATTERY
        depends on HWMON
+       depends on INPUT
+       depends on USB
        depends on X86
        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.
+               handheld devices. This includes fan speed, fan controls, disabling
+               the default TDP behavior of the device, and tablet mode reporting
+               on supported detachable models.
 
 source "drivers/platform/x86/tuxedo/Kconfig"
 
drivers/platform/x86/oxpec.c +2 -0
index 99c0dfc..e64ae54 100644
@@ -18,10 +18,12 @@
 #include <linux/dmi.h>
 #include <linux/hwmon.h>
 #include <linux/init.h>
+#include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/processor.h>
+#include <linux/usb.h>
 #include <acpi/battery.h>
 
 /* Handle ACPI lock mechanism */

drivers/platform/x86/oxpec.c enum oxp_board { · line 63

Quoted 7 lines
drivers/platform/x86/oxpec.c +4 -0
@@ -55,6 +57,14 @@ enum oxp_board {
 static enum oxp_board board;
 static struct device *oxp_dev;
 
+struct oxp_platform_data {
+       struct input_dev *tablet_mode_input;
+       struct notifier_block usb_notifier;
+};

This driver does not use a platform struct for now. If it is revised to do so it will then. Use globals for now instead of defining oxp_platform_data.

drivers/platform/x86/oxpec.c enum oxp_board { · line 67

Quoted 4 lines
drivers/platform/x86/oxpec.c +4 -0
+
+#define OXP_SUPER_X_KEYBOARD_VID       0x1a86
+#define OXP_SUPER_X_KEYBOARD_PID       0x1305
+

Make sure this is the intuitive place for them. If 0x1a86 is a VID used by other onexplayer devices, use a generic name for it. Add the X1 / X1 mini keyboards. Unfortunately, I do not have my X1 with me until the middle of august so I cannot help here.

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 309

Quoted 12 lines
drivers/platform/x86/oxpec.c +5 -0
 /* Fan reading and PWM */
 #define OXP_SENSOR_FAN_REG             0x76 /* Fan reading is 2 registers long */
 #define OXP_2_SENSOR_FAN_REG           0x58 /* Fan reading is 2 registers long */
@@ -292,6 +302,94 @@ static const struct dmi_system_id dmi_table[] = {
        {},
 };
 
+static bool oxp_is_super_x_keyboard(const struct usb_device *udev)
+{
+       return le16_to_cpu(udev->descriptor.idVendor) == OXP_SUPER_X_KEYBOARD_VID &&
+              le16_to_cpu(udev->descriptor.idProduct) == OXP_SUPER_X_KEYBOARD_PID;
+}

Spurious function, inline.

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 317

Quoted 8 lines
drivers/platform/x86/oxpec.c +8 -0
+
+static void oxp_report_keyboard_attached(struct oxp_platform_data *data,
+                                        bool attached)
+{
+       /* SW_TABLET_MODE is set when the detachable keyboard is absent. */
+       input_report_switch(data->tablet_mode_input, SW_TABLET_MODE, !attached);
+       input_sync(data->tablet_mode_input);
+}

Same, inline.

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 327

Quoted 10 lines
drivers/platform/x86/oxpec.c +10 -0
+
+static int oxp_find_super_x_keyboard(struct usb_device *udev, void *data)
+{
+       bool *attached = data;
+
+       if (oxp_is_super_x_keyboard(udev))
+               *attached = true;
+
+       return 0;
+}

Same, inline.

Quoted 19 lines
drivers/platform/x86/oxpec.c +19 -0
+
+static int oxp_usb_notify(struct notifier_block *nb,
+                         unsigned long action, void *notify_data)
+{
+       struct oxp_platform_data *data =
+               container_of(nb, struct oxp_platform_data, usb_notifier);
+       struct usb_device *udev = notify_data;
+
+       if (!oxp_is_super_x_keyboard(udev))
+               return NOTIFY_DONE;
+
+       switch (action) {
+       case USB_DEVICE_ADD:
+               oxp_report_keyboard_attached(data, true);
+               break;
+       case USB_DEVICE_REMOVE:
+               oxp_report_keyboard_attached(data, false);
+               break;
+       default:

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 356

Quoted 10 lines
drivers/platform/x86/oxpec.c +10 -0
+               return NOTIFY_DONE;
+       }
+
+       return NOTIFY_OK;
+}
+
+static void oxp_unregister_usb_notifier(void *notify_block)
+{
+       usb_unregister_notify(notify_block);
+}

The two functions above are the only ones you really need. Inline everything into them.

Quoted 25 lines
drivers/platform/x86/oxpec.c +25 -0
+
+static int oxp_register_super_x_tablet_switch(struct device *dev,
+                                             struct oxp_platform_data *data)
+{
+       bool keyboard_attached = false;
+       struct input_dev *input;
+       int ret;
+
+       input = devm_input_allocate_device(dev);
+       if (!input)
+               return -ENOMEM;
+
+       input->name = "OneXPlayer Super X Tablet Mode Switch";
+       input->phys = "oxp-platform/input0";
+       input->id.bustype = BUS_HOST;
+       input_set_capability(input, EV_SW, SW_TABLET_MODE);
+
+       ret = input_register_device(input);
+       if (ret)
+               return ret;
+
+       data->tablet_mode_input = input;
+       data->usb_notifier.notifier_call = oxp_usb_notify;
+       usb_register_notify(&data->usb_notifier);
+

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 391

Quoted 10 lines
drivers/platform/x86/oxpec.c +10 -0
+       ret = devm_add_action_or_reset(dev, oxp_unregister_usb_notifier,
+                                      &data->usb_notifier);
+       if (ret)
+               return ret;
+
+       usb_for_each_dev(&keyboard_attached, oxp_find_super_x_keyboard);
+       oxp_report_keyboard_attached(data, keyboard_attached);
+
+       return 0;
+}

Inline this function into probe.

drivers/platform/x86/oxpec.c static int oxp_platform_probe(struct platform_device *pdev) · line 1056

Quoted 10 lines
drivers/platform/x86/oxpec.c +3 -0
+
 /* Helper functions to handle EC read/write */
 static int read_from_ec(u8 reg, int size, long *val)
 {
@@ -954,6 +1052,18 @@ static int oxp_platform_probe(struct platform_device *pdev)
                        return ret;
        }
 
+       if (dmi_match(DMI_BOARD_NAME, "ONEXPLAYER SUPER X")) {
+               struct oxp_platform_data *data;

Replace the dmi match with a board switch. Match capable boards (X1, X1 Mini, defer G1 due to its weird layout). If we aliased X1 / X1 Mini board ids with other devices without a folio, create a patch preceding this one where you separate them.

As a hint for the future, GPT models really like to write a lot of unnecessary code and introduce helper functions but this hinders the upstreaming process. Try to work with the model to minimize the diff before submitting (as you saw here, there are many extra function definitions)

Best,
Antheas

Quoted 17 lines
drivers/platform/x86/oxpec.c +10 -1
+
+               data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+               if (!data)
+                       return -ENOMEM;
+
+               ret = oxp_register_super_x_tablet_switch(dev, data);
+               if (ret)
+                       return ret;
+       }
+
        return 0;
 }
 
--

2.55.0

#3 lore raw

PATCH v2 1/2 platform/x86: oxpec: Distinguish OneXPlayer Super X board

In reply to Alexander Egorov

The Super X currently shares the oxp_g1_a board identifier because its existing EC functionality matches the G1 AMD.

Give it a dedicated identifier so model-specific functionality can be selected without also enabling it on the G1. Preserve the existing G1 AMD behavior for the new identifier.

Assisted-by Codex:gpt-5.6
---
 drivers/platform/x86/oxpec.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/platform/x86/oxpec.c +12 -1
index 99c0dfc..df29e41 100644
@@ -50,6 +50,7 @@ enum oxp_board {
 	oxp_x1,
 	oxp_g1_i,
 	oxp_g1_a,
+	oxp_super_x,
 };
 
 static enum oxp_board board;
@@ -210,7 +211,7 @@ static const struct dmi_system_id dmi_table[] = {
 			DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"),
 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONEXPLAYER SUPER X"),
 		},
-		.driver_data = (void *)oxp_g1_a,
+		.driver_data = (void *)oxp_super_x,
 	},
 	{
 		.matches = {
@@ -345,6 +346,7 @@ static umode_t tt_toggle_is_visible(struct kobject *kobj,
 	case oxp_x1:
 	case oxp_g1_i:
 	case oxp_g1_a:
+	case oxp_super_x:
 		return attr->mode;
 	default:
 		break;
@@ -374,6 +376,7 @@ static ssize_t tt_toggle_store(struct device *dev,
 	case oxp_fly:
 	case oxp_mini_amd_pro:
 	case oxp_g1_a:
+	case oxp_super_x:
 		reg = OXP_TURBO_SWITCH_REG;
 		mask = OXP_TURBO_TAKE_VAL;
 		break;
@@ -420,6 +423,7 @@ static ssize_t tt_toggle_show(struct device *dev,
 	case oxp_fly:
 	case oxp_mini_amd_pro:
 	case oxp_g1_a:
+	case oxp_super_x:
 		reg = OXP_TURBO_SWITCH_REG;
 		mask = OXP_TURBO_TAKE_VAL;
 		break;
@@ -516,6 +520,7 @@ static bool oxp_psy_ext_supported(void)
 	case oxp_x1:
 	case oxp_g1_i:
 	case oxp_g1_a:
+	case oxp_super_x:
 	case oxp_fly:
 		return true;
 	default:
@@ -649,6 +654,7 @@ static int oxp_pwm_enable(void)
 	case oxp_x1:
 	case oxp_g1_i:
 	case oxp_g1_a:
+	case oxp_super_x:
 		return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, PWM_MODE_MANUAL);
 	default:
 		return -EINVAL;
@@ -669,6 +675,7 @@ static int oxp_pwm_disable(void)
 	case oxp_x1:
 	case oxp_g1_i:
 	case oxp_g1_a:
+	case oxp_super_x:
 		return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, PWM_MODE_AUTO);
 	default:
 		return -EINVAL;
@@ -689,6 +696,7 @@ static int oxp_pwm_read(long *val)
 	case oxp_x1:
 	case oxp_g1_i:
 	case oxp_g1_a:
+	case oxp_super_x:
 		return read_from_ec(OXP_SENSOR_PWM_ENABLE_REG, 1, val);
 	default:
 		return -EOPNOTSUPP;
@@ -725,6 +733,7 @@ static int oxp_pwm_fan_speed(long *val)
 	case oxp_mini_amd_a07:
 	case oxp_mini_amd_pro:
 	case oxp_g1_a:
+	case oxp_super_x:
 		return read_from_ec(OXP_SENSOR_FAN_REG, 2, val);
 	default:
 		return -EOPNOTSUPP;
@@ -757,6 +766,7 @@ static int oxp_pwm_input_write(long val)
 	case oxp_fly:
 	case oxp_mini_amd_pro:
 	case oxp_g1_a:
+	case oxp_super_x:
 		return write_to_ec(OXP_SENSOR_PWM_REG, val);
 	default:
 		return -EOPNOTSUPP;
@@ -796,6 +806,7 @@ static int oxp_pwm_input_read(long *val)
 	case oxp_fly:
 	case oxp_mini_amd_pro:
 	case oxp_g1_a:
+	case oxp_super_x:
 	default:
 		ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val);
 		if (ret)
Signature · 1 line
2.55.0
#2 lore raw

v2 cover platform/x86: oxpec: Report tablet mode on OneXPlayer detachables

In reply to Alexander Egorov

The OneXPlayer X1 family and Super X do not expose a firmware tablet-mode switch. Add one based on their detachable pogo-pin keyboard devices.

I checked the EC alternative suggested in review. The Super X ACPI EC operation region covers the complete 0x00-0xff register map. I captured 30 maps with the keyboard attached, 30 detached, and 30 reattached. There were no stable attached-detached-reattached changes. The named ACPI fields KBFG and SYSK did not change either. USB hotplug is therefore the only attachment state exposed by this Super X firmware.

The X1 keyboard ID was taken from public hardware information. X1, X1 Pro, and X1 Mini systems show the HAILUCK 258a:001e folio keyboard:

https://wiki.archlinux.org/title/OnexPlayer_X1_A
https://linux-hardware.org/?probe=517a6d5085
https://linux-hardware.org/?probe=98267565ff
https://linux-hardware.org/?probe=21f49ac935

The X1 family is included, but has not been tested by me because I only have the Super X. G1 is deliberately deferred because of its different keyboard layout.

Ilpo, comments on whether oxpec is the right home for this functionality are welcome.

Changes in v2:
- add the requested Assisted-by trailer;
- split Super X from the shared G1 AMD board ID in a preceding patch;
- support the X1 and X1 Mini family using their folio keyboard ID;
- use driver globals and board switches instead of platform data and DMI;
- keep only the USB scan and notifier callbacks, with matching and reporting inlined;
- use generic keyboard vendor names and place the IDs beside their users;
- document the complete EC map comparison.

Alexander Egorov (2):
platform/x86: oxpec: Distinguish OneXPlayer Super X board platform/x86: oxpec: Report tablet mode on OneXPlayer detachables

 drivers/platform/x86/Kconfig |   2 +
 drivers/platform/x86/oxpec.c | 116 ++++++++++++++++++++++++++++++++++-
 2 files changed, 117 insertions(+), 1 deletion(-)
Signature · 1 line
2.55.0
#5 lore raw

PATCH v2 2/2 platform/x86: oxpec: Report tablet mode on OneXPlayer detachables

The OneXPlayer X1 family and Super X have detachable pogo-pin keyboards. The firmware does not expose a tablet-mode input switch.

The Super X keyboard enumerates as 1a86:1305. The X1 family folio keyboard enumerates as 258a:001e.

Register an input device on these boards and report SW_TABLET_MODE from the model-specific pogo keyboard USB hotplug state. Other USB and Bluetooth keyboards do not affect the switch.

A complete dump of the 256-byte Super X EC register map was compared with the keyboard attached, detached, and reattached. No register changed predictably with the attachment state.

Tested on a OneXPlayer Super X. Mutter enables accelerometer-driven display rotation only while the pogo keyboard is absent.

Assisted-by Codex:gpt-5.6
---
 drivers/platform/x86/Kconfig |   2 +
 drivers/platform/x86/oxpec.c | 103 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)
drivers/platform/x86/Kconfig +2 -0
index b54b521..3bcbd49 100644
@@ -1055,6 +1055,8 @@ config OXP_EC
 	depends on ACPI_EC
 	depends on ACPI_BATTERY
 	depends on HWMON
+	depends on INPUT
+	depends on USB
 	depends on X86
 	help
 		Enables support for the platform EC of OneXPlayer and AOKZOE
drivers/platform/x86/oxpec.c +103 -0

143 lines not on this page · raw message

Signature · 1 line
2.55.0
maintainer Reviewed-by on v2 1/2
#4 lore raw

Re: [PATCH v2 1/2] platform/x86: oxpec: Distinguish OneXPlayer Super X board

In reply to Alexander Egorov
Quoted 9 lines · Alexander Egorov

The Super X currently shares the oxp_g1_a board identifier because its existing EC functionality matches the G1 AMD.

Give it a dedicated identifier so model-specific functionality can be selected without also enabling it on the G1. Preserve the existing G1 AMD behavior for the new identifier.

Assisted-by Codex:gpt-5.6
Quoted 110 lines
---
 drivers/platform/x86/oxpec.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/platform/x86/oxpec.c +12 -2
index 99c0dfc..df29e41 100644
@@ -50,6 +50,7 @@ enum oxp_board {
        oxp_x1,
        oxp_g1_i,
        oxp_g1_a,
+       oxp_super_x,
 };
 
 static enum oxp_board board;
@@ -210,7 +211,7 @@ static const struct dmi_system_id dmi_table[] = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"),
                        DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONEXPLAYER SUPER X"),
                },
-               .driver_data = (void *)oxp_g1_a,
+               .driver_data = (void *)oxp_super_x,
        },
        {
                .matches = {
@@ -345,6 +346,7 @@ static umode_t tt_toggle_is_visible(struct kobject *kobj,
        case oxp_x1:
        case oxp_g1_i:
        case oxp_g1_a:
+       case oxp_super_x:
                return attr->mode;
        default:
                break;
@@ -374,6 +376,7 @@ static ssize_t tt_toggle_store(struct device *dev,
        case oxp_fly:
        case oxp_mini_amd_pro:
        case oxp_g1_a:
+       case oxp_super_x:
                reg = OXP_TURBO_SWITCH_REG;
                mask = OXP_TURBO_TAKE_VAL;
                break;
@@ -420,6 +423,7 @@ static ssize_t tt_toggle_show(struct device *dev,
        case oxp_fly:
        case oxp_mini_amd_pro:
        case oxp_g1_a:
+       case oxp_super_x:
                reg = OXP_TURBO_SWITCH_REG;
                mask = OXP_TURBO_TAKE_VAL;
                break;
@@ -516,6 +520,7 @@ static bool oxp_psy_ext_supported(void)
        case oxp_x1:
        case oxp_g1_i:
        case oxp_g1_a:
+       case oxp_super_x:
        case oxp_fly:
                return true;
        default:
@@ -649,6 +654,7 @@ static int oxp_pwm_enable(void)
        case oxp_x1:
        case oxp_g1_i:
        case oxp_g1_a:
+       case oxp_super_x:
                return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, PWM_MODE_MANUAL);
        default:
                return -EINVAL;
@@ -669,6 +675,7 @@ static int oxp_pwm_disable(void)
        case oxp_x1:
        case oxp_g1_i:
        case oxp_g1_a:
+       case oxp_super_x:
                return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, PWM_MODE_AUTO);
        default:
                return -EINVAL;
@@ -689,6 +696,7 @@ static int oxp_pwm_read(long *val)
        case oxp_x1:
        case oxp_g1_i:
        case oxp_g1_a:
+       case oxp_super_x:
                return read_from_ec(OXP_SENSOR_PWM_ENABLE_REG, 1, val);
        default:
                return -EOPNOTSUPP;
@@ -725,6 +733,7 @@ static int oxp_pwm_fan_speed(long *val)
        case oxp_mini_amd_a07:
        case oxp_mini_amd_pro:
        case oxp_g1_a:
+       case oxp_super_x:
                return read_from_ec(OXP_SENSOR_FAN_REG, 2, val);
        default:
                return -EOPNOTSUPP;
@@ -757,6 +766,7 @@ static int oxp_pwm_input_write(long val)
        case oxp_fly:
        case oxp_mini_amd_pro:
        case oxp_g1_a:
+       case oxp_super_x:
                return write_to_ec(OXP_SENSOR_PWM_REG, val);
        default:
                return -EOPNOTSUPP;
@@ -796,6 +806,7 @@ static int oxp_pwm_input_read(long *val)
        case oxp_fly:
        case oxp_mini_amd_pro:
        case oxp_g1_a:
+       case oxp_super_x:
        default:
                ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val);
                if (ret)
--

2.55.0

#6 lore raw

Re: [PATCH v2 2/2] platform/x86: oxpec: Report tablet mode on OneXPlayer detachables

In reply to Alexander Egorov
Quoted 65 lines · Alexander Egorov

The OneXPlayer X1 family and Super X have detachable pogo-pin keyboards. The firmware does not expose a tablet-mode input switch.

The Super X keyboard enumerates as 1a86:1305. The X1 family folio keyboard enumerates as 258a:001e.

Register an input device on these boards and report SW_TABLET_MODE from the model-specific pogo keyboard USB hotplug state. Other USB and Bluetooth keyboards do not affect the switch.

A complete dump of the 256-byte Super X EC register map was compared with the keyboard attached, detached, and reattached. No register changed predictably with the attachment state.

Tested on a OneXPlayer Super X. Mutter enables accelerometer-driven display rotation only while the pogo keyboard is absent.

Assisted-by Codex:gpt-5.6
---
 drivers/platform/x86/Kconfig |   2 +
 drivers/platform/x86/oxpec.c | 103 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)
drivers/platform/x86/Kconfig +2 -0
index b54b521..3bcbd49 100644
@@ -1055,6 +1055,8 @@ config OXP_EC
        depends on ACPI_EC
        depends on ACPI_BATTERY
        depends on HWMON
+       depends on INPUT
+       depends on USB
        depends on X86
        help
                Enables support for the platform EC of OneXPlayer and AOKZOE
drivers/platform/x86/oxpec.c +4 -0
index df29e41..5c07a35 100644
@@ -18,10 +18,12 @@
 #include <linux/dmi.h>
 #include <linux/hwmon.h>
 #include <linux/init.h>
+#include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/processor.h>
+#include <linux/usb.h>
 #include <acpi/battery.h>
 
 /* Handle ACPI lock mechanism */
@@ -55,6 +57,8 @@ enum oxp_board {
 
 static enum oxp_board board;
 static struct device *oxp_dev;
+static struct input_dev *oxp_tablet_mode_input;
+static struct notifier_block oxp_usb_notifier;
 
 /* Fan reading and PWM */
 #define OXP_SENSOR_FAN_REG             0x76 /* Fan reading is 2 registers long */

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 303

Quoted 7 lines
drivers/platform/x86/oxpec.c +4 -0
@@ -293,6 +297,74 @@ static const struct dmi_system_id dmi_table[] = {
        {},
 };
 
+#define OXP_KEYBOARD_VID_QINHENG       0x1a86
+#define OXP_KEYBOARD_PID_K2445         0x1305
+#define OXP_KEYBOARD_VID_HAILUCK       0x258a
+#define OXP_KEYBOARD_PID_HAILUCK       0x001e

These defines need to go above with the other defines.

Can you explain the reasoning behind the name PID_K2445 and PID_HAILUCK?

Quoted 110 lines
drivers/platform/x86/oxpec.c +92 -0
+
+static int oxp_find_keyboard(struct usb_device *udev, void *data)
+{
+       bool *keyboard_attached = data;
+       u16 vid = le16_to_cpu(udev->descriptor.idVendor);
+       u16 pid = le16_to_cpu(udev->descriptor.idProduct);
+
+       switch (board) {
+       case oxp_x1:
+               if (vid == OXP_KEYBOARD_VID_HAILUCK &&
+                   pid == OXP_KEYBOARD_PID_HAILUCK)
+                       *keyboard_attached = true;
+               break;
+       case oxp_super_x:
+               if (vid == OXP_KEYBOARD_VID_QINHENG &&
+                   pid == OXP_KEYBOARD_PID_K2445)
+                       *keyboard_attached = true;
+               break;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+static int oxp_usb_notify(struct notifier_block *nb,
+                         unsigned long action, void *data)
+{
+       struct usb_device *udev = data;
+       u16 vid = le16_to_cpu(udev->descriptor.idVendor);
+       u16 pid = le16_to_cpu(udev->descriptor.idProduct);
+       bool keyboard = false;
+
+       switch (board) {
+       case oxp_x1:
+               keyboard = vid == OXP_KEYBOARD_VID_HAILUCK &&
+                          pid == OXP_KEYBOARD_PID_HAILUCK;
+               break;
+       case oxp_super_x:
+               keyboard = vid == OXP_KEYBOARD_VID_QINHENG &&
+                          pid == OXP_KEYBOARD_PID_K2445;
+               break;
+       default:
+               break;
+       }
+
+       if (!keyboard)
+               return NOTIFY_DONE;
+
+       switch (action) {
+       case USB_DEVICE_ADD:
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE, false);
+               break;
+       case USB_DEVICE_REMOVE:
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE, true);
+               break;
+       default:
+               return NOTIFY_DONE;
+       }
+
+       input_sync(oxp_tablet_mode_input);
+       return NOTIFY_OK;
+}
+
 /* Helper functions to handle EC read/write */
 static int read_from_ec(u8 reg, int size, long *val)
 {
@@ -948,6 +1020,7 @@ static const struct hwmon_chip_info oxp_ec_chip_info = {
 /* Initialization logic */
 static int oxp_platform_probe(struct platform_device *pdev)
 {
+       bool keyboard_attached = false;
        struct device *dev = &pdev->dev;
        struct device *hwdev;
        int ret;
@@ -965,6 +1038,33 @@ static int oxp_platform_probe(struct platform_device *pdev)
                        return ret;
        }
 
+       switch (board) {
+       case oxp_x1:
+       case oxp_super_x:
+               oxp_tablet_mode_input = devm_input_allocate_device(dev);
+               if (!oxp_tablet_mode_input)
+                       return -ENOMEM;
+
+               oxp_tablet_mode_input->name = "OneXPlayer Tablet Mode Switch";
+               oxp_tablet_mode_input->phys = "oxp-platform/input0";
+               oxp_tablet_mode_input->id.bustype = BUS_HOST;
+               input_set_capability(oxp_tablet_mode_input, EV_SW, SW_TABLET_MODE);
+
+               ret = input_register_device(oxp_tablet_mode_input);
+               if (ret)
+                       return ret;
+
+               oxp_usb_notifier.notifier_call = oxp_usb_notify;
+               usb_register_notify(&oxp_usb_notifier);
+               usb_for_each_dev(&keyboard_attached, oxp_find_keyboard);
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE,
+                                   !keyboard_attached);
+               input_sync(oxp_tablet_mode_input);
+               break;
+       default:
+               break;
+       }
+
        return 0;
 }
 

drivers/platform/x86/oxpec.c static int __init oxp_platform_init(void) · line 1109

Quoted 5 lines
drivers/platform/x86/oxpec.c +2 -0
@@ -1005,6 +1105,9 @@ static int __init oxp_platform_init(void)
 
 static void __exit oxp_platform_exit(void)
 {
+       if (board == oxp_x1 || board == oxp_super_x)
+               usb_unregister_notify(&oxp_usb_notifier);

You used a switch statement above. Match the logic and use a switch statement here too.

Give it a few days before sending a V3 for Ilpo to reply.

@Ilpo do you think this is an acceptable expansion for the EC driver?

The rest of the patch looks fine to me.

Best,
Antheas

Quoted 8 lines
drivers/platform/x86/oxpec.c +1 -1
+
        platform_device_unregister(oxp_platform_device);
        platform_driver_unregister(&oxp_platform_driver);
 }
--

2.55.0

maintainer
#7 lore raw

Re: [PATCH v2 2/2] platform/x86: oxpec: Report tablet mode on OneXPlayer detachables

Quoted 111 lines · Antheas Kapenekakis
Quoted 65 lines · Alexander Egorov

The OneXPlayer X1 family and Super X have detachable pogo-pin keyboards. The firmware does not expose a tablet-mode input switch.

The Super X keyboard enumerates as 1a86:1305. The X1 family folio keyboard enumerates as 258a:001e.

Register an input device on these boards and report SW_TABLET_MODE from the model-specific pogo keyboard USB hotplug state. Other USB and Bluetooth keyboards do not affect the switch.

A complete dump of the 256-byte Super X EC register map was compared with the keyboard attached, detached, and reattached. No register changed predictably with the attachment state.

Tested on a OneXPlayer Super X. Mutter enables accelerometer-driven display rotation only while the pogo keyboard is absent.

Assisted-by Codex:gpt-5.6
---
 drivers/platform/x86/Kconfig |   2 +
 drivers/platform/x86/oxpec.c | 103 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)
drivers/platform/x86/Kconfig +2 -0
index b54b521..3bcbd49 100644
@@ -1055,6 +1055,8 @@ config OXP_EC
        depends on ACPI_EC
        depends on ACPI_BATTERY
        depends on HWMON
+       depends on INPUT
+       depends on USB
        depends on X86
        help
                Enables support for the platform EC of OneXPlayer and AOKZOE
drivers/platform/x86/oxpec.c +4 -0
index df29e41..5c07a35 100644
@@ -18,10 +18,12 @@
 #include <linux/dmi.h>
 #include <linux/hwmon.h>
 #include <linux/init.h>
+#include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/processor.h>
+#include <linux/usb.h>
 #include <acpi/battery.h>
 
 /* Handle ACPI lock mechanism */
@@ -55,6 +57,8 @@ enum oxp_board {
 
 static enum oxp_board board;
 static struct device *oxp_dev;
+static struct input_dev *oxp_tablet_mode_input;
+static struct notifier_block oxp_usb_notifier;
 
 /* Fan reading and PWM */
 #define OXP_SENSOR_FAN_REG             0x76 /* Fan reading is 2 registers long */

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 303

Quoted 7 lines
drivers/platform/x86/oxpec.c +4 -0
@@ -293,6 +297,74 @@ static const struct dmi_system_id dmi_table[] = {
        {},
 };
 
+#define OXP_KEYBOARD_VID_QINHENG       0x1a86
+#define OXP_KEYBOARD_PID_K2445         0x1305
+#define OXP_KEYBOARD_VID_HAILUCK       0x258a
+#define OXP_KEYBOARD_PID_HAILUCK       0x001e

These defines need to go above with the other defines.

Can you explain the reasoning behind the name PID_K2445 and PID_HAILUCK?

Quoted 33 lines
drivers/platform/x86/oxpec.c +33 -0
+
+static int oxp_find_keyboard(struct usb_device *udev, void *data)
+{
+       bool *keyboard_attached = data;
+       u16 vid = le16_to_cpu(udev->descriptor.idVendor);
+       u16 pid = le16_to_cpu(udev->descriptor.idProduct);
+
+       switch (board) {
+       case oxp_x1:
+               if (vid == OXP_KEYBOARD_VID_HAILUCK &&
+                   pid == OXP_KEYBOARD_PID_HAILUCK)
+                       *keyboard_attached = true;
+               break;
+       case oxp_super_x:
+               if (vid == OXP_KEYBOARD_VID_QINHENG &&
+                   pid == OXP_KEYBOARD_PID_K2445)
+                       *keyboard_attached = true;
+               break;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+static int oxp_usb_notify(struct notifier_block *nb,
+                         unsigned long action, void *data)
+{
+       struct usb_device *udev = data;
+       u16 vid = le16_to_cpu(udev->descriptor.idVendor);
+       u16 pid = le16_to_cpu(udev->descriptor.idProduct);
+       bool keyboard = false;
+
Quoted 8 lines

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 344

Quoted 8 lines
drivers/platform/x86/oxpec.c +8 -0
+       switch (board) {
+       case oxp_x1:
+               keyboard = vid == OXP_KEYBOARD_VID_HAILUCK &&
+                          pid == OXP_KEYBOARD_PID_HAILUCK;
+               break;
+       case oxp_super_x:
+               keyboard = vid == OXP_KEYBOARD_VID_QINHENG &&
+                          pid == OXP_KEYBOARD_PID_K2445;

Why are you doing these manually instead of constructing proper usb id table, etc.?

Quoted 70 lines
Quoted 70 lines
drivers/platform/x86/oxpec.c +51 -0
+               break;
+       default:
+               break;
+       }
+
+       if (!keyboard)
+               return NOTIFY_DONE;
+
+       switch (action) {
+       case USB_DEVICE_ADD:
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE, false);
+               break;
+       case USB_DEVICE_REMOVE:
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE, true);
+               break;
+       default:
+               return NOTIFY_DONE;
+       }
+
+       input_sync(oxp_tablet_mode_input);
+       return NOTIFY_OK;
+}
+
 /* Helper functions to handle EC read/write */
 static int read_from_ec(u8 reg, int size, long *val)
 {
@@ -948,6 +1020,7 @@ static const struct hwmon_chip_info oxp_ec_chip_info = {
 /* Initialization logic */
 static int oxp_platform_probe(struct platform_device *pdev)
 {
+       bool keyboard_attached = false;
        struct device *dev = &pdev->dev;
        struct device *hwdev;
        int ret;
@@ -965,6 +1038,33 @@ static int oxp_platform_probe(struct platform_device *pdev)
                        return ret;
        }
 
+       switch (board) {
+       case oxp_x1:
+       case oxp_super_x:
+               oxp_tablet_mode_input = devm_input_allocate_device(dev);
+               if (!oxp_tablet_mode_input)
+                       return -ENOMEM;
+
+               oxp_tablet_mode_input->name = "OneXPlayer Tablet Mode Switch";
+               oxp_tablet_mode_input->phys = "oxp-platform/input0";
+               oxp_tablet_mode_input->id.bustype = BUS_HOST;
+               input_set_capability(oxp_tablet_mode_input, EV_SW, SW_TABLET_MODE);
+
+               ret = input_register_device(oxp_tablet_mode_input);
+               if (ret)
+                       return ret;
+
+               oxp_usb_notifier.notifier_call = oxp_usb_notify;
+               usb_register_notify(&oxp_usb_notifier);
+               usb_for_each_dev(&keyboard_attached, oxp_find_keyboard);
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE,
+                                   !keyboard_attached);
+               input_sync(oxp_tablet_mode_input);
+               break;
+       default:
+               break;
+       }
+
        return 0;
 }
 
@@ -1005,6 +1105,9 @@ static int __init oxp_platform_init(void)
 
Quoted 7 lines

drivers/platform/x86/oxpec.c static int __init oxp_platform_init(void) · line 1109

Quoted 4 lines
drivers/platform/x86/oxpec.c +2 -0
 static void __exit oxp_platform_exit(void)
 {
+       if (board == oxp_x1 || board == oxp_super_x)
+               usb_unregister_notify(&oxp_usb_notifier);

You used a switch statement above. Match the logic and use a switch statement here too.

Yes, definitely.

Quoted 3 lines

Give it a few days before sending a V3 for Ilpo to reply.

@Ilpo do you think this is an acceptable expansion for the EC driver?

Often platform drivers start with a one feature, and may even be very specifically named after that feature, but then more platform stuff gets added.

(Even our mailing list now bears "x86" in its name despite the scope of platform drivers having expanded also to non-x86 platforms.)

Signature · 1 line
 i.
Quoted 14 lines

The rest of the patch looks fine to me.

Best,
Antheas

Quoted 8 lines
drivers/platform/x86/oxpec.c +1 -1
+
        platform_device_unregister(oxp_platform_device);
        platform_driver_unregister(&oxp_platform_driver);
 }
--

2.55.0

#8 lore raw

Re: [PATCH v2 2/2] platform/x86: oxpec: Report tablet mode on OneXPlayer detachables

Quoted 208 lines · Ilpo Järvinen
Quoted 111 lines · Antheas Kapenekakis
Quoted 65 lines · Alexander Egorov

The OneXPlayer X1 family and Super X have detachable pogo-pin keyboards. The firmware does not expose a tablet-mode input switch.

The Super X keyboard enumerates as 1a86:1305. The X1 family folio keyboard enumerates as 258a:001e.

Register an input device on these boards and report SW_TABLET_MODE from the model-specific pogo keyboard USB hotplug state. Other USB and Bluetooth keyboards do not affect the switch.

A complete dump of the 256-byte Super X EC register map was compared with the keyboard attached, detached, and reattached. No register changed predictably with the attachment state.

Tested on a OneXPlayer Super X. Mutter enables accelerometer-driven display rotation only while the pogo keyboard is absent.

Assisted-by Codex:gpt-5.6
---
 drivers/platform/x86/Kconfig |   2 +
 drivers/platform/x86/oxpec.c | 103 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)
drivers/platform/x86/Kconfig +2 -0
index b54b521..3bcbd49 100644
@@ -1055,6 +1055,8 @@ config OXP_EC
        depends on ACPI_EC
        depends on ACPI_BATTERY
        depends on HWMON
+       depends on INPUT
+       depends on USB
        depends on X86
        help
                Enables support for the platform EC of OneXPlayer and AOKZOE
drivers/platform/x86/oxpec.c +4 -0
index df29e41..5c07a35 100644
@@ -18,10 +18,12 @@
 #include <linux/dmi.h>
 #include <linux/hwmon.h>
 #include <linux/init.h>
+#include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/processor.h>
+#include <linux/usb.h>
 #include <acpi/battery.h>
 
 /* Handle ACPI lock mechanism */
@@ -55,6 +57,8 @@ enum oxp_board {
 
 static enum oxp_board board;
 static struct device *oxp_dev;
+static struct input_dev *oxp_tablet_mode_input;
+static struct notifier_block oxp_usb_notifier;
 
 /* Fan reading and PWM */
 #define OXP_SENSOR_FAN_REG             0x76 /* Fan reading is 2 registers long */

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 303

Quoted 7 lines
drivers/platform/x86/oxpec.c +4 -0
@@ -293,6 +297,74 @@ static const struct dmi_system_id dmi_table[] = {
        {},
 };
 
+#define OXP_KEYBOARD_VID_QINHENG       0x1a86
+#define OXP_KEYBOARD_PID_K2445         0x1305
+#define OXP_KEYBOARD_VID_HAILUCK       0x258a
+#define OXP_KEYBOARD_PID_HAILUCK       0x001e

These defines need to go above with the other defines.

Can you explain the reasoning behind the name PID_K2445 and PID_HAILUCK?

Quoted 33 lines
drivers/platform/x86/oxpec.c +33 -0
+
+static int oxp_find_keyboard(struct usb_device *udev, void *data)
+{
+       bool *keyboard_attached = data;
+       u16 vid = le16_to_cpu(udev->descriptor.idVendor);
+       u16 pid = le16_to_cpu(udev->descriptor.idProduct);
+
+       switch (board) {
+       case oxp_x1:
+               if (vid == OXP_KEYBOARD_VID_HAILUCK &&
+                   pid == OXP_KEYBOARD_PID_HAILUCK)
+                       *keyboard_attached = true;
+               break;
+       case oxp_super_x:
+               if (vid == OXP_KEYBOARD_VID_QINHENG &&
+                   pid == OXP_KEYBOARD_PID_K2445)
+                       *keyboard_attached = true;
+               break;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+static int oxp_usb_notify(struct notifier_block *nb,
+                         unsigned long action, void *data)
+{
+       struct usb_device *udev = data;
+       u16 vid = le16_to_cpu(udev->descriptor.idVendor);
+       u16 pid = le16_to_cpu(udev->descriptor.idProduct);
+       bool keyboard = false;
+
Quoted 8 lines

drivers/platform/x86/oxpec.c static const struct dmi_system_id dmi_table[] = { · line 344

Quoted 8 lines
drivers/platform/x86/oxpec.c +8 -0
+       switch (board) {
+       case oxp_x1:
+               keyboard = vid == OXP_KEYBOARD_VID_HAILUCK &&
+                          pid == OXP_KEYBOARD_PID_HAILUCK;
+               break;
+       case oxp_super_x:
+               keyboard = vid == OXP_KEYBOARD_VID_QINHENG &&
+                          pid == OXP_KEYBOARD_PID_K2445;

Why are you doing these manually instead of constructing proper usb id table, etc.?

Quoted 70 lines
Quoted 70 lines
drivers/platform/x86/oxpec.c +51 -0
+               break;
+       default:
+               break;
+       }
+
+       if (!keyboard)
+               return NOTIFY_DONE;
+
+       switch (action) {
+       case USB_DEVICE_ADD:
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE, false);
+               break;
+       case USB_DEVICE_REMOVE:
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE, true);
+               break;
+       default:
+               return NOTIFY_DONE;
+       }
+
+       input_sync(oxp_tablet_mode_input);
+       return NOTIFY_OK;
+}
+
 /* Helper functions to handle EC read/write */
 static int read_from_ec(u8 reg, int size, long *val)
 {
@@ -948,6 +1020,7 @@ static const struct hwmon_chip_info oxp_ec_chip_info = {
 /* Initialization logic */
 static int oxp_platform_probe(struct platform_device *pdev)
 {
+       bool keyboard_attached = false;
        struct device *dev = &pdev->dev;
        struct device *hwdev;
        int ret;
@@ -965,6 +1038,33 @@ static int oxp_platform_probe(struct platform_device *pdev)
                        return ret;
        }
 
+       switch (board) {
+       case oxp_x1:
+       case oxp_super_x:
+               oxp_tablet_mode_input = devm_input_allocate_device(dev);
+               if (!oxp_tablet_mode_input)
+                       return -ENOMEM;
+
+               oxp_tablet_mode_input->name = "OneXPlayer Tablet Mode Switch";
+               oxp_tablet_mode_input->phys = "oxp-platform/input0";
+               oxp_tablet_mode_input->id.bustype = BUS_HOST;
+               input_set_capability(oxp_tablet_mode_input, EV_SW, SW_TABLET_MODE);
+
+               ret = input_register_device(oxp_tablet_mode_input);
+               if (ret)
+                       return ret;
+
+               oxp_usb_notifier.notifier_call = oxp_usb_notify;
+               usb_register_notify(&oxp_usb_notifier);
+               usb_for_each_dev(&keyboard_attached, oxp_find_keyboard);
+               input_report_switch(oxp_tablet_mode_input, SW_TABLET_MODE,
+                                   !keyboard_attached);
+               input_sync(oxp_tablet_mode_input);
+               break;
+       default:
+               break;
+       }
+
        return 0;
 }
 
@@ -1005,6 +1105,9 @@ static int __init oxp_platform_init(void)
 
Quoted 7 lines

drivers/platform/x86/oxpec.c static int __init oxp_platform_init(void) · line 1109

Quoted 4 lines
drivers/platform/x86/oxpec.c +2 -0
 static void __exit oxp_platform_exit(void)
 {
+       if (board == oxp_x1 || board == oxp_super_x)
+               usb_unregister_notify(&oxp_usb_notifier);

You used a switch statement above. Match the logic and use a switch statement here too.

Yes, definitely.

Quoted 2 lines

Give it a few days before sending a V3 for Ilpo to reply.

Quoted 8 lines
Quoted 1 line

@Ilpo do you think this is an acceptable expansion for the EC driver?

Often platform drivers start with a one feature, and may even be very specifically named after that feature, but then more platform stuff gets added.

(Even our mailing list now bears "x86" in its name despite the scope of platform drivers having expanded also to non-x86 platforms.)

I am waiting for feedback from a user with an X2Mini Pro and I should be able to test on an X1 this week.

Then I will do another feedback round so we should be able to unblock this.

Antheas

Quoted 19 lines

--
i.

Quoted 14 lines

The rest of the patch looks fine to me.

Best,
Antheas

Quoted 8 lines
drivers/platform/x86/oxpec.c +1 -1
+
        platform_device_unregister(oxp_platform_device);
        platform_driver_unregister(&oxp_platform_driver);
 }
--

2.55.0