mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Xing Tong Wu <xingtong_wu@163.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	xingtong.wu@siemens.com, tobias.schaffner@siemens.com,
	gerd.haeussler.ext@siemens.com
Subject: Re: [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode
Date: Tue, 21 Nov 2023 07:59:53 -0800	[thread overview]
Message-ID: <f7deda1b-7c47-44b3-9e9f-21300cf43bb4@roeck-us.net> (raw)
In-Reply-To: <20231121081604.2499-3-xingtong_wu@163.com>

On Tue, Nov 21, 2023 at 04:16:04PM +0800, Xing Tong Wu wrote:
> From: Xing Tong Wu <xingtong.wu@siemens.com>
> 
> Setting the fan speed is only valid in manual mode; it is not possible
> to set the fan's speed in automatic mode.
> Return error when attempting to set the fan speed in automatic mode.
> 
> Signed-off-by: Xing Tong Wu <xingtong.wu@siemens.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/nct6775-core.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index 88300fb99bb9..83f1da5acd22 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -2553,6 +2553,13 @@ store_pwm(struct device *dev, struct device_attribute *attr, const char *buf,
>  	int err;
>  	u16 reg;
>  
> +	/*
> +	 * The fan control mode should be set to manual if the user wants to adjust
> +	 * the fan speed. Otherwise, it will fail to set.
> +	 */
> +	if (index == 0 && data->pwm_enable[nr] > manual)
> +		return -EBUSY;
> +
>  	err = kstrtoul(buf, 10, &val);
>  	if (err < 0)
>  		return err;

      reply	other threads:[~2023-11-21 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  8:16 [PATCH v3 0/2] hwmon: (nct6775) Fix pwm bugs for NCT chips Xing Tong Wu
2023-11-21  8:16 ` [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls Xing Tong Wu
2023-11-21 15:59   ` Guenter Roeck
2023-11-21  8:16 ` [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode Xing Tong Wu
2023-11-21 15:59   ` Guenter Roeck [this message]

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=f7deda1b-7c47-44b3-9e9f-21300cf43bb4@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gerd.haeussler.ext@siemens.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tobias.schaffner@siemens.com \
    --cc=xingtong.wu@siemens.com \
    --cc=xingtong_wu@163.com \
    /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

all inboxes | Powered by JetHome®