All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and
@ 2010-07-06 22:24 Guenter Roeck
  2010-07-07 11:40 ` [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F Jean Delvare
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Guenter Roeck @ 2010-07-06 22:24 UTC (permalink / raw)
  To: lm-sensors

The following patch adds support for SE97 to sensors-detect.
It also displays the new chip names for W83677HG-I (NCT677xF).

---
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect	(revision 5850)
+++ prog/detect/sensors-detect	(working copy)
@@ -1190,6 +1190,11 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x18..0x1f],
 		i2c_detect => sub { jedec_JC42_4_detect(@_, 0); },
 	}, {
+		name => "NXP SE97/SE97B",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
+	}, {
 		name => "Smart Battery",
 		driver => "sbs", # ACPI driver, not sure if it always works
 		i2c_addrs => [0x0b],
@@ -1730,7 +1735,7 @@ use constant FEAT_SMBUS	=> (1 << 7);
 		logdev => 0x0b,
 		features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
 	}, {
-		name => "Nuvoton W83677HG-I Super IO Sensors",
+		name => "Nuvoton W83677HG-I (NCT6771F/NCT6772F/NCT6775F) Super IO Sensors",
 		driver => "to-be-written",	# Probably w83627ehf
 		devid => 0xB470,
 		devid_mask => 0xFFF0,
@@ -5309,7 +5314,7 @@ sub max6655_detect
 	return 6;
 }
 
-# Chip to detect: 0 = STTS424
+# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
 # Registers used:
 #   0x00: Capabilities
 #   0x01: Configuration
@@ -5332,9 +5337,13 @@ sub jedec_JC42_4_detect
 	# Check for manufacturer and device ID
 	$manid = i2c_smbus_read_byte_data($file, 0x06);
 	$devid = i2c_smbus_read_byte_data($file, 0x07);
+
 	if ($chip = 0) {
 		return unless $manid = 0x10;		# STMicrolectronics
 		return unless $devid = 0x00;		# STTS424
+	} elsif ($chip = 1) {
+		return unless $manid = 0x11;		# NXP
+		return unless $devid = 0xa2;		# SE97
 	}
 
 	# Now, do it all again with words. Note that we get
@@ -5342,7 +5351,7 @@ sub jedec_JC42_4_detect
 
 	# Check for unused bits
 	$reg = i2c_smbus_read_word_data($file, 0x00);
-	return if $reg < 0 || $reg & 0xc0ff;
+	return if $reg < 0 || $reg & 0x00ff;
 
 	$manid = i2c_smbus_read_word_data($file, 0x06);
 	$devid = i2c_smbus_read_word_data($file, 0x07);
@@ -5350,6 +5359,9 @@ sub jedec_JC42_4_detect
 	if ($chip = 0) {
 		return unless $manid = 0x4a10;		# STMicrolectronics
 		return unless ($devid & 0xfeff) = 0x0000; # STTS424
+	} elsif ($chip = 1) {
+		return unless $manid = 0x3111;		# NXP
+		return unless ($devid & 0xfcff) = 0x00a2; # SE97
 	}
 
 	return 5;
Index: CHANGES
=================================--- CHANGES	(revision 5850)
+++ CHANGES	(working copy)
@@ -18,6 +18,8 @@ SVN HEAD
                   Fix Maxim MAX6690 support
                   Fix handling of duplicate detections
                   Add support for STMicroelectronics STTS424
+                  Add support for NXP SE97 / SE97B
+                  Add reference to NCT6771F/NCT6772F/NCT6775F
 
 3.1.2 (2010-02-02)
   libsensors: Support upcoming sysfs path to i2c adapters

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
@ 2010-07-07 11:40 ` Jean Delvare
  2010-07-07 15:53 ` Jean Delvare
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jean Delvare @ 2010-07-07 11:40 UTC (permalink / raw)
  To: lm-sensors

Hi Guenter,

On Tue, 6 Jul 2010 15:24:37 -0700, Guenter Roeck wrote:
> The following patch adds support for SE97 to sensors-detect.
> It also displays the new chip names for W83677HG-I (NCT677xF).
> 
> ---
> Index: prog/detect/sensors-detect
> =================================> --- prog/detect/sensors-detect	(revision 5850)
> +++ prog/detect/sensors-detect	(working copy)
> @@ -1190,6 +1190,11 @@ use vars qw(@i2c_adapter_names);
>  		i2c_addrs => [0x18..0x1f],
>  		i2c_detect => sub { jedec_JC42_4_detect(@_, 0); },
>  	}, {
> +		name => "NXP SE97/SE97B",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
> +	}, {
>  		name => "Smart Battery",
>  		driver => "sbs", # ACPI driver, not sure if it always works
>  		i2c_addrs => [0x0b],
> @@ -1730,7 +1735,7 @@ use constant FEAT_SMBUS	=> (1 << 7);
>  		logdev => 0x0b,
>  		features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
>  	}, {
> -		name => "Nuvoton W83677HG-I Super IO Sensors",
> +		name => "Nuvoton W83677HG-I (NCT6771F/NCT6772F/NCT6775F) Super IO Sensors",
>  		driver => "to-be-written",	# Probably w83627ehf
>  		devid => 0xB470,
>  		devid_mask => 0xFFF0,
> @@ -5309,7 +5314,7 @@ sub max6655_detect
>  	return 6;
>  }
>  
> -# Chip to detect: 0 = STTS424
> +# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
>  # Registers used:
>  #   0x00: Capabilities
>  #   0x01: Configuration
> @@ -5332,9 +5337,13 @@ sub jedec_JC42_4_detect
>  	# Check for manufacturer and device ID
>  	$manid = i2c_smbus_read_byte_data($file, 0x06);
>  	$devid = i2c_smbus_read_byte_data($file, 0x07);
> +
>  	if ($chip = 0) {
>  		return unless $manid = 0x10;		# STMicrolectronics
>  		return unless $devid = 0x00;		# STTS424
> +	} elsif ($chip = 1) {
> +		return unless $manid = 0x11;		# NXP
> +		return unless $devid = 0xa2;		# SE97
>  	}
>  
>  	# Now, do it all again with words. Note that we get
> @@ -5342,7 +5351,7 @@ sub jedec_JC42_4_detect
>  
>  	# Check for unused bits
>  	$reg = i2c_smbus_read_word_data($file, 0x00);
> -	return if $reg < 0 || $reg & 0xc0ff;
> +	return if $reg < 0 || $reg & 0x00ff;
>  
>  	$manid = i2c_smbus_read_word_data($file, 0x06);
>  	$devid = i2c_smbus_read_word_data($file, 0x07);
> @@ -5350,6 +5359,9 @@ sub jedec_JC42_4_detect
>  	if ($chip = 0) {
>  		return unless $manid = 0x4a10;		# STMicrolectronics
>  		return unless ($devid & 0xfeff) = 0x0000; # STTS424
> +	} elsif ($chip = 1) {
> +		return unless $manid = 0x3111;		# NXP
> +		return unless ($devid & 0xfcff) = 0x00a2; # SE97
>  	}
>  
>  	return 5;
> Index: CHANGES
> =================================> --- CHANGES	(revision 5850)
> +++ CHANGES	(working copy)
> @@ -18,6 +18,8 @@ SVN HEAD
>                    Fix Maxim MAX6690 support
>                    Fix handling of duplicate detections
>                    Add support for STMicroelectronics STTS424
> +                  Add support for NXP SE97 / SE97B
> +                  Add reference to NCT6771F/NCT6772F/NCT6775F
>  
>  3.1.2 (2010-02-02)
>    libsensors: Support upcoming sysfs path to i2c adapters

Looks all sane, thanks for doing this. Shall I commit it, or should I
create a developer account and let you commit it? You already have an
account for the wiki, letting you commit to the repository is only one
configuration line away. So it's as you prefer.

-- 
Jean Delvare

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
  2010-07-07 11:40 ` [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F Jean Delvare
@ 2010-07-07 15:53 ` Jean Delvare
  2010-07-07 16:03 ` Guenter Roeck
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jean Delvare @ 2010-07-07 15:53 UTC (permalink / raw)
  To: lm-sensors

On Wed, 7 Jul 2010 08:29:55 -0700, Guenter Roeck wrote:
> On Wed, Jul 07, 2010 at 07:40:57AM -0400, Jean Delvare wrote:
> > Looks all sane, thanks for doing this. Shall I commit it, or should I
> > create a developer account and let you commit it? You already have an
> > account for the wiki, letting you commit to the repository is only one
> > configuration line away. So it's as you prefer.
>
> I really prefer the git way of doing things, meaning I prefer to have someone
> else have a close look at my code, and not commit my own junk myself.
> I also never worked with svn before, so I would be a bit concerned about
> screwing up the repository. Not really a good idea to make my first svn commit
> into a public repository.

SVN is really easy. It's almost the same as CVS if you've used CVS
before. And it's definitely easier than git.

> So let's keep it as is for now, and go ahead and commit. We can revisit that
> when you get tired having to deal with my patches.

I'm tired already ;)

Just joking. I'll be glad to review and commit your patches if such is
your desire.

> Any plans to switch to git ?

No. The complexity incurred far outweighs the benefits, given the
little activity the project has.

-- 
Jean Delvare

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
  2010-07-07 11:40 ` [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F Jean Delvare
  2010-07-07 15:53 ` Jean Delvare
@ 2010-07-07 16:03 ` Guenter Roeck
  2010-07-07 19:32 ` Jean Delvare
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2010-07-07 16:03 UTC (permalink / raw)
  To: lm-sensors

On Wed, Jul 07, 2010 at 11:53:27AM -0400, Jean Delvare wrote:
> On Wed, 7 Jul 2010 08:29:55 -0700, Guenter Roeck wrote:
> > On Wed, Jul 07, 2010 at 07:40:57AM -0400, Jean Delvare wrote:
> > > Looks all sane, thanks for doing this. Shall I commit it, or should I
> > > create a developer account and let you commit it? You already have an
> > > account for the wiki, letting you commit to the repository is only one
> > > configuration line away. So it's as you prefer.
> >
> > I really prefer the git way of doing things, meaning I prefer to have someone
> > else have a close look at my code, and not commit my own junk myself.
> > I also never worked with svn before, so I would be a bit concerned about
> > screwing up the repository. Not really a good idea to make my first svn commit
> > into a public repository.
> 
> SVN is really easy. It's almost the same as CVS if you've used CVS
> before. And it's definitely easier than git.
> 
Easier than git - really ? After having worked with git for several years,
I am still amazed (or, rather, I am more and more amazed) how easy and fast
things are with git. Granted, one problem is that it is also very easy
to screw up, which makes it very difficult to use with junior engineers ...

> > So let's keep it as is for now, and go ahead and commit. We can revisit that
> > when you get tired having to deal with my patches.
> 
> I'm tired already ;)
> 
> Just joking. I'll be glad to review and commit your patches if such is
> your desire.
> 
Let's at least stick with it for now.

Guenter

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (2 preceding siblings ...)
  2010-07-07 16:03 ` Guenter Roeck
@ 2010-07-07 19:32 ` Jean Delvare
  2010-07-08 20:15 ` [lm-sensors] [PATCH] sensors-detect: Add support for several JC42.4 Guenter Roeck
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jean Delvare @ 2010-07-07 19:32 UTC (permalink / raw)
  To: lm-sensors

On Wed, 7 Jul 2010 09:03:04 -0700, Guenter Roeck wrote:
> On Wed, Jul 07, 2010 at 11:53:27AM -0400, Jean Delvare wrote:
> > On Wed, 7 Jul 2010 08:29:55 -0700, Guenter Roeck wrote:
> > > On Wed, Jul 07, 2010 at 07:40:57AM -0400, Jean Delvare wrote:
> > > > Looks all sane, thanks for doing this. Shall I commit it, or should I
> > > > create a developer account and let you commit it? You already have an
> > > > account for the wiki, letting you commit to the repository is only one
> > > > configuration line away. So it's as you prefer.
> > >
> > > I really prefer the git way of doing things, meaning I prefer to have someone
> > > else have a close look at my code, and not commit my own junk myself.
> > > I also never worked with svn before, so I would be a bit concerned about
> > > screwing up the repository. Not really a good idea to make my first svn commit
> > > into a public repository.
> > 
> > SVN is really easy. It's almost the same as CVS if you've used CVS
> > before. And it's definitely easier than git.
> > 
> Easier than git - really ? After having worked with git for several years,
> I am still amazed (or, rather, I am more and more amazed) how easy and fast
> things are with git. Granted, one problem is that it is also very easy
> to screw up, which makes it very difficult to use with junior engineers ...

It is indeed very easy to screw up with git. It is also easy to put
your local repository in a state from which you don't know to recover.
It isn't surprising anyway, as git is much more powerful than SVN (let
alone CVS). With greater power comes greater ways to mess everything up.

Anyway, enough of this, I really don't have the time to discuss the
merits of git vs SVN, others have done it already. The only thing I
keep in mind is that you would have been more likely to contribute
directly if we were using git. If a lot of other developers start
claiming the same, then who knows...

> > > So let's keep it as is for now, and go ahead and commit. We can revisit that
> > > when you get tired having to deal with my patches.
> > 
> > I'm tired already ;)
> > 
> > Just joking. I'll be glad to review and commit your patches if such is
> > your desire.
>
> Let's at least stick with it for now.

I've just applied your patch, thanks for your contribution.

-- 
Jean Delvare

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [lm-sensors] [PATCH] sensors-detect: Add support for several JC42.4
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (3 preceding siblings ...)
  2010-07-07 19:32 ` Jean Delvare
@ 2010-07-08 20:15 ` Guenter Roeck
  2010-07-09  9:15 ` [lm-sensors] [PATCH] sensors-detect: Add support for several Jean Delvare
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2010-07-08 20:15 UTC (permalink / raw)
  To: lm-sensors

This patch adds support for several JC42.4 compliant temperature sensors to
sensors-detect.

---
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect	(revision 5851)
+++ prog/detect/sensors-detect	(working copy)
@@ -1195,6 +1195,51 @@
 		i2c_addrs => [0x18..0x1f],
 		i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
 	}, {
+		name => "NXP SE98",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 2); },
+	}, {
+		name => "Analog Devices ADT7408",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 3); },
+	}, {
+		name => "IDT TS3000/TSE2002",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 4); },
+	}, {
+		name => "Maxim MAX6604",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 5); },
+	}, {
+		name => "Microchip MCP98242",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 6); },
+	}, {
+		name => "Microchip MCP98243",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 7); },
+	}, {
+		name => "Microchip MCP9843",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 8); },
+	}, {
+		name => "ON CAT6095/CAT34TS02",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 9); },
+	}, {
+		name => "ST STTS424E",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 10); },
+	}, {
 		name => "Smart Battery",
 		driver => "sbs", # ACPI driver, not sure if it always works
 		i2c_addrs => [0x0b],
@@ -5314,7 +5359,10 @@
 	return 6;
 }
 
-# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
+# Chip to detect: 0 = STTS424, 1 = SE97/SE97B, 2 = SE98, 3 = ADT7408,
+#                 4 = TS3000/TSE2002, 5 = MAX6604, 6 = MCP98242,
+#                 7 = MCP98243, 8 = MCP9843, 9 = CAT6095 / CAT34TS02,
+#                 10 = STTS424E
 # Registers used:
 #   0x00: Capabilities
 #   0x01: Configuration
@@ -5340,10 +5388,37 @@
 
 	if ($chip = 0) {
 		return unless $manid = 0x10;		# STMicrolectronics
-		return unless $devid = 0x00;		# STTS424
+		return unless $devid = 0x01;		# STTS424
 	} elsif ($chip = 1) {
 		return unless $manid = 0x11;		# NXP
 		return unless $devid = 0xa2;		# SE97
+	} elsif ($chip = 2) {
+		return unless $manid = 0x11;		# NXP
+		return unless $devid = 0xa1;		# SE98
+	} elsif ($chip = 3) {
+		return unless $manid = 0x11;		# ADT
+		return unless $devid = 0x08;		# ADT7408
+	} elsif ($chip = 4) {
+		return unless $manid = 0x00;		# IDT
+		return unless $devid = 0x29;		# TS3000/TSE2002
+	} elsif ($chip = 5) {
+		return unless $manid = 0x00;		# MAXIM
+		return unless $devid = 0x3e;		# MAX6604
+	} elsif ($chip = 6) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x20;		# MCP98242
+	} elsif ($chip = 7) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x21;		# MCP98243
+	} elsif ($chip = 8) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x00;		# MCP9843
+	} elsif ($chip = 9) {
+		return unless $manid = 0x1b;		# ONS
+		return unless $devid = 0x08;		# CAT6095 / CAT34TS02
+	} elsif ($chip = 10) {
+		return unless $manid = 0x10;		# STMicrolectronics
+		return unless $devid = 0x00;		# STTS424E02
 	}
 
 	# Now, do it all again with words. Note that we get
