Re: [PATCH 3/3] pwm: argon-fan-hat: Add Argon40 Fan HAT support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/11/25 7:55 AM, Uwe Kleine-König wrote:
Hello Marek,

Hi,

I wonder how this device works in rpios, I didn't find a matching driver
(but I also didn't try more than two minutes).

The installation guide is here, download the PDF:

https://argon40.com/blogs/argon-resources/argon-fan-hat-installation-guide

Which leads to this script, which you download on the RPI and (better not without reading it first and understanding it) run:

https://download.argon40.com/argonfanhat.sh

Which downloads more scripts, installs systemd services which run other scripts, but ultimately this convoluted scripting leads to a single register write for this fan.

On Wed, Jun 11, 2025 at 12:07:27AM +0200, Marek Vasut wrote:
diff --git a/drivers/pwm/pwm-argon-fan-hat.c b/drivers/pwm/pwm-argon-fan-hat.c
new file mode 100644
index 000000000000..3d04abdbd349
--- /dev/null
+++ b/drivers/pwm/pwm-argon-fan-hat.c
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Marek Vasut
+ */

  * Limitations:
  * - fixed period (which?)
  * - no support for offset/polarity

If you can find out if it completes a period when reconfigured that
would also be nice to document.

This device is really trivial, but for completeness' sake: If there is a
data sheet publicly available, please add a link here.

There is nuvoton MS51FB9AE microcontroller on the underside of the board, which I think does the I2C communication and PWM generation. The firmware source does not seem available.

I can see some signal on the FAN itself, it is horribly noisy, but with sufficient filtering I can see they change the PWM period, from some 0 Hz to 120 kHz , with duty cycle being some 10% (but I might be wrong, the signal is not great).


+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/pwm.h>
+
+static int argon_fan_hat_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
+				   const struct pwm_state *state)

Can you please implement the new-style callbacks?

Sure

[...]

+static const struct pwm_ops argon_fan_hat_pwm_ops = {
+	.apply = argon_fan_hat_pwm_apply,

Can you read back the configuration? If yes then please implement
.read_waveform().

Nope, reading from the I2C device stops the fan.

Rest is fixed in V2, thanks.

--
Best regards,
Marek Vasut




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux