Skip to contentSkip to conversation

tmp401: Add support for

RFC PATCH Andre Prendel 1 participant 2 messages May 15, 2009

lore
Share & tools
lore
#0 lore raw
Quoted 16 lines · Hans de Goede

Hi,

Review below.

Quoted 11 lines · Andre Prendel

This patch adds support for the TI TMP411 sensor chip to the TMP401 driver.
---
Index: linux-2.6/drivers/hwmon/tmp401.c
=================================> > --- linux-2.6.orig/drivers/hwmon/tmp401.c 2009-05-13 22:19:54.000000000 +0200
+++ linux-2.6/drivers/hwmon/tmp401.c 2009-05-13 23:25:03.000000000 +0200

(quoted diff) +2 -0
@@ -1,6 +1,9 @@
  /* tmp401.c
   *
   * Copyright (C) 2007,2008 Hans de Goede<[email protected]>
+ * Gabriel Konat
+ * Sander Leget
Quoted 8 lines

Review line 9

Quoted 4 lines
(quoted diff) +1 -0
+ * Wouter Willems
   *
   * 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

This looks a but strange, please make this something like:
* Preliminary tmp411 support by:
Gabriel Konat, Sander Leget & Wouter Willems

Ok, I will do it.

Quoted 30 lines

<snip>

Quoted 16 lines
(quoted diff) +16 -0
+static struct tmp401_data *tmp401_update_device_reg16(
+	struct i2c_client *client, struct tmp401_data *data)
+{
+	int i;
+
+	for (i = 0; i<  2; i++) {
+		/*
+		 * High byte must be read first immediately followed
+		 * by the low byte
+		 */
+		data->temp[i] = i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_MSB[i])<<  8;
+		data->temp[i] |= i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_LSB[i]);
+		data->temp_low[i] = i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_LOW_LIMIT_MSB_READ[i])<<  8;

Review

Quoted 10 lines
(quoted diff) +10 -0
+		data->temp_low[i] |= i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_LOW_LIMIT_LSB[i]);
+		data->temp_high[i] = i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_HIGH_LIMIT_MSB_READ[i])<<  8;
+		data->temp_high[i] |= i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_HIGH_LIMIT_LSB[i]);
+		data->temp_crit[i] = i2c_smbus_read_byte_data(client,
+			TMP401_TEMP_CRIT_LIMIT[i]);
+
+		if(data->kind = TMP411_DEVICE_ID) {

This should be:

Review

Quoted 1 line
(quoted diff) +1 -0
+		if(data->kind = tmp411) {

You're right, thanks. I will fix this.

Quoted 24 lines

!!

Quoted 4 lines
(quoted diff) +4 -0
+			data->temp_lowest[i] = i2c_smbus_read_byte_data(client,
+				TMP411_TEMP_LOWEST_MSB[i])<<  8;
+			data->temp_lowest[i] |= i2c_smbus_read_byte_data(
+				client, TMP411_TEMP_LOWEST_LSB[i]);

Review

Quoted 10 lines
(quoted diff) +10 -0
+
+			data->temp_highest[i] = i2c_smbus_read_byte_data(
+				client, TMP411_TEMP_HIGHEST_MSB[i])<<  8;
+			data->temp_highest[i] |= i2c_smbus_read_byte_data(
+				client, TMP411_TEMP_HIGHEST_LSB[i]);
+		}
+	}
+	return data;
+}
+

Other then that it looks good! I've tested this on both a tmp401 and tmp411 and with that one fix from above it works as it should on both.

Quoted 3 lines

Regards,

Hans

Andre

Quoted 5 lines

_______________________________________________
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

#1 lore raw
Quoted 7 lines · Jean Delvare
Quoted 6 lines · Hans de Goede

Review

Quoted 1 line · Andre Prendel
(quoted diff) +1 -0
+		if(data->kind = TMP411_DEVICE_ID) {

This should be:

(quoted diff) +1 -0
+		if(data->kind = tmp411) {
Quoted 7 lines
Quoted 1 line

!!

This should actually be:

		if (data->kind = tmp411) {

Something scripts/checkpatch.pl would have warned Andre about.

Sorry, I forgot to check the patch.

Andre

Quoted 8 lines
Signature · 7 lines
-- 
Jean Delvare

_______________________________________________
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