[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <83226476-8b23-4a11-a100-d01049f6eef2@roeck-us.net>
Date: Tue, 30 Jul 2024 08:27:42 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Heiko Stuebner <heiko@...ech.de>
Cc: lee@...nel.org, jdelvare@...e.com, dmitry.torokhov@...il.com,
pavel@....cz, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, ukleinek@...ian.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-hwmon@...r.kernel.org,
linux-input@...r.kernel.org, linux-leds@...r.kernel.org
Subject: Re: [PATCH v2 5/7] hwmon: add driver for the hwmon parts of qnap-mcu
devices
On Sun, Jul 28, 2024 at 11:17:49PM +0200, Heiko Stuebner wrote:
> The MCU can be found on network-attached-storage devices made by QNAP
> and provides access to fan control including reading back its RPM as
> well as reading the temperature of the NAS case.
>
> Signed-off-by: Heiko Stuebner <heiko@...ech.de>
Minor comment inline, in case you resend, otherwise
Acked-by: Guenter Roeck <linux@...ck-us.net>
> +static int qnap_mcu_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
> + u32 attr, int channel, long val)
> +{
> + struct qnap_mcu_hwmon *hwm = dev_get_drvdata(dev);
> +
> + switch (attr) {
> + case hwmon_pwm_input:
> + if (val < 0 || val > 255)
> + return -EINVAL;
> +
> + if (val < hwm->pwm_min)
> + val = hwm->pwm_min;
> +
> + if (val > hwm->pwm_max)
> + val = hwm->pwm_max;
> +
val = clamp_val(val, hwm->pwm_min, hwm->pwm_max);
Guenter
Powered by blists - more mailing lists