On 6/5/22 23:30, Slawomir Stepien wrote:
On cze 05, 2022 11:03, Guenter Roeck wrote:
On Wed, May 25, 2022 at 09:36:54AM +0200, Slawomir Stepien wrote:
From: Slawomir Stepien <slawomir.stepien@xxxxxxxxx>
The ADT7461 supports offset register for both remote channels it has.
ADT7481
Oops. I will fix that in new version.
Both registers have the same bit width (resolution).
In the code, this device has LM90_HAVE_TEMP3 and LM90_HAVE_OFFSET flags,
but the support of second remote channel's offset is missing. Add that
implementation.
Signed-off-by: Slawomir Stepien <slawomir.stepien@xxxxxxxxx>
---
drivers/hwmon/lm90.c | 37 ++++++++++++++++++++++++++++++++-----
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 02b211a4e571..d226f1dea2ba 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -153,6 +153,8 @@ enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481,
#define LM90_REG_REMOTE_TEMPL 0x10
#define LM90_REG_REMOTE_OFFSH 0x11
#define LM90_REG_REMOTE_OFFSL 0x12
+#define LM90_REG_REMOTE2_OFFSH 0x34
+#define LM90_REG_REMOTE2_OFFSL 0x35
I don't think those are needed.
In lm90_temp_write() (unlike in lm90_update_limits()) the remote channel is *not* set. I find
... unless lm90_set_temp() is used to write the values. If I recall correctly
I didn't do that because selecting the remote channel seemed unnecessary.
setting it (the remote channel) in lm90_temp_write() a waste of xfers, if we can address the
registers directly. But if you prefer to have just one set of register and setting the remote
channel bit, then sure I can do it like that.
It isn't as if setting the offset happens all the time, so I'd prefer
to use lm90_set_temp() if that is possible.
Thanks,
Guenter