Skip to content

raspberry-pi-4: add gpio-fan overlay#1826

Open
matiasyocca wants to merge 1 commit into
NixOS:masterfrom
matiasyocca:feature/raspberry-pi-4-gpio-fan
Open

raspberry-pi-4: add gpio-fan overlay#1826
matiasyocca wants to merge 1 commit into
NixOS:masterfrom
matiasyocca:feature/raspberry-pi-4-gpio-fan

Conversation

@matiasyocca
Copy link
Copy Markdown

Description of changes

Adds support for some PWM GPIO fans in a similar way to the official gpio-fan overlay. Tested with Argon Mini Fan.

Here's the instruction manual for the fan for reference: https://malnapc.hu/custom/malnapc/image/data/docs/RS/A700000007741984.pdf

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

@matiasyocca matiasyocca force-pushed the feature/raspberry-pi-4-gpio-fan branch 3 times, most recently from 069f82d to 2b80dc8 Compare April 11, 2026 19:06
Adds support for some PWM GPIO fans in a similar way to the
official `gpio-fan` overlay. Tested with Argon Mini Fan.
@matiasyocca matiasyocca force-pushed the feature/raspberry-pi-4-gpio-fan branch from 2b80dc8 to 0db5d00 Compare April 11, 2026 21:16
@doronbehar
Copy link
Copy Markdown
Contributor

@JamieMagee do you think you could test this PR?

@JamieMagee
Copy link
Copy Markdown
Member

@JamieMagee do you think you could test this PR?

I don't own this exact fan, but comparing with the upstream gpio-fan-overlay.dts the only changes are:

  1. Compatibility changed from "brcm,bcm2835" (All Raspberry Pis) to "brcm,bcm2711" (Raspberry Pi 4+)
  2. GPIO pin changed from 12 to 18

I assume both of these are due to the fixed pins on this fan only working with the exact layout of the Raspberry Pi 4, and forcing pin 18. In that regard, this looks correct.

I think I'd like to try and land a generic hardware.raspberry-pi.overlays mechanism that consumes the upstream .dtbos with their __overrides__ parameters. With that, this overlay would already be supported by gpio-fan.dtbo and we'd avoid the duplication.

But I don't know how long that would take, so I'm not opposed to this PR. I'd maybe just make it clearer that the defaults are for the Argon case fan, and not something like the official Raspberry Pi 4 fan


pin = lib.mkOption {
type = lib.types.int;
default = 18;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matiasyocca Maybe it'd be more correct to specify 12? Or 14 maybe? Here's what I saw here:

Image

{
options.hardware = {
raspberry-pi."4".gpio-fan = {
enable = lib.mkEnableOption "support for Raspberry Pi style gpio-fan control";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

Suggested change
enable = lib.mkEnableOption "support for Raspberry Pi style gpio-fan control";
enable = lib.mkEnableOption "support for [Raspberry Pi gpio-fan](https://www.raspberrypi.com/products/raspberry-pi-4-case-fan/) control";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants