[PATCH v4] arm64: dts: meson: add gpio-fan control to GS-King-X

Neil Armstrong narmstrong at baylibre.com
Mon Jun 13 01:18:47 PDT 2022


On 11/06/2022 19:08, Furkan Kardame wrote:
> GS-King-X has a single speed GPIO fan which is always-on by default.
> If we add controls for the fan and a trip point,
> the fan stays off most of the time, reducing background
> noise from the unit.
> 
> Signed-off-by: Furkan Kardame <f.kardame at manjaro.org>
> ---
> Changelog:
> V1:
> * Using tabs instead of space.
> 
> V2:
> * Remove unused map.
> 
> V3:
> * Fixed speed-map indentation
> * Aligned brackets
> * Changed cooling-device
> * Increased temperature to 70°C
> 
> V4:
> * Fixed syntax error.
>   .../boot/dts/amlogic/meson-g12b-gsking-x.dts  | 25 +++++++++++++++++++
>   1 file changed, 25 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts
> index 6c7bfacba..23592ae21 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts
> @@ -20,6 +20,14 @@ aliases {
>   		rtc1 = &vrtc;
>   	};
>   
> +	gpio_fan: gpio-fan {
> +		compatible = "gpio-fan";
> +		gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
> +		/* Using Dummy Speed */
> +		gpio-fan,speed-map = <0 0>, <1 1>;
> +		#cooling-cells = <2>;
> +	};
> +
>   	gpio-keys-polled {
>   		compatible = "gpio-keys-polled";
>   		#address-cells = <1>;
> @@ -96,6 +104,23 @@ &clkc_audio {
>   	status = "okay";
>   };
>   
> +&cpu_thermal {
> +	trips {
> +		cpu_active: cpu-active {
> +			temperature = <70000>; /* millicelsius */
> +			hysteresis = <2000>; /* millicelsius */
> +			type = "active";
> +		};
> +	};
> +
> +	cooling-maps {
> +		map {
> +			trip = <&cpu_active>;
> +			cooling-device = <&gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +		};
> +	};
> +};
> +
>   &frddr_a {
>   	status = "okay";
>   };

Reviewed-by: Neil Armstrong <narmstrong at baylibre.com>



More information about the linux-amlogic mailing list