Re: [PATCH 2/5] HID: hid-lenovo-go: fix the FPS mode DPI request
From: Derek John Clark
Date: Tue Aug 25 2026 - 16:30:24 EST
On Fri, Aug 21, 2026 at 2:48 PM Aditya Dash <mradityadash@xxxxxxxxx> wrote:
>
> mcu_property_out() adds the five-byte request header used by most
> configuration commands. For FPS mode DPI writes, this inserts a device byte
> before the four-byte DPI value.
>
> The FPS mode DPI request does not contain a device byte. Its little-endian
> DPI value starts immediately after the command and sub-command.
>
> Use the four-byte header only for FPS mode DPI writes. Keep the common
> header for all other requests.
>
> Fixes: f0bedee60607 ("HID: hid-lenovo-go: Add FPS Mode DPI settings")
> Assisted-by: Pi:gpt-5.6-sol
> Signed-off-by: Aditya Dash <mradityadash@xxxxxxxxx>
> ---
> The corrected FPS mode DPI write was not tested on hardware.
>
> drivers/hid/hid-lenovo-go.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/hid/hid-lenovo-go.c b/drivers/hid/hid-lenovo-go.c
> index b8248bf8965c..a6e9a130ad41 100644
> --- a/drivers/hid/hid-lenovo-go.c
> +++ b/drivers/hid/hid-lenovo-go.c
> @@ -725,6 +725,11 @@ static int mcu_property_out(struct hid_device *hdev, u8 id, u8 command,
> int timeout = 50;
> int ret;
>
> + /* The FPS mode DPI request does not contain a device byte. */
> + if (id == MCU_CONFIG_DATA && command == SET_DPI_CFG &&
> + index == FPS_MODE_DPI)
> + header_size--;
> +
While testing this I go some strange results.
(deck@lego2pro device)$ echo 1800 | sudo tee fps_mode_dpi
1800
tee: fps_mode_dpi: Input/output error
(1)(deck@lego2pro device)$ cat fps_mode_dpi
500
(deck@lego2pro device)$ echo 1200 | sudo tee fps_mode_dpi
1200
(deck@lego2pro device)$ cat fps_mode_dpi
1800
(deck@lego2pro device)$ echo 1200 | sudo tee fps_mode_dpi
1200
(deck@lego2pro device)$ cat fps_mode_dpi
1800
(deck@lego2pro device)$ echo 800 | sudo tee fps_mode_dpi
800
(deck@lego2pro device)$ echo 500 | sudo tee fps_mode_dpi
500
(deck@lego2pro device)$ cat fps_mode_dpi
500
compared to current:
(deck@lego2pro device)$ echo 1800 | sudo tee fps_mode_dpi
1800
(deck@lego2pro device)$ cat fps_mode_dpi
1800
(deck@lego2pro device)$ echo 1200 | sudo tee fps_mode_dpi
1200
(deck@lego2pro device)$ cat fps_mode_dpi
1200
(deck@lego2pro device)$ echo 800 | sudo tee fps_mode_dpi
800
(deck@lego2pro device)$ cat fps_mode_dpi
800
(deck@lego2pro device)$ echo 500 | sudo tee fps_mode_dpi
500
(deck@lego2pro device)$ cat fps_mode_dpi
500
Thanks,
Derek
> if (header_size + len > GO_PACKET_SIZE)
> return -EINVAL;
>
> --
> 2.55.0
>