Re: [PATCH] hwmon: Add Razer PWM PC Fan Controller driver

From: Guenter Roeck

Date: Sat Dec 05 2026 - 14:37:13 EST


On Sat, Dec 05, 2026 at 01:13:36PM -0600, Victor Chernyakin wrote:
> This is a USB fan controller (VID 0x1532, PID 0x0F3C) that supports
> up to 8 connected fans. The driver exposes their RPM readings and allows
> setting their PWM duty cycles.
>
> The controller can report which of its ports actually have fans connected,
> and whether those fans are 3-wire or 4-wire. The driver uses this
> information to limit the exposed sysfs attributes to meaningful ones.
>
> Although the controller supports hotplugging fans (it can generate an event
> when this happens), I've chosen to not implement this in the driver,
> because it seems like a big headache (manually tracking and dynamically
> adding/removing all those sysfs files) for little gain (is anyone actually
> hotplugging their fans?). Instead the driver just queries which fans are
> present once at startup and goes with that.
>
> Signed-off-by: Victor Chernyakin <chernyakin.victor.j@xxxxxxxxxxx>
> ---
>
> I've included two nonstandard sysfs files that expose the controller's
> firmware version and serial number. I know the contributing guidelines
> discourage nonstandard attributes, but this seems like a reasonable use,
> for this kind of extra info? If not I can remove them.
>

Please use debugfs for such attributes.

> Tested by manually poking sysfs attributes, and in CoolerControl.

Not an actual review, but this is what checkpatch reports.

CHECK: Please use a blank line after function/struct/union/enum declarations
#404: FILE: drivers/hwmon/razer_pwm_pc_fan_controller.c:103:
+};
+static_assert(sizeof(struct razer_pwm_report) == 90);

--> Add empty line

WARNING: msleep < 20ms can sleep for up to 20ms; see function description of msleep().
#451: FILE: drivers/hwmon/razer_pwm_pc_fan_controller.c:150:
+ msleep(10); /* Synapse seems to use approximately this delay. */

--> Use fsleep().

Let's wait and see what Sashiko has to say.

Thanks,
Guenter