mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-04 06:53:30 +01:00
feat(raspberry-pi): Temperature thresholds for fan speed of PoE HAT can now be configured
This commit is contained in:
1 parent
41c6b421bd
commit
cbbc29c7f3
2 files changed
+114
-16
No files matched your search
@@ -7,6 +7,55 @@ in
|
|||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".poe-hat = {
|
raspberry-pi."4".poe-hat = {
|
||||||
enable = lib.mkEnableOption "support for the Raspberry Pi POE Hat";
|
enable = lib.mkEnableOption "support for the Raspberry Pi POE Hat";
|
||||||
|
fan = lib.mkOption {
|
||||||
|
type = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
temperature0 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 40000;
|
||||||
|
description = "Temperature threshold 0.";
|
||||||
|
};
|
||||||
|
hysteresis0 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2000;
|
||||||
|
description = "Temperature hysteresis 0.";
|
||||||
|
};
|
||||||
|
temperature1 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 45000;
|
||||||
|
description = "Temperature threshold 1.";
|
||||||
|
};
|
||||||
|
hysteresis1 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2000;
|
||||||
|
description = "Temperature hysteresis 1.";
|
||||||
|
};
|
||||||
|
temperature2 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 50000;
|
||||||
|
description = "Temperature threshold 2.";
|
||||||
|
};
|
||||||
|
hysteresis2 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2000;
|
||||||
|
description = "Temperature hysteresis 2.";
|
||||||
|
};
|
||||||
|
temperature3 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 55000;
|
||||||
|
description = "Temperature threshold 3.";
|
||||||
|
};
|
||||||
|
hysteresis3 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 5000;
|
||||||
|
description = "Temperature hysteresis 3.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
default = { };
|
||||||
|
description = "Fan configuration.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -53,23 +102,23 @@ in
|
|||||||
target = <&thermal_trips>;
|
target = <&thermal_trips>;
|
||||||
__overlay__ {
|
__overlay__ {
|
||||||
trip0: trip0 {
|
trip0: trip0 {
|
||||||
temperature = <40000>;
|
temperature = <${cfg.fan.temperature0}>;
|
||||||
hysteresis = <2000>;
|
hysteresis = <${cfg.fan.hysteresis0}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
trip1: trip1 {
|
trip1: trip1 {
|
||||||
temperature = <45000>;
|
temperature = <${cfg.fan.temperature1}>;
|
||||||
hysteresis = <2000>;
|
hysteresis = <${cfg.fan.hysteresis1}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
trip2: trip2 {
|
trip2: trip2 {
|
||||||
temperature = <50000>;
|
temperature = <${cfg.fan.temperature2}>;
|
||||||
hysteresis = <2000>;
|
hysteresis = <${cfg.fan.hysteresis2}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
trip3: trip3 {
|
trip3: trip3 {
|
||||||
temperature = <55000>;
|
temperature = <${cfg.fan.temperature3}>;
|
||||||
hysteresis = <5000>;
|
hysteresis = <${cfg.fan.hysteresis3}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,6 +7,55 @@ in
|
|||||||
options.hardware = {
|
options.hardware = {
|
||||||
raspberry-pi."4".poe-plus-hat = {
|
raspberry-pi."4".poe-plus-hat = {
|
||||||
enable = lib.mkEnableOption "support for the Raspberry Pi PoE+ HAT";
|
enable = lib.mkEnableOption "support for the Raspberry Pi PoE+ HAT";
|
||||||
|
fan = lib.mkOption {
|
||||||
|
type = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
temperature0 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 40000;
|
||||||
|
description = "Temperature threshold 0.";
|
||||||
|
};
|
||||||
|
hysteresis0 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2000;
|
||||||
|
description = "Temperature hysteresis 0.";
|
||||||
|
};
|
||||||
|
temperature1 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 45000;
|
||||||
|
description = "Temperature threshold 1.";
|
||||||
|
};
|
||||||
|
hysteresis1 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2000;
|
||||||
|
description = "Temperature hysteresis 1.";
|
||||||
|
};
|
||||||
|
temperature2 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 50000;
|
||||||
|
description = "Temperature threshold 2.";
|
||||||
|
};
|
||||||
|
hysteresis2 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 2000;
|
||||||
|
description = "Temperature hysteresis 2.";
|
||||||
|
};
|
||||||
|
temperature3 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 55000;
|
||||||
|
description = "Temperature threshold 3.";
|
||||||
|
};
|
||||||
|
hysteresis3 = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 5000;
|
||||||
|
description = "Temperature hysteresis 3.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
default = { };
|
||||||
|
description = "Fan configuration.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -55,23 +104,23 @@ in
|
|||||||
target = <&thermal_trips>;
|
target = <&thermal_trips>;
|
||||||
__overlay__ {
|
__overlay__ {
|
||||||
trip0: trip0 {
|
trip0: trip0 {
|
||||||
temperature = <40000>;
|
temperature = <${cfg.fan.temperature0}>;
|
||||||
hysteresis = <2000>;
|
hysteresis = <${cfg.fan.hysteresis0}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
trip1: trip1 {
|
trip1: trip1 {
|
||||||
temperature = <45000>;
|
temperature = <${cfg.fan.temperature1}>;
|
||||||
hysteresis = <2000>;
|
hysteresis = <${cfg.fan.hysteresis1}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
trip2: trip2 {
|
trip2: trip2 {
|
||||||
temperature = <50000>;
|
temperature = <${cfg.fan.temperature2}>;
|
||||||
hysteresis = <2000>;
|
hysteresis = <${cfg.fan.hysteresis2}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
trip3: trip3 {
|
trip3: trip3 {
|
||||||
temperature = <55000>;
|
temperature = <${cfg.fan.temperature3}>;
|
||||||
hysteresis = <5000>;
|
hysteresis = <${cfg.fan.hysteresis3}>;
|
||||||
type = "active";
|
type = "active";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user