]> Git Repo - J-linux.git/blobdiff - drivers/hwmon/pwm-fan.c
Merge tag 'amd-drm-next-6.5-2023-06-09' of https://gitlab.freedesktop.org/agd5f/linux...
[J-linux.git] / drivers / hwmon / pwm-fan.c
index 83a347ca35da5c5299f351a5e70165600a5d8405..6e4516c2ab894f4a10195af076e532bb8ba1093a 100644 (file)
@@ -427,7 +427,7 @@ static int pwm_fan_of_get_cooling_data(struct device *dev,
        struct device_node *np = dev->of_node;
        int num, i, ret;
 
-       if (!of_find_property(np, "cooling-levels", NULL))
+       if (!of_property_present(np, "cooling-levels"))
                return 0;
 
        ret = of_property_count_u32_elems(np, "cooling-levels");
@@ -507,6 +507,14 @@ static int pwm_fan_probe(struct platform_device *pdev)
 
        pwm_init_state(ctx->pwm, &ctx->pwm_state);
 
+       /*
+        * PWM fans are controlled solely by the duty cycle of the PWM signal,
+        * they do not care about the exact timing. Thus set usage_power to true
+        * to allow less flexible hardware to work as a PWM source for fan
+        * control.
+        */
+       ctx->pwm_state.usage_power = true;
+
        /*
         * set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned
         * long. Check this here to prevent the fan running at a too low
This page took 0.026624 seconds and 4 git commands to generate.