From: Guenter Roeck <linux@roeck-us.net>
To: Heiko Stuebner <heiko@sntech.de>
Cc: lee@kernel.org, jdelvare@suse.com, dmitry.torokhov@gmail.com,
pavel@ucw.cz, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, ukleinek@debian.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-hwmon@vger.kernel.org,
linux-input@vger.kernel.org, linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 5/7] hwmon: add driver for the hwmon parts of qnap-mcu devices
Date: Tue, 30 Jul 2024 08:27:42 -0700 [thread overview]
Message-ID: <83226476-8b23-4a11-a100-d01049f6eef2@roeck-us.net> (raw)
In-Reply-To: <20240728211751.2160123-6-heiko@sntech.de>
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@sntech.de>
Minor comment inline, in case you resend, otherwise
Acked-by: Guenter Roeck <linux@roeck-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
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2024-07-30 15:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-28 21:17 [PATCH v2 0/7] Drivers to support the MCU on QNAP NAS devices Heiko Stuebner
2024-07-28 21:17 ` [PATCH v2 1/7] dt-bindings: mfd: add binding for qnap,ts433-mcu devices Heiko Stuebner
2024-07-28 21:17 ` [PATCH v2 2/7] mfd: add base driver for qnap-mcu devices Heiko Stuebner
2024-07-28 21:17 ` [PATCH v2 3/7] leds: add driver for LEDs from " Heiko Stuebner
2024-07-29 6:24 ` Florian Eckert
2024-07-29 7:48 ` Heiko Stübner
2024-07-28 21:17 ` [PATCH v2 4/7] Input: add driver for the input part of " Heiko Stuebner
2024-07-29 0:12 ` Dmitry Torokhov
2024-07-28 21:17 ` [PATCH v2 5/7] hwmon: add driver for the hwmon parts " Heiko Stuebner
2024-07-30 15:27 ` Guenter Roeck [this message]
2024-07-28 21:17 ` [PATCH v2 6/7] arm64: dts: rockchip: hook up the MCU on the QNAP TS433 Heiko Stuebner
2024-07-28 21:17 ` [PATCH v2 7/7] arm64: dts: rockchip: set hdd led labels on qnap-ts433 Heiko Stuebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83226476-8b23-4a11-a100-d01049f6eef2@roeck-us.net \
--to=linux@roeck-us.net \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=heiko@sntech.de \
--cc=jdelvare@suse.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=pavel@ucw.cz \
--cc=robh@kernel.org \
--cc=ukleinek@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox