Skip to contentSkip to conversation

hwmon (ds1621): Add DS1731 chip support to ds1621 driver

PATCH Applied Robert Coulson 3 participants 6 messages Jun 11, 2013 – Jun 28, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 hwmon (ds1621): Add DS1731 chip support to ds1621 driver

These changes add DS1731 chip support to the ds1621 driver, Kconfig, and documentation.

---

v2 - Updated with v1 review comments

 Documentation/hwmon/ds1621 |   30 ++++++++++++++++++------------
 drivers/hwmon/Kconfig      |    1 +
 drivers/hwmon/ds1621.c     |   12 +++++++-----
 3 files changed, 26 insertions(+), 17 deletions(-)
Documentation/hwmon/ds1621 +18 -12
index 2022379..201dc6b 100644
@@ -22,6 +22,11 @@ Supported chips:
     Addresses scanned: none
     Datasheet: Publicly available from www.maximintegrated.com
 
+  * Maxim Integrated DS1731
+    Prefix: 'ds1731'
+    Addresses scanned: none
+    Datasheet: Publicly available from www.maximintegrated.com
+
 Authors:
         Christian W. Zuckschwerdt <[email protected]>
         valuable contributions by Jan M. Sendler <[email protected]>
@@ -72,7 +77,7 @@ Temperature conversion of the DS1621 takes up to 1000ms; internal access to
 non-volatile registers may last for 10ms or below.
 
 The DS1625 is pin compatible and functionally equivalent with the DS1621,
-but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
+but the DS1621 is meant to replace it. The DS1631, DS1721, & DS1731 are also
 pin compatible with the DS1621, but provide multi-resolution support.
 
 Since there is no version or vendor identification register, there is
@@ -84,26 +89,27 @@ explicitly instantiated, one device per address, in this address
 range: 0x48..0x4f.
 
 The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
-degree Celius over a -10 to +85 degree range, a minimum/maximum alarm
-default setting of 75 and 80 degrees respectifully, and a maximum conversion
-time of 750ms.
+degree Celius (from -10 to +85 degrees), a minimum/maximum alarm default
+setting of 75 and 80 degrees respectively, and a maximum conversion time
+of 750ms.
 
 In addition, the DS1721 supports four resolution settings from 9 to 12 bits
-(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectifully),
+(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectively),
 that are set at device power on to the highest resolution: 12-bits.
 
 One additional note about the ds1721 is that although the data sheet says
 the temperature flags (THF and TLF) are used internally, these flags do
 get set and cleared as the actual temperature crosses the min or max settings.
 
-The DS1631 is also pin compatible with the DS1621 and feature compatible with
-the DS1721, however the DS1631 accuracy is +/- 0.5 degree Celius over the
-same range.
+The DS1631 and DS1731 are pin compatible with the DS1621 and feature compatible
+with the DS1721. However, the DS1631 accuracy is +/- 0.5 degree Celius (from 0
+to +70 degrees), while the DS1731 accuracy is +/-1 degree Celius (from -10 to
++85 degrees).
 
-Changing the DS1631/1721 resolution mode affects the conversion time and can be
-done from userspace, via the device 'update_interval' sysfs attribute. This
-attribute will normalize range of input values to the device maximum resolution
-values defined in the datasheet as such:
+The resolution mode for the DS1631, DS1721, or DS1731 can be changed from
+userspace, via the device 'update_interval' sysfs attribute. This attribute
+will normalize the range of input values to the device maximum resolution
+values defined in the datasheet as follows:
 
 Resolution    Conversion Time    Input Range
  (C/LSB)       (msec)             (msec)
drivers/hwmon/Kconfig +1 -0
index 0f20eef..38c27b2 100644
@@ -324,6 +324,7 @@ config SENSORS_DS1621
 	  - Dallas Semiconductor DS1625
 	  - Maxim Integrated DS1631
 	  - Maxim Integrated DS1721
