Re: [PATCH v1 1/1] platform/x86: asus-wmi: add support for vivobook fan profiles

From: Ilpo Järvinen
Date: Thu Apr 18 2024 - 14:50:21 EST


On Thu, 18 Apr 2024, Mohamed Ghanmi wrote:

> Add support for vivobook fan profiles wmi call on the ASUS VIVOBOOK
> to adjust power limits.
>
> These fan profiles have a different device id than the ROG series
> and different order. This reorders the existing modes and adds a new
> full speed mode available on these laptops.
>
> As part of keeping the patch clean the throttle_thermal_policy_available
> boolean stored in the driver struct is removed and
> throttle_thermal_policy_dev is used in place (as on init it is zeroed).
>
> Signed-off-by: Mohamed Ghanmi <mohamed.ghanmi@xxxxxxxxx>
> Co-developed-by: Luke D. Jones <luke@xxxxxxxxxx>
> Signed-off-by: Luke D. Jones <luke@xxxxxxxxxx>
> ---

> @@ -3618,38 +3623,38 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus)
> }
>
> /* Throttle thermal policy ****************************************************/
> -
> -static int throttle_thermal_policy_check_present(struct asus_wmi *asus)
> +static u8 throttle_thermal_policy_max_mode(struct asus_wmi *asus)
> {
> - u32 result;
> - int err;
> -
> - asus->throttle_thermal_policy_available = false;
> -
> - err = asus_wmi_get_devstate(asus,
> - ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY,
> - &result);
> - if (err) {
> - if (err == -ENODEV)
> - return 0;
> - return err;
> + if (asus->throttle_thermal_policy_dev == ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY_VIVO) {
> + return ASUS_THROTTLE_THERMAL_POLICY_FULLSPEED;
> + } else {
> + return ASUS_THROTTLE_THERMAL_POLICY_SILENT;
> }

Thanks for the update, braces are unnecessary here. Other than that, this
looks fine:

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

(This was not v1 any more, although the v1 was sent not by you but
Luke).


--
i.