Skip to contentSkip to conversation

lm90: Changes to support sfc hardware

PATCH In review Ben Hutchings 2 participants 5 messages Jul 10, 2008 – Aug 18, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover lm90: Changes to support sfc hardware

These patches apply on top of the testing branch of hwmon-2.6.git plus Jean Delvare's patch series <http://jdelvare.pck.nerim.net/sensors/lm90/>.

Jean, I expect you may want to do the 3rd patch differently.

I've tested the new-style lm90 driver with a slightly modified sfc driver and it seems to work correctly for our SFE4001 board which uses MAX6647. I have not tested the legacy driver after these changes.

Ben.

Ben Hutchings (3):
lm90: Rename temperature conversion functions to match usage
lm90: Support MAX6646, MAX6647 and MAX6649
lm90: Converted into a new-style driver

 drivers/hwmon/Kconfig |    3 +-
 drivers/hwmon/lm90.c  |  280 ++++++++++++++++++++++++++++++++-----------------
 2 files changed, 186 insertions(+), 97 deletions(-)
Signature · 7 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Hi Ben,

Quoted 4 lines · Ben Hutchings

These patches apply on top of the testing branch of hwmon-2.6.git plus Jean Delvare's patch series <http://jdelvare.pck.nerim.net/sensors/lm90/>.

Jean, I expect you may want to do the 3rd patch differently.

In fact I already have a patch ready:
http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/hwmon-lm90-convert-to-new-style.patch

But it depends on i2c-core changes which will go in kernel 2.6.27:
http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/i2c-core-add-detection-capability-to-new-style-drivers.patch

If you look in http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/
you'll see that I have a lot of conversion patches ready for hwmon drivers (including the lm87 driver.) These will go to Linus through my i2c tree, because I don't want to burden Mark with them and technically they only affect the i2c interface of the drivers. But OTOH I have to make sure that they don't collide with patches Mark will send to Linus at about the same moment.

So the schedule I have in mind for the 2.6.27 merge window is as follows:

1* I send to Linus all my i2c patches.
2* I send to Linux all my conversion patches which touch drivers I know
Mark has no patches for currently.
3* Mark sends his patches.
4* I adjust the remaining patches on top of Mark's patches and send
them to Linus.

This should be transparent to Mark. The goal is to have all hwmon drivers converted in 2.6.27.

Obviously, steps 2 and 4 depend on what patches Mark adds to his tree in the next few weeks. There is a rather important amount of pending hwmon patches which aren't in Mark's tree yet, so I just can't predict which ones will make it into 2.6.27-rc1.

Quoted 3 lines

I've tested the new-style lm90 driver with a slightly modified sfc driver and it seems to work correctly for our SFE4001 board which uses MAX6647. I have not tested the legacy driver after these changes.

I have an ADM1032 evaluation board which I can use to test both the new-style binding and the legacy binding.

Thanks,

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Ben Hutchings
Quoted 14 lines · Jean Delvare

Hi Ben,

Quoted 4 lines · Ben Hutchings

These patches apply on top of the testing branch of hwmon-2.6.git plus Jean Delvare's patch series <http://jdelvare.pck.nerim.net/sensors/lm90/>.

Jean, I expect you may want to do the 3rd patch differently.

In fact I already have a patch ready:
http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/hwmon-lm90-convert-to-new-style.patch

But it depends on i2c-core changes which will go in kernel 2.6.27:
http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/i2c-core-add-detection-capability-to-new-style-drivers.patch

Quoted 7 lines

If you look in http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/
you'll see that I have a lot of conversion patches ready for hwmon drivers (including the lm87 driver.) These will go to Linus through my i2c tree, because I don't want to burden Mark with them and technically they only affect the i2c interface of the drivers. But OTOH I have to make sure that they don't collide with patches Mark will send to Linus at about the same moment.

[...]

I applied those to a git branch, followed by your lm90 series. I found a conflict between these two:

hwmon-lm90-convert-to-new-style.patch hwmon-lm90-06-support-adt7461-in-extended-mode.patch

Since the private data structure is no longer allocated in lm90_detect(), the initialisation of data->flags needs to move to lm90_init_client().

drivers/hwmon/lm90.c +4 -3
index b1858e2..c502587 100644
@@ -657,9 +657,6 @@ static int lm90_detect(struct i2c_client *new_client, int kind,
 			 && (reg_config1 & 0x1B) = 0x00
 			 && reg_convrate <= 0x0A) {
 				kind = adt7461;
-				/* Check Temperature Range Select */
-				if (reg_config1 & 0x04)
-					data->flags |= LM90_FLAG_ADT7461_EXT;
 			}
 		} else
 		if (man_id = 0x4D) { /* Maxim */
@@ -796,6 +793,10 @@ static void lm90_init_client(struct i2c_client *client)
 	}
 	config_orig = config;
 
+	/* Check Temperature Range Select */
+	if (config & 0x04)
+		data->flags |= LM90_FLAG_ADT7461_EXT;
+
 	/*
 	 * Put MAX6680/MAX8881 into extended resolution (bit 0x10,
 	 * 0.125 degree resolution) and range (0x08, extend range

--- END ---

It's probably best if you combine this with the latter patch.

Ben.

Signature · 7 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw
In reply to Ben Hutchings

Hi Ben,

Quoted 24 lines · Ben Hutchings
Quoted 15 lines · I wrote:
drivers/hwmon/lm90.c +0 -3
index b1858e2..c502587 100644
@@ -657,9 +657,6 @@ static int lm90_detect(struct i2c_client *new_client, int kind,
 			 && (reg_config1 & 0x1B) = 0x00
 			 && reg_convrate <= 0x0A) {
 				kind = adt7461;
-				/* Check Temperature Range Select */
-				if (reg_config1 & 0x04)
-					data->flags |= LM90_FLAG_ADT7461_EXT;
 			}
 		} else
 		if (man_id = 0x4D) { /* Maxim */

drivers/hwmon/lm90.c static void lm90_init_client(struct i2c_client *client) · line 797

Quoted 5 lines
drivers/hwmon/lm90.c +2 -0
@@ -796,6 +793,10 @@ static void lm90_init_client(struct i2c_client *client)
 	}
 	config_orig = config;
 
+	/* Check Temperature Range Select */
+	if (config & 0x04)

Of course this condition needs to be changed to:

Quoted 4 lines
    if (data->kind = atd7461 && config & 0x04)

drivers/hwmon/lm90.c static void lm90_init_client(struct i2c_client *client) · line 799

Quoted 2 lines
drivers/hwmon/lm90.c +2 -0
+		data->flags |= LM90_FLAG_ADT7461_EXT;
+

You are right. hwmon-lm90-convert-to-new-style.patch is upstream now, and I have merged the changes above into hwmon-lm90-06-support-adt7461-in-extended-mode.patch so that the lm90 driver builds again.

What about your patch adding support for the MAX6646, MAX6647 and MAX6649? According to my notes, I was waiting for a last iteration of it.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#4 lore raw
In reply to Ben Hutchings
Quoted 3 lines · Jean Delvare

What about your patch adding support for the MAX6646, MAX6647 and MAX6649? According to my notes, I was waiting for a last iteration of it.

Sorry, I must have forgotten that. I was away last week but have updated the patch and will post it as a follow-up to this.

Ben.

Signature · 8 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors