All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20060216175930.GE20157@cosmic.amd.com>

diff --git a/a/1.txt b/N1/1.txt
index 5416053..00674f7 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -14,151 +14,3 @@ Jordan Crouse
 Senior Linux Engineer
 AMD - Personal Connectivity Solutions Group
 <www.amd.com/embeddedprocessors>
--------------- next part --------------
-[HWMON] Add LM82 support
-
-Add LM82 thermal detector support (similar to the LM83, but less featureful).
-
-Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>
----
-
- drivers/hwmon/lm83.c |   63 +++++++++++++++++++++++++++++++++++++++-----------
- 1 files changed, 49 insertions(+), 14 deletions(-)
-
-diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c
-index 26dfa9e..aa8b74d 100644
---- a/drivers/hwmon/lm83.c
-+++ b/drivers/hwmon/lm83.c
-@@ -12,6 +12,11 @@
-  * Since the datasheet omits to give the chip stepping code, I give it
-  * here: 0x03 (at register 0xff).
-  *
-+ * <jordan.crouse at amd.com>: Added LM82 support
-+ * http://www.national.com/pf/LM/LM82.html - basically a stripped down
-+ * model of the LM83, with only two temperatures reported.  The stepping
-+ * is 0x01 (at least according to the datasheet).
-+ *
-  * This program is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published by
-  * the Free Software Foundation; either version 2 of the License, or
-@@ -51,7 +56,7 @@ static unsigned short normal_i2c[] = { 0
-  * Insmod parameters
-  */
- 
--I2C_CLIENT_INSMOD_1(lm83);
-+I2C_CLIENT_INSMOD_2(lm83, lm82);
- 
- /*
-  * The LM83 registers
-@@ -142,6 +147,7 @@ struct lm83_data {
- 	struct semaphore update_lock;
- 	char valid; /* zero until following fields are valid */
- 	unsigned long last_updated; /* in jiffies */
-+	int type;  /* Remember the type of chip */
- 
- 	/* registers values */
- 	s8 temp[9];	/* 0..3: input 1-4,
-@@ -159,7 +165,14 @@ static ssize_t show_temp(struct device *
- {
- 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- 	struct lm83_data *data = lm83_update_device(dev);
--	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[attr->index]));
-+	int index = attr->index;
-+
-+	if (data->type = lm82) {
-+		if (index = 1 || index = 5)
-+			index++;
-+	}
-+
-+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[index]));
- }
- 
- static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
-@@ -172,6 +185,12 @@ static ssize_t set_temp(struct device *d
- 	int nr = attr->index;
- 
- 	down(&data->update_lock);
-+
-+	if (data->type = lm82) {
-+		if (nr = 1 || nr = 5)
-+			nr++;
-+	}
-+
- 	data->temp[nr] = TEMP_TO_REG(val);
- 	i2c_smbus_write_byte_data(client, LM83_REG_W_HIGH[nr - 4],
- 				  data->temp[nr]);
-@@ -283,6 +302,9 @@ static int lm83_detect(struct i2c_adapte
- 			if (chip_id = 0x03) {
- 				kind = lm83;
- 			}
-+			else if (chip_id = 0x01) {
-+				kind = lm82;
-+			}
- 		}
- 
- 		if (kind <= 0) { /* identification failed */
-@@ -296,10 +318,15 @@ static int lm83_detect(struct i2c_adapte
- 	if (kind = lm83) {
- 		name = "lm83";
- 	}
-+	else if (kind = lm82) {
-+		name = "lm82";
-+	}
- 
- 	/* We can fill in the remaining client fields */
- 	strlcpy(new_client->name, name, I2C_NAME_SIZE);
- 	data->valid = 0;
-+	data->type = kind;
-+
- 	init_MUTEX(&data->update_lock);
- 
- 	/* Tell the I2C layer a new client has arrived */
-@@ -322,28 +349,36 @@ static int lm83_detect(struct i2c_adapte
- 			   &sensor_dev_attr_temp1_input.dev_attr);
- 	device_create_file(&new_client->dev,
- 			   &sensor_dev_attr_temp2_input.dev_attr);
--	device_create_file(&new_client->dev,
--			   &sensor_dev_attr_temp3_input.dev_attr);
--	device_create_file(&new_client->dev,
--			   &sensor_dev_attr_temp4_input.dev_attr);
-+
- 	device_create_file(&new_client->dev,
- 			   &sensor_dev_attr_temp1_max.dev_attr);
- 	device_create_file(&new_client->dev,
- 			   &sensor_dev_attr_temp2_max.dev_attr);
--	device_create_file(&new_client->dev,
--			   &sensor_dev_attr_temp3_max.dev_attr);
--	device_create_file(&new_client->dev,
--			   &sensor_dev_attr_temp4_max.dev_attr);
-+
- 	device_create_file(&new_client->dev,
- 			   &sensor_dev_attr_temp1_crit.dev_attr);
- 	device_create_file(&new_client->dev,
- 			   &sensor_dev_attr_temp2_crit.dev_attr);
--	device_create_file(&new_client->dev,
--			   &sensor_dev_attr_temp3_crit.dev_attr);
--	device_create_file(&new_client->dev,
--			   &sensor_dev_attr_temp4_crit.dev_attr);
-+
- 	device_create_file(&new_client->dev, &dev_attr_alarms);
- 
-+	if (kind = lm83) {
-+		device_create_file(&new_client->dev,
-+				   &sensor_dev_attr_temp3_input.dev_attr);
-+		device_create_file(&new_client->dev,
-+				   &sensor_dev_attr_temp4_input.dev_attr);
-+
-+		device_create_file(&new_client->dev,
-+				   &sensor_dev_attr_temp3_max.dev_attr);
-+		device_create_file(&new_client->dev,
-+				   &sensor_dev_attr_temp4_max.dev_attr);
-+
-+		device_create_file(&new_client->dev,
-+				   &sensor_dev_attr_temp3_crit.dev_attr);
-+		device_create_file(&new_client->dev,
-+				   &sensor_dev_attr_temp4_crit.dev_attr);
-+	}
-+
- 	return 0;
- 
- exit_detach:
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..e5cbb2f
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/plain;
+ charset=us-ascii
+Content-Disposition: inline;
+ filename=hwmon-lm83.patch
+Content-Transfer-Encoding: 7bit
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..a0d994c
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,147 @@
+[HWMON] Add LM82 support
+
+Add LM82 thermal detector support (similar to the LM83, but less featureful).
+
+Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
+---
+
+ drivers/hwmon/lm83.c |   63 +++++++++++++++++++++++++++++++++++++++-----------
+ 1 files changed, 49 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c
+index 26dfa9e..aa8b74d 100644
+--- a/drivers/hwmon/lm83.c
++++ b/drivers/hwmon/lm83.c
+@@ -12,6 +12,11 @@
+  * Since the datasheet omits to give the chip stepping code, I give it
+  * here: 0x03 (at register 0xff).
+  *
++ * <jordan.crouse@amd.com>: Added LM82 support
++ * http://www.national.com/pf/LM/LM82.html - basically a stripped down
++ * model of the LM83, with only two temperatures reported.  The stepping
++ * is 0x01 (at least according to the datasheet).
++ *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+@@ -51,7 +56,7 @@ static unsigned short normal_i2c[] = { 0
+  * Insmod parameters
+  */
+ 
+-I2C_CLIENT_INSMOD_1(lm83);
++I2C_CLIENT_INSMOD_2(lm83, lm82);
+ 
+ /*
+  * The LM83 registers
+@@ -142,6 +147,7 @@ struct lm83_data {
+ 	struct semaphore update_lock;
+ 	char valid; /* zero until following fields are valid */
+ 	unsigned long last_updated; /* in jiffies */
++	int type;  /* Remember the type of chip */
+ 
+ 	/* registers values */
+ 	s8 temp[9];	/* 0..3: input 1-4,
+@@ -159,7 +165,14 @@ static ssize_t show_temp(struct device *
+ {
+ 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ 	struct lm83_data *data = lm83_update_device(dev);
+-	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[attr->index]));
++	int index = attr->index;
++
++	if (data->type == lm82) {
++		if (index == 1 || index == 5)
++			index++;
++	}
++
++	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[index]));
+ }
+ 
+ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
+@@ -172,6 +185,12 @@ static ssize_t set_temp(struct device *d
+ 	int nr = attr->index;
+ 
+ 	down(&data->update_lock);
++
++	if (data->type == lm82) {
++		if (nr == 1 || nr == 5)
++			nr++;
++	}
++
+ 	data->temp[nr] = TEMP_TO_REG(val);
+ 	i2c_smbus_write_byte_data(client, LM83_REG_W_HIGH[nr - 4],
+ 				  data->temp[nr]);
+@@ -283,6 +302,9 @@ static int lm83_detect(struct i2c_adapte
+ 			if (chip_id == 0x03) {
+ 				kind = lm83;
+ 			}
++			else if (chip_id == 0x01) {
++				kind = lm82;
++			}
+ 		}
+ 
+ 		if (kind <= 0) { /* identification failed */
+@@ -296,10 +318,15 @@ static int lm83_detect(struct i2c_adapte
+ 	if (kind == lm83) {
+ 		name = "lm83";
+ 	}
++	else if (kind = lm82) {
++		name = "lm82";
++	}
+ 
+ 	/* We can fill in the remaining client fields */
+ 	strlcpy(new_client->name, name, I2C_NAME_SIZE);
+ 	data->valid = 0;
++	data->type = kind;
++
+ 	init_MUTEX(&data->update_lock);
+ 
+ 	/* Tell the I2C layer a new client has arrived */
+@@ -322,28 +349,36 @@ static int lm83_detect(struct i2c_adapte
+ 			   &sensor_dev_attr_temp1_input.dev_attr);
+ 	device_create_file(&new_client->dev,
+ 			   &sensor_dev_attr_temp2_input.dev_attr);
+-	device_create_file(&new_client->dev,
+-			   &sensor_dev_attr_temp3_input.dev_attr);
+-	device_create_file(&new_client->dev,
+-			   &sensor_dev_attr_temp4_input.dev_attr);
++
+ 	device_create_file(&new_client->dev,
+ 			   &sensor_dev_attr_temp1_max.dev_attr);
+ 	device_create_file(&new_client->dev,
+ 			   &sensor_dev_attr_temp2_max.dev_attr);
+-	device_create_file(&new_client->dev,
+-			   &sensor_dev_attr_temp3_max.dev_attr);
+-	device_create_file(&new_client->dev,
+-			   &sensor_dev_attr_temp4_max.dev_attr);
++
+ 	device_create_file(&new_client->dev,
+ 			   &sensor_dev_attr_temp1_crit.dev_attr);
+ 	device_create_file(&new_client->dev,
+ 			   &sensor_dev_attr_temp2_crit.dev_attr);
+-	device_create_file(&new_client->dev,
+-			   &sensor_dev_attr_temp3_crit.dev_attr);
+-	device_create_file(&new_client->dev,
+-			   &sensor_dev_attr_temp4_crit.dev_attr);
++
+ 	device_create_file(&new_client->dev, &dev_attr_alarms);
+ 
++	if (kind == lm83) {
++		device_create_file(&new_client->dev,
++				   &sensor_dev_attr_temp3_input.dev_attr);
++		device_create_file(&new_client->dev,
++				   &sensor_dev_attr_temp4_input.dev_attr);
++
++		device_create_file(&new_client->dev,
++				   &sensor_dev_attr_temp3_max.dev_attr);
++		device_create_file(&new_client->dev,
++				   &sensor_dev_attr_temp4_max.dev_attr);
++
++		device_create_file(&new_client->dev,
++				   &sensor_dev_attr_temp3_crit.dev_attr);
++		device_create_file(&new_client->dev,
++				   &sensor_dev_attr_temp4_crit.dev_attr);
++	}
++
+ 	return 0;
+ 
+ exit_detach:
diff --git a/a/content_digest b/N1/content_digest
index 190bc6c..3ec0360 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,10 +1,10 @@
- "From\0jordan.crouse@amd.com (Jordan Crouse)\0"
- "Subject\0[lm-sensors] [HWMON] Add LM82 support\0"
- "Date\0Thu, 16 Feb 2006 17:59:30 +0000\0"
+ "From\0Jordan Crouse <jordan.crouse@amd.com>\0"
+ "Subject\0[HWMON] Add LM82 support\0"
+ "Date\0Thu, 16 Feb 2006 10:59:30 -0700\0"
  "To\0lm-sensors@lm-sensors.org\0"
  "Cc\0linux-kernel@vger.kernel.org"
  " info-linux@ldcmail.amd.com\0"
- "\00:1\0"
+ "\01:1\0"
  "b\0"
  "This patch adds support for the LM82 temperature sensor from National\n"
  "Semiconductor.  The chip is very much like the LM83 with less temperature\n"
@@ -21,13 +21,15 @@
  "Jordan Crouse\n"
  "Senior Linux Engineer\n"
  "AMD - Personal Connectivity Solutions Group\n"
- "<www.amd.com/embeddedprocessors>\n"
- "-------------- next part --------------\n"
+ <www.amd.com/embeddedprocessors>
+ "\01:2\0"
+ "fn\0hwmon-lm83.patch\0"
+ "b\0"
  "[HWMON] Add LM82 support\n"
  "\n"
  "Add LM82 thermal detector support (similar to the LM83, but less featureful).\n"
  "\n"
- "Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>\n"
+ "Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>\n"
  "---\n"
  "\n"
  " drivers/hwmon/lm83.c |   63 +++++++++++++++++++++++++++++++++++++++-----------\n"
@@ -41,7 +43,7 @@
  "  * Since the datasheet omits to give the chip stepping code, I give it\n"
  "  * here: 0x03 (at register 0xff).\n"
  "  *\n"
- "+ * <jordan.crouse at amd.com>: Added LM82 support\n"
+ "+ * <jordan.crouse@amd.com>: Added LM82 support\n"
  "+ * http://www.national.com/pf/LM/LM82.html - basically a stripped down\n"
  "+ * model of the LM83, with only two temperatures reported.  The stepping\n"
  "+ * is 0x01 (at least according to the datasheet).\n"
@@ -73,8 +75,8 @@
  "-\treturn sprintf(buf, \"%d\\n\", TEMP_FROM_REG(data->temp[attr->index]));\n"
  "+\tint index = attr->index;\n"
  "+\n"
- "+\tif (data->type = lm82) {\n"
- "+\t\tif (index = 1 || index = 5)\n"
+ "+\tif (data->type == lm82) {\n"
+ "+\t\tif (index == 1 || index == 5)\n"
  "+\t\t\tindex++;\n"
  "+\t}\n"
  "+\n"
@@ -87,8 +89,8 @@
  " \n"
  " \tdown(&data->update_lock);\n"
  "+\n"
- "+\tif (data->type = lm82) {\n"
- "+\t\tif (nr = 1 || nr = 5)\n"
+ "+\tif (data->type == lm82) {\n"
+ "+\t\tif (nr == 1 || nr == 5)\n"
  "+\t\t\tnr++;\n"
  "+\t}\n"
  "+\n"
@@ -96,17 +98,17 @@
  " \ti2c_smbus_write_byte_data(client, LM83_REG_W_HIGH[nr - 4],\n"
  " \t\t\t\t  data->temp[nr]);\n"
  "@@ -283,6 +302,9 @@ static int lm83_detect(struct i2c_adapte\n"
- " \t\t\tif (chip_id = 0x03) {\n"
+ " \t\t\tif (chip_id == 0x03) {\n"
  " \t\t\t\tkind = lm83;\n"
  " \t\t\t}\n"
- "+\t\t\telse if (chip_id = 0x01) {\n"
+ "+\t\t\telse if (chip_id == 0x01) {\n"
  "+\t\t\t\tkind = lm82;\n"
  "+\t\t\t}\n"
  " \t\t}\n"
  " \n"
  " \t\tif (kind <= 0) { /* identification failed */\n"
  "@@ -296,10 +318,15 @@ static int lm83_detect(struct i2c_adapte\n"
- " \tif (kind = lm83) {\n"
+ " \tif (kind == lm83) {\n"
  " \t\tname = \"lm83\";\n"
  " \t}\n"
  "+\telse if (kind = lm82) {\n"
@@ -150,7 +152,7 @@
  "+\n"
  " \tdevice_create_file(&new_client->dev, &dev_attr_alarms);\n"
  " \n"
- "+\tif (kind = lm83) {\n"
+ "+\tif (kind == lm83) {\n"
  "+\t\tdevice_create_file(&new_client->dev,\n"
  "+\t\t\t\t   &sensor_dev_attr_temp3_input.dev_attr);\n"
  "+\t\tdevice_create_file(&new_client->dev,\n"
@@ -171,4 +173,4 @@
  " \n"
   exit_detach:
 
-a8d2915441b2533c289b0fff68d1302ca5fc9c9bc9467f53e88ddad8bfd4ad84
+c7d2aff56c8a1e563a232661182044be21b5ca93416e5d0ea1f5ba9d9d3d4e71

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.