Skip to contentSkip to conversation

lm75: add new-style driver

PATCH In review David Brownell 3 participants 3 messages May 4, 2008 – Jun 8, 2008 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lm75: add new-style driver

More LM75 updates:

- Teach the LM75 driver to use new-style driver binding:

* Create a second driver struct, using new-style driver binding methods cribbed from the legacy code.

* Add a MODULE_DEVICE_TABLE (for "newER-style binding")

* The legacy probe logic delegates its work to this new code.

* The legacy driver now uses the name "lm75_legacy".

- More careful initialization. Chips are put into 9-bit mode so the current interconversion routines will never fail.

- Save the original chip configuration, and restore it on exit. (Among other things, this normally turns off the mode where the chip is constantly sampling ... and thus saves power.)

So the new-style code should catch all chips that boards declare, while the legacy code catches others. This particular coexistence strategy may need some work yet ... legacy modes might best be set up explicitly by some tool not unlike "sensors-detect". (Or else completely eradicated...)

---
Goes on top of the other stuff. Addresess one more round of comments from Jean.

 drivers/hwmon/Kconfig |    7 +
 drivers/hwmon/lm75.c  |  206 ++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 165 insertions(+), 48 deletions(-)
drivers/hwmon/Kconfig +6 -1
@@ -392,7 +392,12 @@ config SENSORS_LM75
 		- TelCom (now Microchip) TCN75
 		- Texas Instruments TMP100, TMP101, TMP75, TMP175, TMP275
 
-	  Most of these chips will require a "force" module parameter.
+	  This driver supports driver model based binding through board
+	  specific I2C device tables.
+
+	  It also supports the "legacy" style of driver binding.  To use
+	  that with some chips which don't replicate LM75 quirks exactly,
+	  you may need the "force" module parameter.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm75.
drivers/hwmon/lm75.c +159 -47

299 lines not on this page · raw message

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

Acked-by on v1 1/1
#1 lore raw
Quoted 27 lines · David Brownell

More LM75 updates:

- Teach the LM75 driver to use new-style driver binding:

* Create a second driver struct, using new-style driver binding methods cribbed from the legacy code.

* Add a MODULE_DEVICE_TABLE (for "newER-style binding")

* The legacy probe logic delegates its work to this new code.

* The legacy driver now uses the name "lm75_legacy".

- More careful initialization. Chips are put into 9-bit mode so the current interconversion routines will never fail.

- Save the original chip configuration, and restore it on exit. (Among other things, this normally turns off the mode where the chip is constantly sampling ... and thus saves power.)

So the new-style code should catch all chips that boards declare, while the legacy code catches others. This particular coexistence strategy may need some work yet ... legacy modes might best be set up explicitly by some tool not unlike "sensors-detect". (Or else completely eradicated...)

Quoted 8 lines

---
Goes on top of the other stuff. Addresess one more round of comments from Jean.

 drivers/hwmon/Kconfig |    7 +
 drivers/hwmon/lm75.c  |  206 ++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 165 insertions(+), 48 deletions(-)

(...)

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 David Brownell

Hi David:

Quoted 26 lines · David Brownell

More LM75 updates:

- Teach the LM75 driver to use new-style driver binding:

* Create a second driver struct, using new-style driver binding methods cribbed from the legacy code.

* Add a MODULE_DEVICE_TABLE (for "newER-style binding")

* The legacy probe logic delegates its work to this new code.

* The legacy driver now uses the name "lm75_legacy".

- More careful initialization. Chips are put into 9-bit mode so the current interconversion routines will never fail.

- Save the original chip configuration, and restore it on exit. (Among other things, this normally turns off the mode where the chip is constantly sampling ... and thus saves power.)

So the new-style code should catch all chips that boards declare, while the legacy code catches others. This particular coexistence strategy may need some work yet ... legacy modes might best be set up explicitly by some tool not unlike "sensors-detect". (Or else completely eradicated...)

Quoted 8 lines

---
Goes on top of the other stuff. Addresess one more round of comments from Jean.

 drivers/hwmon/Kconfig |    7 +
 drivers/hwmon/lm75.c  |  206 ++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 165 insertions(+), 48 deletions(-)

Applied to hwmon-2.6.git/testing, thanks.

Signature · 8 lines
Mark M. Hoffman
[email protected]


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