diff options
| author | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
| commit | 1ac731c529cd4d6adbce134754b51ff7d822b145 (patch) | |
| tree | 143ab3f35ca5f3b69f583c84e6964b17139c2ec1 /drivers/hwmon/pwm-fan.c | |
| parent | 07b4c950f27bef0362dc6ad7ee713aab61d58149 (diff) | |
| parent | 54116d442e001e1b6bd482122043b1870998a1f3 (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.6 merge window.
Diffstat (limited to 'drivers/hwmon/pwm-fan.c')
| -rw-r--r-- | drivers/hwmon/pwm-fan.c | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 83a347ca35da..6e4516c2ab89 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -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"); @@ -508,6 +508,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  	 * frequency.  |