From: Guenter Roeck <linux@roeck-us.net>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (nct7904) Strenghten detect function
Date: Sat, 28 Feb 2015 02:05:51 +0000 [thread overview]
Message-ID: <54F1227F.4050906@roeck-us.net> (raw)
In-Reply-To: <1425054979-27598-1-git-send-email-linux@roeck-us.net>
On 02/27/2015 02:05 PM, Jean Delvare wrote:
> On Fri, 27 Feb 2015 08:36:19 -0800, Guenter Roeck wrote:
>> The bank register has five unused bits. Verify that those bits are zero
>> to strenghten the detect function.
>>
>> Cc: Vadim V. Vlasov <vvlasov@dev.rtsoft.ru>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>> Vadim, it would be great if you can confirm that/if this works.
>> If yes, I'll use the same code in sensors-detect.
>>
>> Thanks,
>> Guenter
>>
>> drivers/hwmon/nct7904.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
>> index eaa8234..b77b82f 100644
>> --- a/drivers/hwmon/nct7904.c
>> +++ b/drivers/hwmon/nct7904.c
>> @@ -502,7 +502,8 @@ static int nct7904_detect(struct i2c_client *client,
>> /* Determine the chip type. */
>> if (i2c_smbus_read_byte_data(client, VENDOR_ID_REG) != NUVOTON_ID ||
>> i2c_smbus_read_byte_data(client, CHIP_ID_REG) != NCT7904_ID ||
>> - (i2c_smbus_read_byte_data(client, DEVICE_ID_REG) & 0xf0) != 0x50)
>> + (i2c_smbus_read_byte_data(client, DEVICE_ID_REG) & 0xf0) != 0x50 ||
>> + (i2c_smbus_read_byte_data(client, BANK_SEL_REG) & 0xf8) != 0x00)
>> return -ENODEV;
>>
>> strlcpy(info->type, "nct7904", I2C_NAME_SIZE);
>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>
Thanks a lot!
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2015-02-28 2:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 16:36 [lm-sensors] [PATCH] hwmon: (nct7904) Strenghten detect function Guenter Roeck
2015-02-27 17:27 ` Vadim V. Vlasov
2015-02-27 21:30 ` Guenter Roeck
2015-02-27 22:05 ` Jean Delvare
2015-02-28 2:05 ` 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=54F1227F.4050906@roeck-us.net \
--to=linux@roeck-us.net \
--cc=lm-sensors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.