linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Amy.Shih@advantech.com.tw
Cc: she90122@gmail.com, oakley.ding@advantech.com.tw,
	bichan.lu@advantech.com.tw, Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [v1,1/1] hwmon: (nct7904) Fix incorrect SMI status register setting of LTD temperature and fan.
Date: Thu, 12 Sep 2019 11:53:10 -0700	[thread overview]
Message-ID: <20190912185310.GA6349@roeck-us.net> (raw)
In-Reply-To: <20190912113300.4714-1-Amy.Shih@advantech.com.tw>

On Thu, Sep 12, 2019 at 11:33:00AM +0000, Amy.Shih@advantech.com.tw wrote:
> From: "amy.shih" <amy.shih@advantech.com.tw>
> 
> According to datasheet, the SMI status register setting of LTD
> temperature is SMI_STS3, and the SMI status register setting
> of fan is SMI_STS5 and SMI_STS6.
> 
> Signed-off-by: amy.shih <amy.shih@advantech.com.tw>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/nct7904.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
> index ce688ab4fce2..95b447cfa24c 100644
> --- a/drivers/hwmon/nct7904.c
> +++ b/drivers/hwmon/nct7904.c
> @@ -51,6 +51,7 @@
>  #define VSEN1_HV_HL_REG		0x00	/* Bank 1; 2 regs (HV/LV) per sensor */
>  #define VSEN1_LV_HL_REG		0x01	/* Bank 1; 2 regs (HV/LV) per sensor */
>  #define SMI_STS1_REG		0xC1	/* Bank 0; SMI Status Register */
> +#define SMI_STS3_REG		0xC3	/* Bank 0; SMI Status Register */
>  #define SMI_STS5_REG		0xC5	/* Bank 0; SMI Status Register */
>  #define SMI_STS7_REG		0xC7	/* Bank 0; SMI Status Register */
>  #define SMI_STS8_REG		0xC8	/* Bank 0; SMI Status Register */
> @@ -210,7 +211,7 @@ static int nct7904_read_fan(struct device *dev, u32 attr, int channel,
>  		return 0;
>  	case hwmon_fan_alarm:
>  		ret = nct7904_read_reg(data, BANK_0,
> -				       SMI_STS7_REG + (channel >> 3));
> +				       SMI_STS5_REG + (channel >> 3));
>  		if (ret < 0)
>  			return ret;
>  		*val = (ret >> (channel & 0x07)) & 1;
> @@ -351,7 +352,13 @@ static int nct7904_read_temp(struct device *dev, u32 attr, int channel,
>  		*val = sign_extend32(temp, 10) * 125;
>  		return 0;
>  	case hwmon_temp_alarm:
> -		if (channel < 5) {
> +		if (channel == 4) {
> +			ret = nct7904_read_reg(data, BANK_0,
> +					       SMI_STS3_REG);
> +			if (ret < 0)
> +				return ret;
> +			*val = (ret >> 1) & 1;
> +		} else if (channel < 4) {
>  			ret = nct7904_read_reg(data, BANK_0,
>  					       SMI_STS1_REG);
>  			if (ret < 0)

      reply	other threads:[~2019-09-12 18:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 11:33 [v1,1/1] hwmon: (nct7904) Fix incorrect SMI status register setting of LTD temperature and fan Amy.Shih
2019-09-12 18:53 ` 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=20190912185310.GA6349@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Amy.Shih@advantech.com.tw \
    --cc=bichan.lu@advantech.com.tw \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakley.ding@advantech.com.tw \
    --cc=she90122@gmail.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;
as well as URLs for NNTP newsgroup(s).