All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Per Dalén" <per.dalen@appeartv.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] MAX6642 chip detection and other stuff
Date: Wed, 01 Jun 2011 07:42:59 +0000	[thread overview]
Message-ID: <4DE5ED83.9080702@appeartv.com> (raw)
In-Reply-To: <20110528045113.GA8833@ericsson.com>

[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]

Hi,

Thanks for finding this error. I have attached the patch you requested.

BR
Per

On 05/28/2011 06:51 AM, Guenter Roeck wrote:
> Hi all,
> 
> I finally got MAX6642 samples, so I am able to play around with the chip.
> 
> The attached patch (on top of Per's most recent patch) works quite nicely.
> Per, maybe you can just merge it with your patch and resubmit it.
> 
> While testing the chip, I found another little problem: the fault attribute is named
> temp_fault. That will have to be renamed to temp2_fault, first because it reflects
> a fault with the external diode and second to match the ABI. We will need a separate
> patch to fix this problem.
> 
> Here is the output of i2cdump for the MAX6642 (with open/unconnected external sensor).
> 
> root@groeck-desktop:/home/groeck# i2cdump -y 5 0x48
> No size specified (using byte-data access)
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
> 00: 18 ff 84 10 10 46 46 78 78 78 78 78 78 78 78 78    ?.???FFxxxxxxxxx
> 10: c0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    ?@@@@@@@@@@@@@@@
> 20: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 30: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 40: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 50: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 60: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 70: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 80: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> 90: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> a0: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> b0: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> c0: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> d0: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> e0: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40    @@@@@@@@@@@@@@@@
> f0: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 4d 4d    @@@@@@@@@@@@@@MM
> root@groeck-desktop:/home/groeck# modprobe max6642
> root@groeck-desktop:/home/groeck# sensors
> max6642-i2c-5-48
> Adapter: i2c-devantech-iss at bus 001 device 007
> temp1:        +24.0°C  (high = +70.0°C)
> temp2:          FAULT  (high = +120.0°C)
> 
> Thanks,
> Guenter


[-- Attachment #2: 0001-hwmon-max6642-wrong-temp_fault.patch --]
[-- Type: text/plain, Size: 1475 bytes --]

BUG: The temp_fault is wrong, it should be temp2_fault insteedd. 

Guenter: "While testing the chip, I found another little problem: the fault attribute is named temp_fault. That will have to be renamed to temp2_fault, first because it reflects a fault with the external diode and second to match the ABI."
Thanks Guenter for finding the bug.


Signed-off-by: Per Dalen <per.dalen@appeartv.com>
---
diff --git a/drivers/hwmon/max6642.c b/drivers/hwmon/max6642.c
index 0f9fc40..0f30e1b 100644
--- a/drivers/hwmon/max6642.c
+++ b/drivers/hwmon/max6642.c
@@ -246,7 +246,7 @@ static SENSOR_DEVICE_ATTR_2(temp1_max, S_IWUSR | S_IRUGO, show_temp_max,
 			    set_temp_max, 0, MAX6642_REG_W_LOCAL_HIGH);
 static SENSOR_DEVICE_ATTR_2(temp2_max, S_IWUSR | S_IRUGO, show_temp_max,
 			    set_temp_max, 1, MAX6642_REG_W_REMOTE_HIGH);
-static SENSOR_DEVICE_ATTR(temp_fault, S_IRUGO, show_alarm, NULL, 2);
+static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_alarm, NULL, 2);
 static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 6);
 static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, show_alarm, NULL, 4);
 
@@ -256,7 +256,7 @@ static struct attribute *max6642_attributes[] = {
 	&sensor_dev_attr_temp1_max.dev_attr.attr,
 	&sensor_dev_attr_temp2_max.dev_attr.attr,
 
-	&sensor_dev_attr_temp_fault.dev_attr.attr,
+	&sensor_dev_attr_temp2_fault.dev_attr.attr,
 	&sensor_dev_attr_temp1_max_alarm.dev_attr.attr,
 	&sensor_dev_attr_temp2_max_alarm.dev_attr.attr,
 	NULL

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2011-06-01  7:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28  4:51 [lm-sensors] MAX6642 chip detection and other stuff Guenter Roeck
2011-05-28  8:36 ` Jean Delvare
2011-05-28 14:04 ` Guenter Roeck
2011-06-01  6:44 ` Per Dalén
2011-06-01  7:42 ` Per Dalén [this message]
2011-06-01  9:47 ` Jean Delvare
2011-06-01 15:38 ` Guenter Roeck
2011-06-01 15:43 ` Guenter Roeck
2011-06-04 17:29 ` Guenter Roeck

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=4DE5ED83.9080702@appeartv.com \
    --to=per.dalen@appeartv.com \
    --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.