SM8550: Add rsinput axis-range override, fixes RP6 joystick range.

This commit is contained in:
rocknix
2026-02-24 06:09:00 +00:00
parent 8c71f9525b
commit fe9901655e
2 changed files with 21 additions and 1 deletions

View File

@@ -127,6 +127,10 @@
};
};
&gamepad {
axis-range = <1024>;
};
&mdss_dsi0 {
vdda-supply = <&vreg_l3e_1p2>;
status = "okay";

View File

@@ -42,7 +42,7 @@ new file mode 100644
index 000000000000..913c499ad30a
--- /dev/null
+++ b/drivers/input/joystick/rsinput.c
@@ -0,0 +1,563 @@
@@ -0,0 +1,578 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * RSInput Gamepad Driver
@@ -464,6 +464,22 @@ index 000000000000..913c499ad30a
+ drv->invert_rx = device_property_present(&serdev->dev, "invert-rx");
+ drv->invert_ry = device_property_present(&serdev->dev, "invert-ry");
+
+ {
+ u32 range;
+ if (!device_property_read_u32(&serdev->dev, "axis-range", &range)) {
+ axis_leftx_min = -range;
+ axis_leftx_max = range;
+ axis_lefty_min = -range;
+ axis_lefty_max = range;
+ axis_rightx_min = -range;
+ axis_rightx_max = range;
+ axis_righty_min = -range;
+ axis_righty_max = range;
+
+ dev_info(&serdev->dev, "DT axis-range override applied: ±%u\n", range);
+ }
+ }
+
+ drv->vdd = devm_regulator_get(&serdev->dev, "vdd");
+ if (IS_ERR(drv->vdd)) {
+ error = PTR_ERR(drv->vdd);