lm75: cleanup and reorg
PATCH RESEND 1/2 lm75: cleanup and reorg
[ added LKML to cc list ]
From: David Brownell <[email protected]>
Minor cleanup and reorg of the lm75 code.
- Kconfig provides a larger list of lm75-compatible chips
- A top comment now says what the driver does (!) ... as in, just what sort of sensor is this??
- Section comments now delineate the various sections of the driver:
hwmon attributes, driver binding, register access, module glue. One driver binding function moved out of the attribute section, as did the driver struct itself.
- Minor tweaks to legacy probe logic: correct a comment, and remove a pointless variable.
- Whitespace, linelength, and comment fixes.
This patch should include no functional changes.
--- drivers/hwmon/Kconfig | 18 ++++++---- drivers/hwmon/lm75.c | 90 ++++++++++++++++++++++++++++---------------------- 2 files changed, 63 insertions(+), 45 deletions(-)
drivers/hwmon/Kconfig +12 -6
@@ -394,13 +394,19 @@ config SENSORS_LM75 tristate "National Semiconductor LM75 and compatibles" depends on I2C help - If you say yes here you get support for National Semiconductor LM75 - sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in - 9-bit precision mode), and TelCom (now Microchip) TCN75. + If you say yes here you get support for one common type of + temperature sensor chip, with models including: - The DS75 and DS1775 in 10- to 12-bit precision modes will require - a force module parameter. The driver will not handle the extra - precision anyhow. + - Dallas Semiconductor DS75 and DS1775 + - Maxim MAX6625 and MAX6626 + - Microchip MCP980x + - National Semiconductor LM75 + - NXP's LM75A + - ST Microelectronics STDS75 + - TelCom (now Microchip) TCN75 + - Texas Instruments TMP100, TMP101, TMP75, TMP175, TMP275 + + Most of these chips will require a "force" module parameter. This driver can also be built as a module. If so, the module will be called lm75.
drivers/hwmon/lm75.c +51 -39
189 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Andrew Morton
Acked-by Juerg Haefliger Acked-by Juerg Haefliger Acked-by Juerg Haefliger Acked-by Juerg Haefliger Acked-by Jean Delvare Acked-by Jean Delvare Acked-by Laurent Pinchart Acked-by Jean Delvare Acked-by Darrick J. Wong Acked-by Jean Delvare Acked-by Jean Delvare Acked-by Jean Delvare on v1 1/2Quoted 1 line · On Fri, 25 Jul 2008 15:23:28 -0700 David Brownell <[email protected]> wrote:
Minor cleanup and reorg of the lm75 code.
This patch (and the other) have been in Mark's tree for a month or so. (linux-next <- useful!)
Mark has been pretty, umm, low-key lately. I've attached the full git-hwmon changelog below and the authors of all those changes are cc'ed.
Could people please confirm that what is in linux-next is still the latest and greatest version of their changes? If so, I shall plan on fishing those changes out of there and getting them into -rc2.
Thanks.
commit 530598a47e8562f680d155eb280dddd6af1b3d9e
Author: Jean Delvare <[email protected]> Date: Wed Jun 25 09:10:30 2008 -0400
hwmon: (lm85) Simplify device initialization function
Clean up and simplify the device initialization function:
* Degrade error messages to warnings - what they really are.
* Stop warning about VxI mode, we don't really care.
* Drop comment about lack of limit initialization - that's the standard way, all hardware monitoring drivers do that.
* Only read the configuration register once.
* Only write back to the configuration register if needed.
* Don't attempt to clear the lock bit, it locks itself to 1.
* Move the function to before it's called, so that we no longer need to forware declare it.
commit 231858233b28b8d1b3bd2b5b2c8485b45a000ec2
Author: Jean Delvare <[email protected]> Date: Wed Jun 25 08:47:35 2008 -0400
hwmon: (lm85) Misc cleanups
Misc cleanups to the lm85 hardware monitoring driver:
* Mark constant arrays as const.
* Remove useless masks.
* Have lm85_write_value return void - nobody is checking the returned value anyway and in some cases it was plain wrong.
* Remove useless initializations.
* Rename new_client to client in lm85_detect.
* Replace cascaded if/else with a switch/case in lm85_detect.
* Group similar loops in lm85_update_device.
* Remove legacy comments.
commit b84465f713e0d8a041db0447534b048d74972341
Author: Jean Delvare <[email protected]> Date: Sat Apr 12 19:56:35 2008 +0200
hwmon: (lm85) Don't write back cached values
In set_pwm_auto_pwm_minctl, we write cached register bits back to the chip. This is a bad idea as we have no guarantee that the cache is up-to-date. Better read a fresh register value from the chip, it's safer and in fact it is also more simple.
commit 0d78cd2a2a3b870b409769852189f58d954da386
Author: Jean Delvare <[email protected]> Date: Thu May 1 08:47:33 2008 +0200
hwmon: (lm85) Drop dead code
Drop a lot of useless register defines, conversion macros, data structure members and update code. All these register values were read from the device but nothing is done out of them, so this is all dead code in practice.
commit 54edd6a00cd77019b3e29ca145414f69e9f9d14b
Author: Jean Delvare <[email protected]> Date: Tue Apr 29 14:03:37 2008 +0200
hwmon: (lm85) Coding-style cleanups
Fix most style issues reported by checkpatch, including:
* Trailing, missing and extra whitespace
* Extra parentheses, curly braces and semi-colons
* Broken indentation
* Lines too long
I verified that the generated code is the same before and after these changes.
commit ea6db11742de63324f29d1383122657cabe90940
Author: David Brownell <[email protected]> Date: Sat May 3 19:33:15 2008 -0700
hwmon: (lm75) add new-style driver binding
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...)
commit 6916fbc0e5c8d59d663331034ce44ef85bfb50b1
Author: David Brownell <[email protected]> Date: Mon Apr 21 12:10:53 2008 -0700
hwmon: (lm75) cleanup/reorg
Minor cleanup and reorg of the lm75 code.
- Kconfig provides a larger list of lm75-compatible chips
- A top comment now says what the driver does (!) ... as in, just what sort of sensor is this??
- Section comments now delineate the various sections of the driver:
hwmon attributes, driver binding, register access, module glue. One driver binding function moved out of the attribute section, as did the driver struct itself.
- Minor tweaks to legacy probe logic: correct a comment, and remove a pointless variable.
- Whitespace, linelength, and comment fixes.
This patch should include no functional changes. It's preparation for adding new-style (driver model) I2C driver binding.
commit d8db8e40b05bdaa4f5888f2a762533079ebee458
Author: Mark M. Hoffman <[email protected]> Date: Mon May 26 15:09:36 2008 -0400
hwmon: (adt7473) clarify an awkward bit of code
commit 36e847483a14121f1c51b290b9ddeb91f1e58996
Author: Jean Delvare <[email protected]> Date: Sat Apr 26 16:28:27 2008 +0200
hwmon: (adt7473) Remove unused defines
All the *_MAX_ADDR defines are never used, so remove them. The number of registers of each type is already expressed by the *_COUNT defines.
commit 55e019e7f2b7737348fc71995823e824165fb0b5
Author: Juerg Haefliger <[email protected]> Date: Tue Mar 25 21:49:15 2008 -0700
hwmon: (dme1737) fix voltage scaling
This patch fixes a voltage scaling issue for the sch311x device.
commit 535e772fc505b311bbed42dcc308ea96a0890cbf
Author: Juerg Haefliger <[email protected]> Date: Thu Apr 3 21:34:19 2008 -0700
hwmon: (dme1737) probe all addresses
This patch adds a module load parameter to enable probing of non-standard LPC addresses 0x162e and 0x164e when scanning for supported ISA chips.
commit 554045a0ba16fffb6bb832919b72a4f692d9add4
Author: Juerg Haefliger <[email protected]> Date: Tue Mar 25 21:49:02 2008 -0700
hwmon: (dme1737) demacrofy for readability
This patch gets rid of a couple of macros previously used for sysfs attribute generation and manipulation. This makes the source a little bigger but a lot more readable and maintainable. It also fixes an issue with pwm5 & pwm6 attributes not being created read-only initially.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 4 lines
Quoted 1 line
Minor cleanup and reorg of the lm75 code.
This patch (and the other) have been in Mark's tree for a month or so. (linux-next <- useful!)
Good to know -- thanks. Nobody on the hwmon list seemed to know the status when I asked, which is why I reposted. (These have been pending for quite a while...)
Quoted 7 lines
Mark has been pretty, umm, low-key lately. I've attached the full git-hwmon changelog below and the authors of all those changes are cc'ed.
Could people please confirm that what is in linux-next is still the latest and greatest version of their changes? If so, I shall plan on fishing those changes out of there and getting them into -rc2.
There's one more LM75 patch from Jean that's not there ... but it looks like those two got in just fine, so Jean's update should apply just fine.
- Dave
Quoted 11 lines
Quoted 1 line
Minor cleanup and reorg of the lm75 code.
This patch (and the other) have been in Mark's tree for a month or so. (linux-next <- useful!)
Mark has been pretty, umm, low-key lately. I've attached the full git-hwmon changelog below and the authors of all those changes are cc'ed.
Could people please confirm that what is in linux-next is still the latest and greatest version of their changes? If so, I shall plan on fishing those changes out of there and getting them into -rc2.
Andrew,
I see that atleast this patch:
http://lists.lm-sensors.org/pipermail/lm-sensors/2008-July/023629.html
Is missing which is a minor yet somewhat important bugfix to the abituguru3 driver, see:
http://lists.lm-sensors.org/pipermail/lm-sensors/2008-July/023630.html
For my: "Acked-by: Hans de Goede <j.w.r.degoede at hhs.nl>" Line (I'm the maintainer of that driver).
It would be nice if this fix could make 2.6.27.
Also Jean has been doing a lot of patches for all i2c hwmon driver to convert them to new style driver binding, and I've reviewed and Acked the entire bunch. So all in all it looks like we're dropping patches, does anyone know whats up with Mark, holiday or ... ?
Thanks & Regards,
Hans
Quoted 18 lines · On Wed, 30 Jul 2008 09:44:55 +0200 Hans de Goede <[email protected]> wrote:
Quoted 5 lines
Quoted 1 line
Minor cleanup and reorg of the lm75 code.
This patch (and the other) have been in Mark's tree for a month or so. (linux-next <- useful!)
Quoted 7 lines
Mark has been pretty, umm, low-key lately. I've attached the full git-hwmon changelog below and the authors of all those changes are cc'ed.
Could people please confirm that what is in linux-next is still the latest and greatest version of their changes? If so, I shall plan on fishing those changes out of there and getting them into -rc2.
Andrew,
I see that atleast this patch:
http://lists.lm-sensors.org/pipermail/lm-sensors/2008-July/023629.html
Quoted 9 lines
Is missing which is a minor yet somewhat important bugfix to the abituguru3 driver, see:
http://lists.lm-sensors.org/pipermail/lm-sensors/2008-July/023630.htmlFor my: "Acked-by: Hans de Goede <j.w.r.degoede at hhs.nl>" Line (I'm the maintainer of that driver).
It would be nice if this fix could make 2.6.27.
OK. Can you please email me any patches which you think should be in 2.6.27 in the usual manner, with the appropriate mailing list cc's? Add your own signed-off-by: if needed. I'll get it all lined up.
Or Jean can do it if he'd prefer - the main thing is to not let people's reviewed, tested and merged code fall out of 2.6.27.
Quoted 5 lines
Also Jean has been doing a lot of patches for all i2c hwmon driver to convert them to new style driver binding, and I've reviewed and Acked the entire bunch. So all in all it looks like we're dropping patches, does anyone know whats up with Mark, holiday or ... ?
He did mention a while ago that he had little time, but I don't know whether that is a temporary state.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Andrew Morton
OK. Can you please email me any patches which you think should be in 2.6.27 in the usual manner, with the appropriate mailing list cc's? Add your own signed-off-by: if needed. I'll get it all lined up.
Done for the abituguru3 patch, as for Jean's new style driver conversion patches I think thats best done by Jean himself.
I also have a patch adding pwm control support to the fintek f71882fg on my to review list (I'm the maintainer of the f71882fg driver) I've already tested it and I'll try to get that reviewed the next couple a days and then send it to you for 2.6.27 inclusion.
Then there also are 2 new hwmon drivers which really have been waiting to long to get into the kernel too. I'll try to review those too, but I can test only one of them. Let me know if not being able to test the other is a problem for upstream inclusion.
Regards,
Hans
Quoted 4 lines · On Thu, 31 Jul 2008 12:33:00 +0200 Hans de Goede <[email protected]> wrote:
Then there also are 2 new hwmon drivers which really have been waiting to long to get into the kernel too. I'll try to review those too, but I can test only one of them. Let me know if not being able to test the other is a problem for upstream inclusion.
Well, I assume that the original author runtime-tested the code. It is rare that a reviewer can runtime test a new driver, and rarer indeed that a reviewer will actually do so. So please send them out when ready.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors