> ## Documentation Index
> Fetch the complete documentation index at: https://me.miltonials.com/llms.txt
> Use this file to discover all available pages before exploring further.

# A patch in the Linux kernel

> How I tracked down a mouse that refused to report clicks and landed a HID quirk upstream in the Linux kernel.

One of the contributions I'm proudest of is small enough to fit in six lines — but it's in the **Linux kernel**, which still feels a little unreal to type.

## The problem

I had an **ADATA XPG wireless gaming mouse** that, on Linux, would simply stop reporting input events. The hardware worked, the dongle enumerated, but the cursor would freeze and clicks would get dropped. A lot of gaming mice do this: they go quiet when idle and never wake the HID layer back up.

## The fix

The kernel already has a mechanism for exactly this class of misbehaving devices — `HID_QUIRK_ALWAYS_POLL`, which forces the driver to keep polling the device so it never falls silent. The device just needed to be told to use it.

My patch does two things:

* **`drivers/hid/hid-ids.h`** — defines the USB vendor and device IDs for the ADATA XPG mouse and its dongle (vendor `0x125f`, devices `0x7505` and `0x7506`).
* **`drivers/hid/hid-quirks.c`** — registers `HID_QUIRK_ALWAYS_POLL` for both the mouse and the dongle.

Six lines added, zero removed. Without the quirk, the device doesn't generate input events properly; with it, the mouse just works.

## What I learned

The hard part wasn't the code — it was the process. Reading the HID subsystem, confirming the IDs with `lsusb`, writing a commit message the maintainers would accept, and sending it the right way. The patch was reviewed and merged by **Jiri Kosina**, the HID subsystem maintainer.

<Card title="View the commit" icon="github" href="https://github.com/torvalds/linux/commit/fa9fdeea1b7d6440c22efa6d59a769eae8bc89f1">
  `HID: quirks: Add ADATA XPG alpha wireless mouse support` — in Linus Torvalds' tree.
</Card>

It taught me that "contributing to the kernel" isn't reserved for a special class of people. Sometimes it's just noticing that your own hardware is broken and being stubborn enough to fix it for everyone.
