mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-23 03:19:42 +01:00
hardkernel/odroid-hc4: fix fancontrol on 5.15 kernel
Source for the fancontrol config mentions that one of the lines should be deleted for the 5.15 kernel. Fixes #616. Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
7dc4630467
commit
adab6fd8e9
1 changed files with 9 additions and 3 deletions
|
@ -1,22 +1,28 @@
|
||||||
{ lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Based on the config from https://www.armbian.com/odroid-hc4/
|
# Based on the config from https://www.armbian.com/odroid-hc4/
|
||||||
hardware.fancontrol = {
|
hardware.fancontrol = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
config = lib.mkDefault ''
|
config = let
|
||||||
|
# According to https://www.armbian.com/odroid-hc4/ the FCFANS line should be removed on kernel 5.15.
|
||||||
|
kernelVersion = config.boot.kernelPackages.kernel.version;
|
||||||
|
needFcFans = lib.versions.majorMinor kernelVersion != "5.15";
|
||||||
|
in lib.mkDefault (''
|
||||||
INTERVAL=10
|
INTERVAL=10
|
||||||
DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon2=devices/platform/pwm-fan
|
DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon2=devices/platform/pwm-fan
|
||||||
DEVNAME=hwmon0=cpu_thermal hwmon2=pwmfan
|
DEVNAME=hwmon0=cpu_thermal hwmon2=pwmfan
|
||||||
FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input
|
FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input
|
||||||
|
'' + lib.optionalString needFcFans ''
|
||||||
FCFANS= hwmon2/pwm1=hwmon2/fan1_input
|
FCFANS= hwmon2/pwm1=hwmon2/fan1_input
|
||||||
|
'' + ''
|
||||||
MINTEMP=hwmon2/pwm1=50
|
MINTEMP=hwmon2/pwm1=50
|
||||||
MAXTEMP=hwmon2/pwm1=60
|
MAXTEMP=hwmon2/pwm1=60
|
||||||
MINSTART=hwmon2/pwm1=20
|
MINSTART=hwmon2/pwm1=20
|
||||||
MINSTOP=hwmon2/pwm1=28
|
MINSTOP=hwmon2/pwm1=28
|
||||||
MINPWM=hwmon2/pwm1=0
|
MINPWM=hwmon2/pwm1=0
|
||||||
MAXPWM=hwmon2/pwm1=255
|
MAXPWM=hwmon2/pwm1=255
|
||||||
'';
|
'');
|
||||||
};
|
};
|
||||||
|
|
||||||
# Linux 5.15 sometimes crash under heavy network usage
|
# Linux 5.15 sometimes crash under heavy network usage
|
||||||
|
|
Loading…
Reference in a new issue