@@ -5358,10 +5433,37 @@
 	return if $manid < 0 || $devid < 0;
 	if ($chip = 0) {
 		return unless $manid = 0x4a10;		# STMicrolectronics
-		return unless ($devid & 0xfeff) = 0x0000; # STTS424
+		return unless ($devid & 0xfeff) = 0x0001; # STTS424
 	} elsif ($chip = 1) {
 		return unless $manid = 0x3111;		# NXP
 		return unless ($devid & 0xfcff) = 0x00a2; # SE97
+	} elsif ($chip = 2) {
+		return unless $manid = 0x3111;		# NXP
+		return unless ($devid & 0xfcff) = 0x00a1; # SE98
+	} elsif ($chip = 3) {
+		return unless $manid = 0xd411;		# ADT
+		return unless $devid = 0x0108;		# ADT7408
+	} elsif ($chip = 4) {
+		return unless $manid = 0xb300;		# IDT
+		return unless $devid = 0x0329;		# TS3000/TSE2002
+	} elsif ($chip = 5) {
+		return unless $manid = 0x4d00;		# MAXIM
+		return unless $devid = 0x003e;		# MAX6604
+	} elsif ($chip = 6) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0020; # MCP98242
+	} elsif ($chip = 7) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0021; # MCP98243
+	} elsif ($chip = 8) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0000; # MCP9843
+	} elsif ($chip = 9) {
+		return unless $manid = 0x091b;		# ONS
+		return unless ($devid & 0xe0ff) = 0x0008; # CAT6095 / CAT34TS02
+	} elsif ($chip = 10) {
+		return unless $manid = 0x4a10;		# STMicrolectronics
+		return unless ($devid & 0xfeff) = 0x0000; # STTS424E02
 	}
 
 	return 5;
Index: CHANGES
=================================--- CHANGES	(revision 5851)
+++ CHANGES	(working copy)
@@ -20,6 +20,7 @@
                   Add support for STMicroelectronics STTS424
                   Add support for NXP SE97 / SE97B
                   Add reference to NCT6771F/NCT6772F/NCT6775F
+                  Add support for several JC42.4 compliant temperature sensors
 
 3.1.2 (2010-02-02)
   libsensors: Support upcoming sysfs path to i2c adapters

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for several
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (4 preceding siblings ...)
  2010-07-08 20:15 ` [lm-sensors] [PATCH] sensors-detect: Add support for several JC42.4 Guenter Roeck
@ 2010-07-09  9:15 ` Jean Delvare
  2010-09-08 15:35 ` [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96 Guenter Roeck
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jean Delvare @ 2010-07-09  9:15 UTC (permalink / raw)
  To: lm-sensors

Hi Gunter,

On Thu, 8 Jul 2010 13:15:06 -0700, Guenter Roeck wrote:
> This patch adds support for several JC42.4 compliant temperature sensors to
> sensors-detect.

Applied, thanks.

> ---
> Index: prog/detect/sensors-detect
> =================================> --- prog/detect/sensors-detect	(revision 5851)
> +++ prog/detect/sensors-detect	(working copy)
> @@ -1195,6 +1195,51 @@
>  		i2c_addrs => [0x18..0x1f],
>  		i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
>  	}, {
> +		name => "NXP SE98",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 2); },
> +	}, {
> +		name => "Analog Devices ADT7408",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 3); },
> +	}, {
> +		name => "IDT TS3000/TSE2002",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 4); },
> +	}, {
> +		name => "Maxim MAX6604",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 5); },
> +	}, {
> +		name => "Microchip MCP98242",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 6); },
> +	}, {
> +		name => "Microchip MCP98243",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 7); },
> +	}, {
> +		name => "Microchip MCP9843",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 8); },
> +	}, {
> +		name => "ON CAT6095/CAT34TS02",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 9); },
> +	}, {
> +		name => "ST STTS424E",
> +		driver => "to-be-written",
> +		i2c_addrs => [0x18..0x1f],
> +		i2c_detect => sub { jedec_JC42_4_detect(@_, 10); },
> +	}, {

FYI, I moved this one right after the STTS424 entry. The output of
sensors-detect looks slightly nicer when several chips of the same
manufacturer are tested in a row.

>  		name => "Smart Battery",
>  		driver => "sbs", # ACPI driver, not sure if it always works
>  		i2c_addrs => [0x0b],
> @@ -5314,7 +5359,10 @@
>  	return 6;
>  }
>  
> -# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
> +# Chip to detect: 0 = STTS424, 1 = SE97/SE97B, 2 = SE98, 3 = ADT7408,
> +#                 4 = TS3000/TSE2002, 5 = MAX6604, 6 = MCP98242,
> +#                 7 = MCP98243, 8 = MCP9843, 9 = CAT6095 / CAT34TS02,
> +#                 10 = STTS424E
>  # Registers used:
>  #   0x00: Capabilities
>  #   0x01: Configuration
> @@ -5340,10 +5388,37 @@
>  
>  	if ($chip = 0) {
>  		return unless $manid = 0x10;		# STMicrolectronics
> -		return unless $devid = 0x00;		# STTS424
> +		return unless $devid = 0x01;		# STTS424
>  	} elsif ($chip = 1) {
>  		return unless $manid = 0x11;		# NXP
>  		return unless $devid = 0xa2;		# SE97
> +	} elsif ($chip = 2) {
> +		return unless $manid = 0x11;		# NXP
> +		return unless $devid = 0xa1;		# SE98
> +	} elsif ($chip = 3) {
> +		return unless $manid = 0x11;		# ADT
> +		return unless $devid = 0x08;		# ADT7408
> +	} elsif ($chip = 4) {
> +		return unless $manid = 0x00;		# IDT
> +		return unless $devid = 0x29;		# TS3000/TSE2002
> +	} elsif ($chip = 5) {
> +		return unless $manid = 0x00;		# MAXIM
> +		return unless $devid = 0x3e;		# MAX6604
> +	} elsif ($chip = 6) {
> +		return unless $manid = 0x00;		# MCP
> +		return unless $devid = 0x20;		# MCP98242
> +	} elsif ($chip = 7) {
> +		return unless $manid = 0x00;		# MCP
> +		return unless $devid = 0x21;		# MCP98243
> +	} elsif ($chip = 8) {
> +		return unless $manid = 0x00;		# MCP
> +		return unless $devid = 0x00;		# MCP9843
> +	} elsif ($chip = 9) {
> +		return unless $manid = 0x1b;		# ONS
> +		return unless $devid = 0x08;		# CAT6095 / CAT34TS02
> +	} elsif ($chip = 10) {
> +		return unless $manid = 0x10;		# STMicrolectronics
> +		return unless $devid = 0x00;		# STTS424E02
>  	}
>  
>  	# Now, do it all again with words. Note that we get
> @@ -5358,10 +5433,37 @@
>  	return if $manid < 0 || $devid < 0;
>  	if ($chip = 0) {
>  		return unless $manid = 0x4a10;		# STMicrolectronics
> -		return unless ($devid & 0xfeff) = 0x0000; # STTS424
> +		return unless ($devid & 0xfeff) = 0x0001; # STTS424
>  	} elsif ($chip = 1) {
>  		return unless $manid = 0x3111;		# NXP
>  		return unless ($devid & 0xfcff) = 0x00a2; # SE97
> +	} elsif ($chip = 2) {
> +		return unless $manid = 0x3111;		# NXP
> +		return unless ($devid & 0xfcff) = 0x00a1; # SE98
> +	} elsif ($chip = 3) {
> +		return unless $manid = 0xd411;		# ADT
> +		return unless $devid = 0x0108;		# ADT7408
> +	} elsif ($chip = 4) {
> +		return unless $manid = 0xb300;		# IDT
> +		return unless $devid = 0x0329;		# TS3000/TSE2002
> +	} elsif ($chip = 5) {
> +		return unless $manid = 0x4d00;		# MAXIM
> +		return unless $devid = 0x003e;		# MAX6604
> +	} elsif ($chip = 6) {
> +		return unless $manid = 0x5400;		# MCP
> +		return unless ($devid & 0xfcff) = 0x0020; # MCP98242
> +	} elsif ($chip = 7) {
> +		return unless $manid = 0x5400;		# MCP
> +		return unless ($devid & 0xfcff) = 0x0021; # MCP98243
> +	} elsif ($chip = 8) {
> +		return unless $manid = 0x5400;		# MCP
> +		return unless ($devid & 0xfcff) = 0x0000; # MCP9843
> +	} elsif ($chip = 9) {
> +		return unless $manid = 0x091b;		# ONS
> +		return unless ($devid & 0xe0ff) = 0x0008; # CAT6095 / CAT34TS02
> +	} elsif ($chip = 10) {
> +		return unless $manid = 0x4a10;		# STMicrolectronics
> +		return unless ($devid & 0xfeff) = 0x0000; # STTS424E02
>  	}
>  
>  	return 5;
> Index: CHANGES
> =================================> --- CHANGES	(revision 5851)
> +++ CHANGES	(working copy)
> @@ -20,6 +20,7 @@
>                    Add support for STMicroelectronics STTS424
>                    Add support for NXP SE97 / SE97B
>                    Add reference to NCT6771F/NCT6772F/NCT6775F
> +                  Add support for several JC42.4 compliant temperature sensors
>  
>  3.1.2 (2010-02-02)
>    libsensors: Support upcoming sysfs path to i2c adapters


-- 
Jean Delvare

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (5 preceding siblings ...)
  2010-07-09  9:15 ` [lm-sensors] [PATCH] sensors-detect: Add support for several Jean Delvare
@ 2010-09-08 15:35 ` Guenter Roeck
  2010-09-08 19:06 ` Jean Delvare
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2010-09-08 15:35 UTC (permalink / raw)
  To: lm-sensors

This patch adds support for max6695/96 to sensors-detect.

---
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect	(revision 5857)
+++ prog/detect/sensors-detect	(working copy)
@@ -921,8 +921,13 @@
 		name => "Maxim MAX6680/MAX6681",
 		driver => "lm90",
 		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
-		i2c_detect => sub { lm90_detect(@_, 7); },
+		i2c_detect => sub { max6680_95_detect(@_, 0); },
 	}, {
+		name => "Maxim MAX6695/MAX6696",
+		driver => "lm90",
+		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
+		i2c_detect => sub { max6680_95_detect(@_, 1); },
+	}, {
 		name => "Winbond W83L771W/G",
 		driver => "to-be-written",
 		i2c_addrs => [0x4c],
@@ -4051,10 +4056,46 @@
 	return $confidence;
 }
 
+# Chip to detect: 0 = MAX6680/81, 1 = MAX6695/96
+# Registers used:
+#   0x03: Configuration
+#   0x04: Conversion rate
+#   0x12: Status2
+#   0x16: Overtemperature 2
+#   0xfe: Manufacturer ID
+#   0xff: Chip ID / die revision
+sub max6680_95_detect
+{
+	my ($file, $addr, $chip) = @_;
+	my $mid = i2c_smbus_read_byte_data($file, 0xfe);
+	my $cid = i2c_smbus_read_byte_data($file, 0xff);
+	my $conf = i2c_smbus_read_byte_data($file, 0x03);
+	my $rate = i2c_smbus_read_byte_data($file, 0x04);
+	my $emerg = i2c_smbus_read_byte_data($file, 0x16);
+	my $status2 = i2c_smbus_read_byte_data($file, 0x12);
+
+	if ($chip = 0) {
+		return if ($conf & 0x03) != 0;
+		return if $rate > 0x07;
+		return if $emerg != $rate;
+		return if $mid != 0x4d;		# Maxim
+		return 8 if $cid = 0x01;	# MAX6680/MAX6681
+	}
+	if ($chip = 1) {
+		return if ($conf & 0x10) != 0;
+		return if ($status2 & 0x01) != 0;
+		return if $rate > 0x07;
+		return if $emerg = $rate;
+		return if $mid != 0x4d;		# Maxim
+		return 8 if $cid = 0x01;	# MAX6695/MAX6696
+	}
+	return;
+}
+
 # Chip to detect: 0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032,
 #		  4 = MAX6654, 5 = ADT7461,
 #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
-#		  7 = MAX6680/MAX6681, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
+#		  7 = unused, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690
 # Registers used:
 #   0x03: Configuration
@@ -4116,10 +4157,7 @@
 		return 8 if $cid = 0x59;	# MAX6648/MAX6692
 	}
 	if ($chip = 7) {
-		return if ($conf & 0x03) != 0;
-		return if $rate > 0x07;
-		return if $mid != 0x4d;		# Maxim
-		return 8 if $cid = 0x01;	# MAX6680/MAX6681
+		return;
 	}
 	if ($chip = 8) {
 		return if ($conf & 0x2a) != 0;

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (6 preceding siblings ...)
  2010-09-08 15:35 ` [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96 Guenter Roeck
@ 2010-09-08 19:06 ` Jean Delvare
  2010-09-08 19:39 ` Guenter Roeck
  2011-06-26 20:38 ` [lm-sensors] [PATCH] sensors-detect: Add support for NXP/Philips Guenter Roeck
  9 siblings, 0 replies; 11+ messages in thread
From: Jean Delvare @ 2010-09-08 19:06 UTC (permalink / raw)
  To: lm-sensors

Hi Guenter,

On Wed, 8 Sep 2010 08:35:00 -0700, Guenter Roeck wrote:
> This patch adds support for max6695/96 to sensors-detect.
> 
> ---
> Index: prog/detect/sensors-detect
> =================================> --- prog/detect/sensors-detect	(revision 5857)
> +++ prog/detect/sensors-detect	(working copy)
> @@ -921,8 +921,13 @@
>  		name => "Maxim MAX6680/MAX6681",
>  		driver => "lm90",
>  		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
> -		i2c_detect => sub { lm90_detect(@_, 7); },
> +		i2c_detect => sub { max6680_95_detect(@_, 0); },
>  	}, {
> +		name => "Maxim MAX6695/MAX6696",
> +		driver => "lm90",
> +		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
> +		i2c_detect => sub { max6680_95_detect(@_, 1); },
> +	}, {
>  		name => "Winbond W83L771W/G",
>  		driver => "to-be-written",
>  		i2c_addrs => [0x4c],
> @@ -4051,10 +4056,46 @@
>  	return $confidence;
>  }
>  
> +# Chip to detect: 0 = MAX6680/81, 1 = MAX6695/96
> +# Registers used:
> +#   0x03: Configuration
> +#   0x04: Conversion rate
> +#   0x12: Status2
> +#   0x16: Overtemperature 2
> +#   0xfe: Manufacturer ID
> +#   0xff: Chip ID / die revision
> +sub max6680_95_detect
> +{
> +	my ($file, $addr, $chip) = @_;
> +	my $mid = i2c_smbus_read_byte_data($file, 0xfe);
> +	my $cid = i2c_smbus_read_byte_data($file, 0xff);
> +	my $conf = i2c_smbus_read_byte_data($file, 0x03);
> +	my $rate = i2c_smbus_read_byte_data($file, 0x04);
> +	my $emerg = i2c_smbus_read_byte_data($file, 0x16);
> +	my $status2 = i2c_smbus_read_byte_data($file, 0x12);
> +
> +	if ($chip = 0) {
> +		return if ($conf & 0x03) != 0;
> +		return if $rate > 0x07;
> +		return if $emerg != $rate;

Please take a look at max6657_detect(). Obviously you assume that the
SMBus read commands above were executed in a specific order, which
isn't actually guaranteed, because sensors-detect has a register cache
to speed up detection. You really want to pass NO_CACHE as a third
parameter if you want to by-pass the cache and thus ensure that the
read order is as desired.

Also, as discussed before, comparing $emerg and $rate is likely to work
in most cases, but isn't 100% reliable. You might want to consider the
following sequence instead:

	my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE);
	my $emerg1 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);
	my $rate = i2c_smbus_read_byte_data($file, 0x04, NO_CACHE);
	my $emerg2 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);

	if ($emerg1 != $emerg2)
		# MAX6680/MAX6681
	else
		# MAX6695/MAX6696

This is guaranteed to work because $mid and $rate can't have the same
value.
		


> +		return if $mid != 0x4d;		# Maxim
> +		return 8 if $cid = 0x01;	# MAX6680/MAX6681
> +	}
> +	if ($chip = 1) {
> +		return if ($conf & 0x10) != 0;
> +		return if ($status2 & 0x01) != 0;
> +		return if $rate > 0x07;
> +		return if $emerg = $rate;
> +		return if $mid != 0x4d;		# Maxim
> +		return 8 if $cid = 0x01;	# MAX6695/MAX6696
> +	}
> +	return;
> +}
> +
>  # Chip to detect: 0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032,
>  #		  4 = MAX6654, 5 = ADT7461,
>  #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
> -#		  7 = MAX6680/MAX6681, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
> +#		  7 = unused, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
>  #		  11 = W83L771AWG/ASG, 12 = MAX6690
>  # Registers used:
>  #   0x03: Configuration
> @@ -4116,10 +4157,7 @@
>  		return 8 if $cid = 0x59;	# MAX6648/MAX6692
>  	}
>  	if ($chip = 7) {
> -		return if ($conf & 0x03) != 0;
> -		return if $rate > 0x07;
> -		return if $mid != 0x4d;		# Maxim
> -		return 8 if $cid = 0x01;	# MAX6680/MAX6681
> +		return;
>  	}

Why not skip it altogether? And same for the comment above? These are
arbitrary numbers, it's totally OK if they don't follow each other.

>  	if ($chip = 8) {
>  		return if ($conf & 0x2a) != 0;


-- 
Jean Delvare

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (7 preceding siblings ...)
  2010-09-08 19:06 ` Jean Delvare
@ 2010-09-08 19:39 ` Guenter Roeck
  2011-06-26 20:38 ` [lm-sensors] [PATCH] sensors-detect: Add support for NXP/Philips Guenter Roeck
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2010-09-08 19:39 UTC (permalink / raw)
  To: lm-sensors

Hi Jean,

On Wed, 2010-09-08 at 15:06 -0400, Jean Delvare wrote:
> Hi Guenter,
> 
> On Wed, 8 Sep 2010 08:35:00 -0700, Guenter Roeck wrote:
> > This patch adds support for max6695/96 to sensors-detect.
> > 
> > ---
> > Index: prog/detect/sensors-detect
> > =================================> > --- prog/detect/sensors-detect	(revision 5857)
> > +++ prog/detect/sensors-detect	(working copy)
> > @@ -921,8 +921,13 @@
> >  		name => "Maxim MAX6680/MAX6681",
> >  		driver => "lm90",
> >  		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
> > -		i2c_detect => sub { lm90_detect(@_, 7); },
> > +		i2c_detect => sub { max6680_95_detect(@_, 0); },
> >  	}, {
> > +		name => "Maxim MAX6695/MAX6696",
> > +		driver => "lm90",
> > +		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
> > +		i2c_detect => sub { max6680_95_detect(@_, 1); },
> > +	}, {
> >  		name => "Winbond W83L771W/G",
> >  		driver => "to-be-written",
> >  		i2c_addrs => [0x4c],
> > @@ -4051,10 +4056,46 @@
> >  	return $confidence;
> >  }
> >  
> > +# Chip to detect: 0 = MAX6680/81, 1 = MAX6695/96
> > +# Registers used:
> > +#   0x03: Configuration
> > +#   0x04: Conversion rate
> > +#   0x12: Status2
> > +#   0x16: Overtemperature 2
> > +#   0xfe: Manufacturer ID
> > +#   0xff: Chip ID / die revision
> > +sub max6680_95_detect
> > +{
> > +	my ($file, $addr, $chip) = @_;
> > +	my $mid = i2c_smbus_read_byte_data($file, 0xfe);
> > +	my $cid = i2c_smbus_read_byte_data($file, 0xff);
> > +	my $conf = i2c_smbus_read_byte_data($file, 0x03);
> > +	my $rate = i2c_smbus_read_byte_data($file, 0x04);
> > +	my $emerg = i2c_smbus_read_byte_data($file, 0x16);
> > +	my $status2 = i2c_smbus_read_byte_data($file, 0x12);
> > +
> > +	if ($chip = 0) {
> > +		return if ($conf & 0x03) != 0;
> > +		return if $rate > 0x07;
> > +		return if $emerg != $rate;
> 
> Please take a look at max6657_detect(). Obviously you assume that the
> SMBus read commands above were executed in a specific order, which
> isn't actually guaranteed, because sensors-detect has a register cache
> to speed up detection. You really want to pass NO_CACHE as a third
> parameter if you want to by-pass the cache and thus ensure that the
> read order is as desired.
> 
Yes, I completely missed that.

> Also, as discussed before, comparing $emerg and $rate is likely to work
> in most cases, but isn't 100% reliable. You might want to consider the
> following sequence instead:
> 
> 	my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE);
> 	my $emerg1 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);
> 	my $rate = i2c_smbus_read_byte_data($file, 0x04, NO_CACHE);
> 	my $emerg2 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);
> 
> 	if ($emerg1 != $emerg2)
> 		# MAX6680/MAX6681
> 	else
> 		# MAX6695/MAX6696
> 
> This is guaranteed to work because $mid and $rate can't have the same
> value.

Excellent idea. I'll try that.

> 
> 
> > +		return if $mid != 0x4d;		# Maxim
> > +		return 8 if $cid = 0x01;	# MAX6680/MAX6681
> > +	}
> > +	if ($chip = 1) {
> > +		return if ($conf & 0x10) != 0;
> > +		return if ($status2 & 0x01) != 0;
> > +		return if $rate > 0x07;
> > +		return if $emerg = $rate;
> > +		return if $mid != 0x4d;		# Maxim
> > +		return 8 if $cid = 0x01;	# MAX6695/MAX6696
> > +	}
> > +	return;
> > +}
> > +
> >  # Chip to detect: 0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032,
> >  #		  4 = MAX6654, 5 = ADT7461,
> >  #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
> > -#		  7 = MAX6680/MAX6681, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
> > +#		  7 = unused, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
> >  #		  11 = W83L771AWG/ASG, 12 = MAX6690
> >  # Registers used:
> >  #   0x03: Configuration
> > @@ -4116,10 +4157,7 @@
> >  		return 8 if $cid = 0x59;	# MAX6648/MAX6692
> >  	}
> >  	if ($chip = 7) {
> > -		return if ($conf & 0x03) != 0;
> > -		return if $rate > 0x07;
> > -		return if $mid != 0x4d;		# Maxim
> > -		return 8 if $cid = 0x01;	# MAX6680/MAX6681
> > +		return;
> >  	}
> 
> Why not skip it altogether? And same for the comment above? These are
> arbitrary numbers, it's totally OK if they don't follow each other.
> 
Ok.

Guenter

> >  	if ($chip = 8) {
> >  		return if ($conf & 0x2a) != 0;
> 
> 



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [lm-sensors] [PATCH] sensors-detect: Add support for NXP/Philips
  2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
                   ` (8 preceding siblings ...)
  2010-09-08 19:39 ` Guenter Roeck
@ 2011-06-26 20:38 ` Guenter Roeck
  9 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2011-06-26 20:38 UTC (permalink / raw)
  To: lm-sensors

Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect	(revision 5980)
+++ prog/detect/sensors-detect	(working copy)
@@ -1055,6 +1055,11 @@
 		i2c_addrs => [0x4c..0x4d],
 		i2c_detect => sub { lm90_detect(@_, 13); },
 	}, {
+		name => "NXP/Philips SA56004",
+		driver => "lm90",
+		i2c_addrs => [0x48..0x4f],
+		i2c_detect => sub { lm90_detect(@_, 14); },
+	}, {
 		name => "Analog Devices ADT7481",
 		driver => "to-be-written",
 		i2c_addrs => [0x4c, 0x4b],
@@ -4352,7 +4357,7 @@
 #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
 #		  8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690,
-#		  13 = ADT7461A/NCT1008
+#		  13 = ADT7461A/NCT1008, 14 = SA56004
 # Registers used:
 #   0x03: Configuration
 #   0x04: Conversion rate
@@ -4457,6 +4462,12 @@
 		return if $mid != 0x41;		# Analog Devices
 		return 8 if $cid = 0x57;	# ADT7461A, NCT1008
 	}
+	if ($chip = 14) {
+		return if ($conf & 0x2a) != 0;
+		return if $rate > 0x09;
+		return if $mid != 0xa1;		# NXP Semiconductor/Philips
+		return 8 if $cid = 0x00;	# SA56004
+	}
 	return;
 }
 
Index: CHANGES
=================================--- CHANGES	(revision 5980)
+++ CHANGES	(working copy)
@@ -15,6 +15,7 @@
                   Add detection of SMSC EMC2300
                   Add detection of MAX6642
                   Add detection of ITE IT8772E
+                  Add detection of SE56004
 
 3.3.0 (2011-03-28)
   Makefile: Check for bison and flex

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-06-26 20:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-06 22:24 [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F and Guenter Roeck
2010-07-07 11:40 ` [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F Jean Delvare
2010-07-07 15:53 ` Jean Delvare
2010-07-07 16:03 ` Guenter Roeck
2010-07-07 19:32 ` Jean Delvare
2010-07-08 20:15 ` [lm-sensors] [PATCH] sensors-detect: Add support for several JC42.4 Guenter Roeck
2010-07-09  9:15 ` [lm-sensors] [PATCH] sensors-detect: Add support for several Jean Delvare
2010-09-08 15:35 ` [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96 Guenter Roeck
2010-09-08 19:06 ` Jean Delvare
2010-09-08 19:39 ` Guenter Roeck
2011-06-26 20:38 ` [lm-sensors] [PATCH] sensors-detect: Add support for NXP/Philips Guenter Roeck

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.