Any how to for applying the 3705 fan?

Can someone advice how to make the fan work on manjaro linux kernel 5.3.0-1 ? Tried using it but fan never started. It just starts for few seconds when I power on the device and then nothing when using the OS.

Please advice.

I have no experience with Manjaro, but this might help?

It’s standard running on auto mode and should only be activated when the fan is needed to cool the device

1 Like

Thanks for the reply but this is when the fan module is present in the kernel.
Maybe someone from the Khadas team can advice or @hyphop Please advice how to make fan work on Manjaro Linux.

linux mainline kernel don’t have fan driver
but we still can use fan via simple i2c

next one can works without any kernel support via i2c and no need extra deps

Thanks for the reply.
Tried this but getting an error
i2c device not found b 0x18 0x88

what is missing here?

vim3 mainline kernel have poor dtb and lost some definitions

u can fix it just add i2c3 definition to dts files

check my dts for vim3

1 Like

Thank You.
I plan to add this as patch to the existing Amlogic kernel and try it with your fan receipt.

Also is there something similar for Vim1 V14 ?
Please advice so I can add both the patches to 1 build and test it.

Made a patch with your i2c3 definition and copied it to the boot and used your khadas-util but still getting the same error

‘I2c device not found by 0x18 0x88’

plz check my mainline kernel >
u can get just dtb file for vim3

reboot with new dtb and check i2c support

$ ls /dev/i2c-?
/dev/i2c-0  /dev/i2c-1  /dev/i2c-2
$ find /sys/firmware/devicetree -name "i2c@*"
$ zcat /proc/config.gz  | grep I2C_MESON
$ i2cdetect -l
1 Like

These are all present.

I have these.

This shows a list with 1d000, 1f000, 1c000, 1e000

Yes its there in kernel.

I see 2 Meson I2C adapter and 1 DesignWare HDMI.

I will share the same logs later, just ran this quickly to respond to you with my finding.

Still I am getting the same error. I will try to use your dtb and check it
Edit : tried your dtb and its still the same. I am using VIm3 pro.

Here are the screenshots


Spikerguy’s DTB used with i2c3 definition patch.

@hyphop Please advice.

!!! plz try to use my dtb ! becouse u lost one i2c node !!!

plz check my info

root@Tone:/#  grep "" /sys/devices/soc0/*
/sys/devices/soc0/family:Amlogic Meson
/sys/devices/soc0/machine:Khadas VIM3
/sys/devices/soc0/revision:29:b - 10:2
/sys/devices/soc0/soc_id:G12B (A311D)
root@Tone:/# uname -a
Linux Tone 5.3.0-rc6 #1 SMP PREEMPT Tue Oct 15 16:27:18 MSK 2019 aarch64 GNU/Linux
root@Tone:/# i2cdetect -y -a 0 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 0e -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: UU -- 22 -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 

or i2cdetect -y -a 1 or i2cdetect -y -a 2

!!! u must find 18 is mcu with fan !!!

if u dont have it u used wrong dtb


root@Tone:/# fan 1
[i] set FUN SPEED: 1
root@Tone:/# fan 2
[i] set FUN SPEED: 2
root@Tone:/# fan off
[i] set FUN SPEED: 0
1 Like

I used your dtb only from the link I shared above. By using that dtb the i2c node was lost, but when I use the one I compiled it shows all 3 nodes.

I will try again and check.

Update: It worked on my dtb. Great. Works like a charm. Nice fan codes. @hyphop. I have this pkg ready for arch/manjaro with your fan script and have added the i2c3 definition patch in the dtb from next built onwards. And will put fan bg default in autostart.

Update 2: the script works with mainline dtb also without the i2c3 definition patch.

Update 3: worked fine with vim1 v14 but only on manual mode. Bg cannot get temp.

We can redistribute your script right?

Vim 1 mainline lost thermal sensor node in dtb but u can make it )))

Can you share the codes needs for thermal sensor node? Or should I use the same i2c3 definition from vim3?

We tested fan script in systemd using fan bg but it fails. So we tried fan monitor and it works fine. We have made arch/manjaro pkg and it will be installed by default in the next built. Can you advice why fan bg doesnt work as systemd service?

User can install khadas-utils using pacman -S khadas-utils and start the service and enable in on boot.


  • fan monitor - start in foreground ( suitable for systemd )
  • fan bg - same monitor but start in background (not for systemd becouse need fan as foreground process)
1 Like

Hi @hyphop Hyphop,
I have tried to patched this i2c3 definition in Mainline Kernel 5.6-rc1 but it doesnt seem to work after compiling.
I have CONFIG_I2C_MESON=y already.

patch is applied to this already have #include <dt-bindings/gpio/meson-g12a-gpio.h> binding.

What else is required?

Please advice. Thanks.

plz show more info ==> like there Any how to for applying the 3705 fan?

i will try to check 5.6.x kernel soon (what new in this version ??? )! may be dts definitions changed ?
I still stay on 5.4.5 which works fine ( - build script )

1 Like

Wifi seems to work fine and we like to use Mainline for most of the Device we support at Manjaro Linux, as it is easier to Maintain 1 Kernel package for all the devices.
Other than Wifi we have stable HW Accel with LLVMPile using mesa-git without the need of fbturbo. We also have GLES qt versions which can be utilised for Desktop Accel.

Here is the outputs on 5.6-Rc1

ls /dev/i2c-? 
Cannot find anything with i2c*
$ zcat /proc/config.gz  | grep I2C_MESON
$ fan 1
i2c devs not found

When I move back to Kernel 5.3.0 it works fine. All I have patched in 5.6-rc1 is the dtsi file only.

Patch I tried

 .../boot/dts/amlogic/meson-khadas-vim3.dtsi     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
index 124a80901084..63f3cfe8d067 100644
--- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
@@ -364,4 +364,10 @@ &usb {
	status = "okay";
	dr_mode = "peripheral";
+    pinctrl-0 = <&i2c3_sck_a_pins>, <&i2c3_sda_a_pins>;
+    clock-frequency = <100000>; /* default 100k */
+    pinctrl-names = "default";
+    status = "okay";

i2c3_sda_a_pins & i2c3_sck_a_pins are defined in here.

Now I am not sure what else is missing. Please check when you have time.