+	  - Maxim Integrated DS1731
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called ds1621.
drivers/hwmon/ds1621.c +7 -5
index 1587a7c..317f683 100644
@@ -10,8 +10,8 @@
  * resolution, a thermal alarm output (Tout), and user-defined minimum
  * and maximum temperature thresholds (TH & TL).
  *
- * The DS1625, DS1631, & DS1721 are pin compatible with the DS1621 and
- * similar in operation, with slight variations as noted in the device
+ * The DS1625, DS1631, DS1721, & DS1731 are pin compatible with the DS1621
+ * and similar in operation, with slight variations as noted in the device
  * datasheets (please refer to www.maximintegrated.com for specific
  * device information).
  *
@@ -47,7 +47,7 @@
 #include <linux/kernel.h>
 
 /* Supported devices */
-enum chips { ds1621, ds1625, ds1631, ds1721 };
+enum chips { ds1621, ds1625, ds1631, ds1721, ds1731 };
 
 /* Insmod parameters */
 static int polarity = -1;
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")
  *   7    6    5    4    3    2    1    0
  * |Done|THF |TLF |NVB | 1  | 0  |POL |1SHOT|
  *
- * - DS1631:
+ * - DS1631, DS1731:
  *   7    6    5    4    3    2    1    0
  * |Done|THF |TLF |NVB | R1 | R0 |POL |1SHOT|
  *
@@ -140,7 +140,7 @@ static inline int DS1621_TEMP_FROM_REG(u16 reg)
  * TEMP: 0.001C/bit (-55C to +125C)
  * REG:
  *  - 1621, 1625: 0.5C/bit
- *  - 1631, 1721: 0.0625C/bit
+ *  - 1631, 1721, 1731: 0.0625C/bit
  * Assume highest resolution and let the bits fall where they may..
  */
 static inline u16 DS1621_TEMP_TO_REG(long temp)
@@ -176,6 +176,7 @@ static void ds1621_init_client(struct i2c_client *client)
 		break;
 	case ds1631:
 	case ds1721:
+	case ds1731:
 		resol = (new_conf & DS1621_REG_CONFIG_RESOL) >>
 			 DS1621_REG_CONFIG_RESOL_SHIFT;
 		data->update_interval = ds1721_convrates[resol];
@@ -406,6 +407,7 @@ static const struct i2c_device_id ds1621_id[] = {
 	{ "ds1625", ds1625 },
 	{ "ds1631", ds1631 },
 	{ "ds1721", ds1721 },
+	{ "ds1731", ds1731 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ds1621_id);
Signature · 7 lines
1.7.9.5


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Applied
#1 lore raw
Quoted 8 lines · Robert Coulson

These changes add DS1731 chip support to the ds1621 driver, Kconfig, and documentation.

---

v2 - Updated with v1 review comments

Applied.

Thanks,
Guenter

Quoted 148 lines
 Documentation/hwmon/ds1621 |   30 ++++++++++++++++++------------
 drivers/hwmon/Kconfig      |    1 +
 drivers/hwmon/ds1621.c     |   12 +++++++-----
 3 files changed, 26 insertions(+), 17 deletions(-)
Documentation/hwmon/ds1621 +18 -12
index 2022379..201dc6b 100644
@@ -22,6 +22,11 @@ Supported chips:
     Addresses scanned: none
     Datasheet: Publicly available from www.maximintegrated.com
 
+  * Maxim Integrated DS1731
+    Prefix: 'ds1731'
+    Addresses scanned: none
+    Datasheet: Publicly available from www.maximintegrated.com
+
 Authors:
         Christian W. Zuckschwerdt <[email protected]>
         valuable contributions by Jan M. Sendler <[email protected]>
@@ -72,7 +77,7 @@ Temperature conversion of the DS1621 takes up to 1000ms; internal access to
 non-volatile registers may last for 10ms or below.
 
 The DS1625 is pin compatible and functionally equivalent with the DS1621,
-but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
+but the DS1621 is meant to replace it. The DS1631, DS1721, & DS1731 are also
 pin compatible with the DS1621, but provide multi-resolution support.
 
 Since there is no version or vendor identification register, there is
@@ -84,26 +89,27 @@ explicitly instantiated, one device per address, in this address
 range: 0x48..0x4f.
 
 The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
-degree Celius over a -10 to +85 degree range, a minimum/maximum alarm
-default setting of 75 and 80 degrees respectifully, and a maximum conversion
-time of 750ms.
+degree Celius (from -10 to +85 degrees), a minimum/maximum alarm default
+setting of 75 and 80 degrees respectively, and a maximum conversion time
+of 750ms.
 
 In addition, the DS1721 supports four resolution settings from 9 to 12 bits
-(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectifully),
+(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectively),
 that are set at device power on to the highest resolution: 12-bits.
 
 One additional note about the ds1721 is that although the data sheet says
 the temperature flags (THF and TLF) are used internally, these flags do
 get set and cleared as the actual temperature crosses the min or max settings.
 
-The DS1631 is also pin compatible with the DS1621 and feature compatible with
-the DS1721, however the DS1631 accuracy is +/- 0.5 degree Celius over the
-same range.
+The DS1631 and DS1731 are pin compatible with the DS1621 and feature compatible
+with the DS1721. However, the DS1631 accuracy is +/- 0.5 degree Celius (from 0
+to +70 degrees), while the DS1731 accuracy is +/-1 degree Celius (from -10 to
++85 degrees).
 
-Changing the DS1631/1721 resolution mode affects the conversion time and can be
-done from userspace, via the device 'update_interval' sysfs attribute. This
-attribute will normalize range of input values to the device maximum resolution
-values defined in the datasheet as such:
+The resolution mode for the DS1631, DS1721, or DS1731 can be changed from
+userspace, via the device 'update_interval' sysfs attribute. This attribute
+will normalize the range of input values to the device maximum resolution
+values defined in the datasheet as follows:
 
 Resolution    Conversion Time    Input Range
  (C/LSB)       (msec)             (msec)
drivers/hwmon/Kconfig +1 -0
index 0f20eef..38c27b2 100644
@@ -324,6 +324,7 @@ config SENSORS_DS1621
 	  - Dallas Semiconductor DS1625
 	  - Maxim Integrated DS1631
 	  - Maxim Integrated DS1721
+	  - Maxim Integrated DS1731
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called ds1621.
drivers/hwmon/ds1621.c +7 -5
index 1587a7c..317f683 100644
@@ -10,8 +10,8 @@
  * resolution, a thermal alarm output (Tout), and user-defined minimum
  * and maximum temperature thresholds (TH & TL).
  *
- * The DS1625, DS1631, & DS1721 are pin compatible with the DS1621 and
- * similar in operation, with slight variations as noted in the device
+ * The DS1625, DS1631, DS1721, & DS1731 are pin compatible with the DS1621
+ * and similar in operation, with slight variations as noted in the device
  * datasheets (please refer to www.maximintegrated.com for specific
  * device information).
  *
@@ -47,7 +47,7 @@
 #include <linux/kernel.h>
 
 /* Supported devices */
-enum chips { ds1621, ds1625, ds1631, ds1721 };
+enum chips { ds1621, ds1625, ds1631, ds1721, ds1731 };
 
 /* Insmod parameters */
 static int polarity = -1;
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active high, 1 = active low")
  *   7    6    5    4    3    2    1    0
  * |Done|THF |TLF |NVB | 1  | 0  |POL |1SHOT|
  *
- * - DS1631:
+ * - DS1631, DS1731:
  *   7    6    5    4    3    2    1    0
  * |Done|THF |TLF |NVB | R1 | R0 |POL |1SHOT|
  *
@@ -140,7 +140,7 @@ static inline int DS1621_TEMP_FROM_REG(u16 reg)
  * TEMP: 0.001C/bit (-55C to +125C)
  * REG:
  *  - 1621, 1625: 0.5C/bit
- *  - 1631, 1721: 0.0625C/bit
+ *  - 1631, 1721, 1731: 0.0625C/bit
  * Assume highest resolution and let the bits fall where they may..
  */
 static inline u16 DS1621_TEMP_TO_REG(long temp)
@@ -176,6 +176,7 @@ static void ds1621_init_client(struct i2c_client *client)
 		break;
 	case ds1631:
 	case ds1721:
+	case ds1731:
 		resol = (new_conf & DS1621_REG_CONFIG_RESOL) >>
 			 DS1621_REG_CONFIG_RESOL_SHIFT;
 		data->update_interval = ds1721_convrates[resol];
@@ -406,6 +407,7 @@ static const struct i2c_device_id ds1621_id[] = {
 	{ "ds1625", ds1625 },
 	{ "ds1631", ds1631 },
 	{ "ds1721", ds1721 },
+	{ "ds1731", ds1731 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ds1621_id);
Signature · 7 lines
1.7.9.5


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

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

#2 lore raw
In reply to Robert Coulson

Sorry for joining late in the game again...

Quoted 2 lines · Robert Coulson

These changes add DS1731 chip support to the ds1621 driver, Kconfig, and documentation.

Just two minor things I noticed while testing the ds1621 patches:

Documentation/hwmon/ds1621 Temperature conversion of the DS1621 takes up to 1000ms; internal access to · line 80

Quoted 9 lines
Documentation/hwmon/ds1621 +1 -1
(...)
@@ -72,7 +77,7 @@ Temperature conversion of the DS1621 takes up to 1000ms; internal access to
 non-volatile registers may last for 10ms or below.
 
 The DS1625 is pin compatible and functionally equivalent with the DS1621,
-but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
+but the DS1621 is meant to replace it. The DS1631, DS1721, & DS1731 are also

Please don't use "&" for "and" in plain English sentences, it hurts readability.

Documentation/hwmon/ds1621 explicitly instantiated, one device per address, in this address · line 92

Quoted 8 lines
Documentation/hwmon/ds1621 +1 -3
@@ -84,26 +89,27 @@ explicitly instantiated, one device per address, in this address
 range: 0x48..0x4f.
 
 The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
-degree Celius over a -10 to +85 degree range, a minimum/maximum alarm
-default setting of 75 and 80 degrees respectifully, and a maximum conversion
-time of 750ms.
+degree Celius (from -10 to +85 degrees), a minimum/maximum alarm default

Typo: Celsius. The typo was already present before, it's not added by this patch, but you have the opportunity to fix it.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#3 lore raw
In reply to Robert Coulson
Quoted 23 lines · Jean Delvare

Sorry for joining late in the game again...

Quoted 2 lines · Robert Coulson

These changes add DS1731 chip support to the ds1621 driver, Kconfig, and documentation.

Just two minor things I noticed while testing the ds1621 patches:

Documentation/hwmon/ds1621 Temperature conversion of the DS1621 takes up to 1000ms; internal access to · line 80

Quoted 9 lines
Documentation/hwmon/ds1621 +1 -1
(...)
@@ -72,7 +77,7 @@ Temperature conversion of the DS1621 takes up to 1000ms; internal access to
 non-volatile registers may last for 10ms or below.
 
 The DS1625 is pin compatible and functionally equivalent with the DS1621,
-but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
+but the DS1621 is meant to replace it. The DS1631, DS1721, & DS1731 are also

Please don't use "&" for "and" in plain English sentences, it hurts readability.

Quoted 3 lines
Documentation/hwmon/ds1621 +0 -0
@@ -84,26 +89,27 @@ explicitly instantiated, one device per address, in this address
 range: 0x48..0x4f.
 
Quoted 9 lines

Documentation/hwmon/ds1621 explicitly instantiated, one device per address, in this address · line 92

Quoted 5 lines
Documentation/hwmon/ds1621 +1 -3
 The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
-degree Celius over a -10 to +85 degree range, a minimum/maximum alarm
-default setting of 75 and 80 degrees respectifully, and a maximum conversion
-time of 750ms.
+degree Celius (from -10 to +85 degrees), a minimum/maximum alarm default

Typo: Celsius. The typo was already present before, it's not added by this patch, but you have the opportunity to fix it.

I must be blind to have overlooked this one ;)

I patched both up in my tree, no need to re-send (the Celius error was introduced with an earlier patch submitted by Rob, and it was spreading through later patches as well; I fixed all those as well).

Guenter

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

#4 lore raw
In reply to Robert Coulson

Thanks for checking Jean, I appreciate it.
My apologies for the mis-spelling and mixing the use of '&' in plain English.
And, thank you Guenter for fixing my mistakes.
Next time, I will try not to suffer from the same blindness before submitting patches. (-;

Rob.

Quoted 41 lines · Guenter Roeck
Quoted 6 lines · Jean Delvare

Sorry for joining late in the game again...

Quoted 2 lines · Robert Coulson

These changes add DS1731 chip support to the ds1621 driver, Kconfig, and documentation.

Quoted 6 lines

Just two minor things I noticed while testing the ds1621 patches:

Documentation/hwmon/ds1621 Temperature conversion of the DS1621 takes up to

Quoted 4 lines
Documentation/hwmon/ds1621 +0 -0
(...)
@@ -72,7 +77,7 @@ Temperature conversion of the DS1621 takes up to

1000ms; internal access to

Quoted 3 lines

Documentation/hwmon/ds1621 Temperature conversion of the DS1621 takes up to 1000ms; internal access to

Quoted 3 lines
Documentation/hwmon/ds1621 +0 -0
 non-volatile registers may last for 10ms or below.
 
 The DS1625 is pin compatible and functionally equivalent with the

DS1621,

Quoted 2 lines

Documentation/hwmon/ds1621 Temperature conversion of the DS1621 takes up to · line 80

Quoted 2 lines
Documentation/hwmon/ds1621 +1 -1
-but the DS1621 is meant to replace it. The DS1631 and DS1721 are also
+but the DS1621 is meant to replace it. The DS1631, DS1721, & DS1731

are also

Quoted 2 lines

Please don't use "&" for "and" in plain English sentences, it hurts

readability.

Quoted 2 lines

Documentation/hwmon/ds1621 explicitly instantiated, one device per address,

Quoted 2 lines
Documentation/hwmon/ds1621 +0 -0
@@ -84,26 +89,27 @@ explicitly instantiated, one device per address,

in this address

Quoted 3 lines

Documentation/hwmon/ds1621 explicitly instantiated, one device per address, in this address

Quoted 3 lines
Documentation/hwmon/ds1621 +0 -0
 range: 0x48..0x4f.
 
 The DS1721 is pin compatible with the DS1621, has an accuracy of +/-

1.0

Quoted 2 lines

Documentation/hwmon/ds1621 explicitly instantiated, one device per address, · line 88

Quoted 2 lines
Documentation/hwmon/ds1621 +0 -2
-degree Celius over a -10 to +85 degree range, a minimum/maximum alarm
-default setting of 75 and 80 degrees respectifully, and a maximum

conversion

Quoted 2 lines

Documentation/hwmon/ds1621 explicitly instantiated, one device per address, · line 92

Quoted 2 lines
Documentation/hwmon/ds1621 +1 -1
-time of 750ms.
+degree Celius (from -10 to +85 degrees), a minimum/maximum alarm

default

Quoted 4 lines

Typo: Celsius. The typo was already present before, it's not added by this patch, but you have the opportunity to fix it.

Quoted 8 lines

I must be blind to have overlooked this one ;)

I patched both up in my tree, no need to re-send (the Celius error was introduced with an earlier patch submitted by Rob, and it was spreading through later patches as well; I fixed all those as well).

Guenter

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

#5 lore raw
In reply to Robert Coulson

Hi Robert

Quoted 6 lines · Robert Coulson

Thanks for checking Jean, I appreciate it.
My apologies for the mis-spelling and mixing the use of '&' in plain English.
And, thank you Guenter for fixing my mistakes.
Next time, I will try not to suffer from the same blindness before submitting patches. (-;

No worry, you did a rather good job overall and we welcome and value contributions like yours. Mistakes can happen and we fix them as they are discovered, no big deal. If anything, I should apologize for taking so long to test your changes.

Signature · 6 lines
Jean Delvare

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