ADT7473 and ADT7475
Hi Darrick,
Do you have a list of differences between the ADT7473 and ADT7475? Looking briefly at the datasheets and drivers, I am under the impression that they are essentially compatible and that a combined driver for both chips would make a lot of sense. What do you think?
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi all,
Quoted 4 lines · Jean Delvare
Do you have a list of differences between the ADT7473 and ADT7475? Looking briefly at the datasheets and drivers, I am under the impression that they are essentially compatible and that a combined driver for both chips would make a lot of sense. What do you think?
The more I look at these datasheets, the more obvious is becomes that we really want a single driver for both chips. It is pointless to have 35 kB of duplicated code.
Now there's the question of which driver to keep. I've gathered the following evidences:
Difference between the ADT7473 and ADT7475 devices:
* The ADT7475 has a fixed I2C address (0x2e) while some ADT7473 variants have a selectable address (0x2c, 0x2d or 0x2e).
* The ADT7475 has two additional configuration registers (Configuration 6 at 0x10 and Configuration 7 at 0x11), but the adt7475 driver doesn't make use of them.
* The ADT7473 has five additional registers (Temperature operating points at 0x33-0x35 and Dynamic Tmin control at 0x36 and 0x37) but the adt7473 driver doesn't make use of them.
Difference between the adt7473 and adt7475 drivers:
* The adt7473 driver is older (kernel 2.6.25, while the adt7475 driver was added in kernel 2.6.29) but the adt7475 driver is probably more popular.
* The adt7475 driver reads the extra resolution bits in registers 0x76 and 0x77, while the adt7473 driver does not.
* The adt7475 driver has support for temperature offsets, critical limits and their hysteresis, and fault flag, and PWM frequency selection, while the adt7473 driver does not support any of these.
* The adt7473 implements the non-standard attribute pwm_use_point2_pwm_at_crit, the adt7475 driver doesn't support that.
I couldn't see any obvious difference between the chips for all the registers which are used by the drivers. But maybe there are, only a careful datasheet review would tell.
Bugs found in the drivers:
* The adt7475 driver creates pwm#_auto_channel_temp attributes instead of the standard pwm#_auto_channels_temp.
* The adt7475 driver refreshed limit values every 2 seconds even though the comment in the code says every 60 seconds. 60 seconds would make more sense.
* One coding style error in driver adt7473.
At the light of all this, I think I'd keep the adt7475 driver and merge ADT7473 support therein. If anyone can think of good reasons to do it the other way around, please speak up.
Thanks,
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi,
On 11/08/2009 04:16 PM, Jean Delvare wrote:
<snip>
Quoted 5 lines
At the light of all this, I think I'd keep the adt7475 driver and merge ADT7473 support therein. If anyone can think of good reasons to do it the other way around, please speak up.
Yes that sounds like the sensible thing to do to me.
Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 3 lines · Jean Delvare
At the light of all this, I think I'd keep the adt7475 driver and merge ADT7473 support therein. If anyone can think of good reasons to do it the other way around, please speak up.
Sounds like a good idea to me.
--D
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Darrick,
Quoted 7 lines · Darrick J. Wong
Quoted 3 lines · Jean Delvare
At the light of all this, I think I'd keep the adt7475 driver and merge ADT7473 support therein. If anyone can think of good reasons to do it the other way around, please speak up.
Sounds like a good idea to me.
I'll do that then. When I'm done, I'll ask you to test the result, as I presume you have access to a live ADT7473 chip.
What about attribute pwm_use_point2_pwm_at_crit? It doesn't sound terribly useful to me, but OTOH you did implement it in the adt7473 driver, and writable at that, so maybe you had the need. Do you want me to add this feature to the adt7475 driver?
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 11 lines · Jean Delvare
Hi Darrick,
Quoted 7 lines · Darrick J. Wong
Quoted 3 lines · Jean Delvare
At the light of all this, I think I'd keep the adt7475 driver and merge ADT7473 support therein. If anyone can think of good reasons to do it the other way around, please speak up.
Sounds like a good idea to me.
Quoted 7 lines
I'll do that then. When I'm done, I'll ask you to test the result, as I presume you have access to a live ADT7473 chip.
What about attribute
pwm_use_point2_pwm_at_crit? It doesn't sound terribly useful to me, but OTOH you did implement it in the adt7473 driver, and writable at that, so maybe you had the need. Do you want me to add this feature to the adt7475 driver?
Yes, please. By the way, will there be any attempt to make CONFIG_SENSORS_ADT7473 select CONFIG_SENSORS_ADT7475 when the transition is done?
--D
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 15 lines · Darrick J. Wong
Quoted 14 lines · Jean Delvare
Hi Darrick,
Quoted 7 lines · Darrick J. Wong
Quoted 3 lines · Jean Delvare
At the light of all this, I think I'd keep the adt7475 driver and merge ADT7473 support therein. If anyone can think of good reasons to do it the other way around, please speak up.
Sounds like a good idea to me.
I'll do that then. When I'm done, I'll ask you to test the result, as I presume you have access to a live ADT7473 chip.
Quoted 6 lines
Quoted 4 lines
What about attribute
pwm_use_point2_pwm_at_crit? It doesn't sound terribly useful to me, but OTOH you did implement it in the adt7473 driver, and writable at that, so maybe you had the need. Do you want me to add this feature to the adt7475 driver?Yes, please.
OK, will do.
Quoted 3 lines
By the way, will there be any attempt to make
CONFIG_SENSORS_ADT7473selectCONFIG_SENSORS_ADT7475when the transition is done?
No, CONFIG_SENSORS_ADT7473 will simply be dropped.
What could be done is have CONFIG_SENSORS_ADT7473 select CONFIG_SENSORS_ADT7475 _during_ the transition phase, if you think this can be useful. I am a little reluctant to have Kconfig dependencies with no technical justifications, but in this case I can't think of any problem that could cause, so why not.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 7 lines · Jean Delvare
No,
CONFIG_SENSORS_ADT7473will simply be dropped.What could be done is have
CONFIG_SENSORS_ADT7473selectCONFIG_SENSORS_ADT7475_during_ the transition phase, if you think this can be useful. I am a little reluctant to haveKconfigdependencies with no technical justifications, but in this case I can't think of any problem that could cause, so why not.
"The adt747[35] drivers were refactored into one driver" seems like a good enough technical justification to me.
Then again since the drivers don't autoprobe and most everyone will have a 'modprobe adt7473' in some init script anyway, I suppose it won't really help. So, it's probably not worth the extra effort.
--D
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Darrick J. Wong
Quoted 7 lines · Jean Delvare
No,
CONFIG_SENSORS_ADT7473will simply be dropped.What could be done is have
CONFIG_SENSORS_ADT7473selectCONFIG_SENSORS_ADT7475_during_ the transition phase, if you think this can be useful. I am a little reluctant to haveKconfigdependencies with no technical justifications, but in this case I can't think of any problem that could cause, so why not.
Quoted 4 lines
"The adt747[35] drivers were refactored into one driver" seems like a good enough technical justification to me.
Then again since the drivers don't autoprobe and most everyone will have a
Actually, there will be some form of unintended auto-loading taking place, exactly because of drivers being merged: loading the adt7473 driver on a system with a supported chip will instantiate an "adt7473" driver. This in turn will trigger the loading of the adt7475 driver, because this is where official adt7473 support is. In my tests, the adt7473 driver is faster and the adt7475 driver gets loaded but isn't used (for the ADT7473 at least). But I can imagine that in other cases the adt7475 driver might pick the adt7473 first, so we are in the unfortunate situation where we don't control exactly which driver picks the device. This will stay that way until we finally delete the adt7473 driver. Hopefully both drivers will work the same so nobody will notice ;)
This transition raises an interesting question about what should go in initialization scripts to load i2c drivers. "modprobe $driver" is vulnerable to consolidation as we're doing now. "modprobe i2c:$device" would allow for smoother transitions, with the problem that 1* we would need to teach sensors-detect about all device names and 2* a change in the i2c alias format (which I can't exclude at this point) would break all systems, so it's not bullet-proof either.
Quoted 2 lines
'modprobe adt7473' in some init script anyway, I suppose it won't really help. So, it's probably not worth the extra effort.
There's a log message that will be printed when using the deprecated driver, and we will update sensors-detect to point to the adt7475 driver for ADT7473 support. I hope that will be good enough (and the ADT7473 doesn't seem to be overly popular either.)
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors