linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] hwmon:max6697: Allow max6581 to create tempX_offset
@ 2020-07-07  0:22 Chu Lin
  2020-07-07  0:22 ` [PATCH v3 1/2] " Chu Lin
  2020-07-07  0:22 ` [PATCH v3 2/2] hwmon:max6697: fixing the type issue where the comparison is always true Chu Lin
  0 siblings, 2 replies; 5+ messages in thread
From: Chu Lin @ 2020-07-07  0:22 UTC (permalink / raw)
  To: linchuyuan
  Cc: belgaied, jasonling, jdelvare, linux-hwmon, linux-kernel, linux,
	zhongqil

Per max6581, reg 4d and reg 4e is used for temperature read offset.
This patch will let the user specify the temperature read offset for
max6581. This patch is tested on max6581 and only applies to max6581.

Testing:
echo 16250 > temp2_offset
cat temp2_offset
16250

echo 17500 > temp3_offset
cat temp3_offset
17500
cat temp4_offset
0
cat temp2_offset
17500

echo 0 > temp2_offset
cat temp2_offset
0
cat temp3_offset
17500

echo -0 > temp2_offset
cat temp2_offset
0

echo -100000 > temp2_offset
cat temp2_input
4875

echo 10000 > temp2_offset
cat temp2_input
47125

echo -2000 > temp2_offset
cat temp2_input
34875

echo -0 > temp2_offset
cat temp2_input
37000

Signed-off-by: Chu Lin <linchuyuan@google.com>
---
ChangeLog v2 -> v3:
  - Use reverse christmas tree order convension
  - fix the type issue where comparision is always true
  - Change the line limit to 100 char instead of 80 char

ChangeLog v1 -> v2:
  - Simplify the offset reg raw value to milli ceisus conversion
  - Substitute the temp1_offset with dummy attr
  - Avoid using double negative in the macro definition
  - Return the actual error when i2c read/write is failed
  - clamp the value to MAX or MIN respectively if an out of range input is given
  - Provide mux protection when multiple i2c accesses is required

Chu Lin (2):
  hwmon:max6697: Allow max6581 to create tempX_offset
  hwmon:max6697: fixing the type issue where the comparison is always
    true

 drivers/hwmon/max6697.c | 92 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 88 insertions(+), 4 deletions(-)

-- 
2.27.0.383.g050319c2ae-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-07  0:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07  0:22 [PATCH v3 0/2] hwmon:max6697: Allow max6581 to create tempX_offset Chu Lin
2020-07-07  0:22 ` [PATCH v3 1/2] " Chu Lin
2020-07-07  0:22 ` [PATCH v3 2/2] hwmon:max6697: fixing the type issue where the comparison is always true Chu Lin
2020-07-07  0:54   ` Guenter Roeck
2020-07-07  0:56     ` Chu Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).