All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] hwmon: tmp401: support for TMP435 and fix for a probe issue
@ 2014-12-04 16:45 ` Bartosz Golaszewski
  0 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

This series adds support for the TI TMP435 chip and fixes an issue similar
to the one we observed for ina2xx - ignoring the write errors when probing the
device.

v3:
- remove the copyright notice from tmp401.c
- preinitialize status and skip an 'if'

v2:
- changed 'static const char *names' to 'static const char * const names'
  as checkpatch.pl still complained about this one,
- updated Documentation and Kconfig on TMP435,
- added missing error check in tmp401_init_client(),
- removed the redundant "Initialization failed" string since we'll get
  'tmp401: probe of X-00XX failed with error -121' anyway in dmesg,

v1:
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg781930.html

Bartosz Golaszewski (2):
  hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kconfig
  hwmon: tmp401: bail-out from tmp401_probe() in case of write errors

Patrick Titiano (1):
  hwmon: tmp401: add support for TI TMP435

 Documentation/hwmon/tmp401 |  7 +++++--
 drivers/hwmon/Kconfig      |  2 +-
 drivers/hwmon/tmp401.c     | 45 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 38 insertions(+), 16 deletions(-)

-- 
2.1.3


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

* [lm-sensors] [PATCH v3 0/3] hwmon: tmp401: support for TMP435 and fix for a probe issue
@ 2014-12-04 16:45 ` Bartosz Golaszewski
  0 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

This series adds support for the TI TMP435 chip and fixes an issue similar
to the one we observed for ina2xx - ignoring the write errors when probing the
device.

v3:
- remove the copyright notice from tmp401.c
- preinitialize status and skip an 'if'

v2:
- changed 'static const char *names' to 'static const char * const names'
  as checkpatch.pl still complained about this one,
- updated Documentation and Kconfig on TMP435,
- added missing error check in tmp401_init_client(),
- removed the redundant "Initialization failed" string since we'll get
  'tmp401: probe of X-00XX failed with error -121' anyway in dmesg,

v1:
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg781930.html

Bartosz Golaszewski (2):
  hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kconfig
  hwmon: tmp401: bail-out from tmp401_probe() in case of write errors

Patrick Titiano (1):
  hwmon: tmp401: add support for TI TMP435

 Documentation/hwmon/tmp401 |  7 +++++--
 drivers/hwmon/Kconfig      |  2 +-
 drivers/hwmon/tmp401.c     | 45 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 38 insertions(+), 16 deletions(-)

-- 
2.1.3


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* [PATCH v3 1/3] hwmon: tmp401: add support for TI TMP435
  2014-12-04 16:45 ` [lm-sensors] " Bartosz Golaszewski
@ 2014-12-04 16:45   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

From: Patrick Titiano <ptitiano@baylibre.com>

Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
[Bartosz Golaszewski: prepared for submission, code review fixes]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/hwmon/tmp401.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 7fa6e7d..ccd9938 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -46,7 +46,7 @@
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
 
-enum chips { tmp401, tmp411, tmp431, tmp432 };
+enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
 
 /*
  * The TMP401 registers, note some registers have different addresses for
@@ -136,6 +136,7 @@ static const u8 TMP432_STATUS_REG[] = {
 #define TMP411C_DEVICE_ID			0x10
 #define TMP431_DEVICE_ID			0x31
 #define TMP432_DEVICE_ID			0x32
+#define TMP435_DEVICE_ID			0x35
 
 /*
  * Driver data (common to all clients)
@@ -146,6 +147,7 @@ static const struct i2c_device_id tmp401_id[] = {
 	{ "tmp411", tmp411 },
 	{ "tmp431", tmp431 },
 	{ "tmp432", tmp432 },
+	{ "tmp435", tmp435 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tmp401_id);
@@ -684,6 +686,11 @@ static int tmp401_detect(struct i2c_client *client,
 			return -ENODEV;
 		kind = tmp432;
 		break;
+	case TMP435_DEVICE_ID:
+		if (client->addr != 0x4c)
+			return -ENODEV;
+		kind = tmp435;
+		break;
 	default:
 		return -ENODEV;
 	}
@@ -705,7 +712,9 @@ static int tmp401_detect(struct i2c_client *client,
 static int tmp401_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
-	const char *names[] = { "TMP401", "TMP411", "TMP431", "TMP432" };
+	static const char * const names[] = {
+		"TMP401", "TMP411", "TMP431", "TMP432", "TMP435"
+	};
 	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct tmp401_data *data;
-- 
2.1.3


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

* [lm-sensors] [PATCH v3 1/3] hwmon: tmp401: add support for TI TMP435
@ 2014-12-04 16:45   ` Bartosz Golaszewski
  0 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

From: Patrick Titiano <ptitiano@baylibre.com>

Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
[Bartosz Golaszewski: prepared for submission, code review fixes]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/hwmon/tmp401.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 7fa6e7d..ccd9938 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -46,7 +46,7 @@
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
 
-enum chips { tmp401, tmp411, tmp431, tmp432 };
+enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
 
 /*
  * The TMP401 registers, note some registers have different addresses for
@@ -136,6 +136,7 @@ static const u8 TMP432_STATUS_REG[] = {
 #define TMP411C_DEVICE_ID			0x10
 #define TMP431_DEVICE_ID			0x31
 #define TMP432_DEVICE_ID			0x32
+#define TMP435_DEVICE_ID			0x35
 
 /*
  * Driver data (common to all clients)
@@ -146,6 +147,7 @@ static const struct i2c_device_id tmp401_id[] = {
 	{ "tmp411", tmp411 },
 	{ "tmp431", tmp431 },
 	{ "tmp432", tmp432 },
+	{ "tmp435", tmp435 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tmp401_id);
@@ -684,6 +686,11 @@ static int tmp401_detect(struct i2c_client *client,
 			return -ENODEV;
 		kind = tmp432;
 		break;
+	case TMP435_DEVICE_ID:
+		if (client->addr != 0x4c)
+			return -ENODEV;
+		kind = tmp435;
+		break;
 	default:
 		return -ENODEV;
 	}
@@ -705,7 +712,9 @@ static int tmp401_detect(struct i2c_client *client,
 static int tmp401_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
-	const char *names[] = { "TMP401", "TMP411", "TMP431", "TMP432" };
+	static const char * const names[] = {
+		"TMP401", "TMP411", "TMP431", "TMP432", "TMP435"
+	};
 	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct tmp401_data *data;
-- 
2.1.3


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* [PATCH v3 2/3] hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kconfig
  2014-12-04 16:45 ` [lm-sensors] " Bartosz Golaszewski
@ 2014-12-04 16:45   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 Documentation/hwmon/tmp401 | 8 ++++++--
 drivers/hwmon/Kconfig      | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/hwmon/tmp401 b/Documentation/hwmon/tmp401
index f91e3fa..445ff7b 100644
--- a/Documentation/hwmon/tmp401
+++ b/Documentation/hwmon/tmp401
@@ -18,6 +18,10 @@ Supported chips:
     Prefix: 'tmp432'
     Addresses scanned: I2C 0x4c, 0x4d
     Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html
+  * Texas Instruments TMP435
+    Prefix: 'tmp435'
+    Addresses scanned: I2C 0x4c
+    Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html
 
 Authors:
          Hans de Goede <hdegoede@redhat.com>
@@ -27,8 +31,8 @@ Description
 -----------
 
 This driver implements support for Texas Instruments TMP401, TMP411,
-TMP431, and TMP432 chips. These chips implement one or two remote and
-one local temperature sensors. Temperature is measured in degrees
+TMP431, TMP432 and TMP435 chips. These chips implement one or two remote
+and one local temperature sensors. Temperature is measured in degrees
 Celsius. Resolution of the remote sensor is 0.0625 degree. Local
 sensor resolution can be set to 0.5, 0.25, 0.125 or 0.0625 degree (not
 supported by the driver so far, so using the default resolution of 0.5
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index b1ce6a0..6529c09 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1466,7 +1466,7 @@ config SENSORS_TMP401
 	depends on I2C
 	help
 	  If you say yes here you get support for Texas Instruments TMP401,
-	  TMP411, TMP431, and TMP432 temperature sensor chips.
+	  TMP411, TMP431, TMP432 and TMP435 temperature sensor chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called tmp401.
-- 
2.1.3


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

* [lm-sensors] [PATCH v3 2/3] hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kco
@ 2014-12-04 16:45   ` Bartosz Golaszewski
  0 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 Documentation/hwmon/tmp401 | 8 ++++++--
 drivers/hwmon/Kconfig      | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/hwmon/tmp401 b/Documentation/hwmon/tmp401
index f91e3fa..445ff7b 100644
--- a/Documentation/hwmon/tmp401
+++ b/Documentation/hwmon/tmp401
@@ -18,6 +18,10 @@ Supported chips:
     Prefix: 'tmp432'
     Addresses scanned: I2C 0x4c, 0x4d
     Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html
+  * Texas Instruments TMP435
+    Prefix: 'tmp435'
+    Addresses scanned: I2C 0x4c
+    Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp435.html
 
 Authors:
          Hans de Goede <hdegoede@redhat.com>
@@ -27,8 +31,8 @@ Description
 -----------
 
 This driver implements support for Texas Instruments TMP401, TMP411,
-TMP431, and TMP432 chips. These chips implement one or two remote and
-one local temperature sensors. Temperature is measured in degrees
+TMP431, TMP432 and TMP435 chips. These chips implement one or two remote
+and one local temperature sensors. Temperature is measured in degrees
 Celsius. Resolution of the remote sensor is 0.0625 degree. Local
 sensor resolution can be set to 0.5, 0.25, 0.125 or 0.0625 degree (not
 supported by the driver so far, so using the default resolution of 0.5
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index b1ce6a0..6529c09 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1466,7 +1466,7 @@ config SENSORS_TMP401
 	depends on I2C
 	help
 	  If you say yes here you get support for Texas Instruments TMP401,
-	  TMP411, TMP431, and TMP432 temperature sensor chips.
+	  TMP411, TMP431, TMP432 and TMP435 temperature sensor chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called tmp401.
-- 
2.1.3


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* [PATCH v3 3/3] hwmon: tmp401: bail-out from tmp401_probe() in case of write errors
  2014-12-04 16:45 ` [lm-sensors] " Bartosz Golaszewski
@ 2014-12-04 16:45   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

The return value of i2c_smbus_read_byte_data() is checked in
tmp401_init_client(), but only a warning is printed and the device is
registered anyway. This leads to devices being registered even if they
cannot be physically detected.

Bail-out from probe in case of write errors and notify the user.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/hwmon/tmp401.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index ccd9938..f2182ee 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -615,10 +615,10 @@ static const struct attribute_group tmp432_group = {
  * Begin non sysfs callback code (aka Real code)
  */
 
-static void tmp401_init_client(struct tmp401_data *data,
-			       struct i2c_client *client)
+static int tmp401_init_client(struct tmp401_data *data,
+			      struct i2c_client *client)
 {
-	int config, config_orig;
+	int config, config_orig, status = 0;
 
 	/* Set the conversion rate to 2 Hz */
 	i2c_smbus_write_byte_data(client, TMP401_CONVERSION_RATE_WRITE, 5);
@@ -626,16 +626,18 @@ static void tmp401_init_client(struct tmp401_data *data,
 
 	/* Start conversions (disable shutdown if necessary) */
 	config = i2c_smbus_read_byte_data(client, TMP401_CONFIG_READ);
-	if (config < 0) {
-		dev_warn(&client->dev, "Initialization failed!\n");
-		return;
-	}
+	if (config < 0)
+		return config;
 
 	config_orig = config;
 	config &= ~TMP401_CONFIG_SHUTDOWN;
 
 	if (config != config_orig)
-		i2c_smbus_write_byte_data(client, TMP401_CONFIG_WRITE, config);
+		status = i2c_smbus_write_byte_data(client,
+						   TMP401_CONFIG_WRITE,
+						   config);
+
+	return status;
 }
 
 static int tmp401_detect(struct i2c_client *client,
@@ -718,7 +720,7 @@ static int tmp401_probe(struct i2c_client *client,
 	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct tmp401_data *data;
-	int groups = 0;
+	int groups = 0, status;
 
 	data = devm_kzalloc(dev, sizeof(struct tmp401_data), GFP_KERNEL);
 	if (!data)
@@ -729,7 +731,9 @@ static int tmp401_probe(struct i2c_client *client,
 	data->kind = id->driver_data;
 
 	/* Initialize the TMP401 chip */
-	tmp401_init_client(data, client);
+	status = tmp401_init_client(data, client);
+	if (status < 0)
+		return status;
 
 	/* Register sysfs hooks */
 	data->groups[groups++] = &tmp401_group;
-- 
2.1.3


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

* [lm-sensors] [PATCH v3 3/3] hwmon: tmp401: bail-out from tmp401_probe() in case of write errors
@ 2014-12-04 16:45   ` Bartosz Golaszewski
  0 siblings, 0 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2014-12-04 16:45 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors, Bartosz Golaszewski

The return value of i2c_smbus_read_byte_data() is checked in
tmp401_init_client(), but only a warning is printed and the device is
registered anyway. This leads to devices being registered even if they
cannot be physically detected.

Bail-out from probe in case of write errors and notify the user.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/hwmon/tmp401.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index ccd9938..f2182ee 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -615,10 +615,10 @@ static const struct attribute_group tmp432_group = {
  * Begin non sysfs callback code (aka Real code)
  */
 
-static void tmp401_init_client(struct tmp401_data *data,
-			       struct i2c_client *client)
+static int tmp401_init_client(struct tmp401_data *data,
+			      struct i2c_client *client)
 {
-	int config, config_orig;
+	int config, config_orig, status = 0;
 
 	/* Set the conversion rate to 2 Hz */
 	i2c_smbus_write_byte_data(client, TMP401_CONVERSION_RATE_WRITE, 5);
@@ -626,16 +626,18 @@ static void tmp401_init_client(struct tmp401_data *data,
 
 	/* Start conversions (disable shutdown if necessary) */
 	config = i2c_smbus_read_byte_data(client, TMP401_CONFIG_READ);
-	if (config < 0) {
-		dev_warn(&client->dev, "Initialization failed!\n");
-		return;
-	}
+	if (config < 0)
+		return config;
 
 	config_orig = config;
 	config &= ~TMP401_CONFIG_SHUTDOWN;
 
 	if (config != config_orig)
-		i2c_smbus_write_byte_data(client, TMP401_CONFIG_WRITE, config);
+		status = i2c_smbus_write_byte_data(client,
+						   TMP401_CONFIG_WRITE,
+						   config);
+
+	return status;
 }
 
 static int tmp401_detect(struct i2c_client *client,
@@ -718,7 +720,7 @@ static int tmp401_probe(struct i2c_client *client,
 	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct tmp401_data *data;
-	int groups = 0;
+	int groups = 0, status;
 
 	data = devm_kzalloc(dev, sizeof(struct tmp401_data), GFP_KERNEL);
 	if (!data)
@@ -729,7 +731,9 @@ static int tmp401_probe(struct i2c_client *client,
 	data->kind = id->driver_data;
 
 	/* Initialize the TMP401 chip */
-	tmp401_init_client(data, client);
+	status = tmp401_init_client(data, client);
+	if (status < 0)
+		return status;
 
 	/* Register sysfs hooks */
 	data->groups[groups++] = &tmp401_group;
-- 
2.1.3


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH v3 0/3] hwmon: tmp401: support for TMP435 and fix for a probe issue
  2014-12-04 16:45 ` [lm-sensors] " Bartosz Golaszewski
@ 2014-12-04 19:02   ` Guenter Roeck
  -1 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2014-12-04 19:02 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors

On Thu, Dec 04, 2014 at 05:45:50PM +0100, Bartosz Golaszewski wrote:
> This series adds support for the TI TMP435 chip and fixes an issue similar
> to the one we observed for ina2xx - ignoring the write errors when probing the
> device.
> 
Series applied, with the tmp435 related patches merged into one.

Thanks,
Guenter

> v3:
> - remove the copyright notice from tmp401.c
> - preinitialize status and skip an 'if'
> 
> v2:
> - changed 'static const char *names' to 'static const char * const names'
>   as checkpatch.pl still complained about this one,
> - updated Documentation and Kconfig on TMP435,
> - added missing error check in tmp401_init_client(),
> - removed the redundant "Initialization failed" string since we'll get
>   'tmp401: probe of X-00XX failed with error -121' anyway in dmesg,
> 
> v1:
> https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg781930.html
> 
> Bartosz Golaszewski (2):
>   hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kconfig
>   hwmon: tmp401: bail-out from tmp401_probe() in case of write errors
> 
> Patrick Titiano (1):
>   hwmon: tmp401: add support for TI TMP435
> 
>  Documentation/hwmon/tmp401 |  7 +++++--
>  drivers/hwmon/Kconfig      |  2 +-
>  drivers/hwmon/tmp401.c     | 45 ++++++++++++++++++++++++++++++++-------------
>  3 files changed, 38 insertions(+), 16 deletions(-)
> 
> -- 
> 2.1.3
> 

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

* Re: [lm-sensors] [PATCH v3 0/3] hwmon: tmp401: support for TMP435 and fix for a probe issue
@ 2014-12-04 19:02   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2014-12-04 19:02 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors

On Thu, Dec 04, 2014 at 05:45:50PM +0100, Bartosz Golaszewski wrote:
> This series adds support for the TI TMP435 chip and fixes an issue similar
> to the one we observed for ina2xx - ignoring the write errors when probing the
> device.
> 
Series applied, with the tmp435 related patches merged into one.

Thanks,
Guenter

> v3:
> - remove the copyright notice from tmp401.c
> - preinitialize status and skip an 'if'
> 
> v2:
> - changed 'static const char *names' to 'static const char * const names'
>   as checkpatch.pl still complained about this one,
> - updated Documentation and Kconfig on TMP435,
> - added missing error check in tmp401_init_client(),
> - removed the redundant "Initialization failed" string since we'll get
>   'tmp401: probe of X-00XX failed with error -121' anyway in dmesg,
> 
> v1:
> https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg781930.html
> 
> Bartosz Golaszewski (2):
>   hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kconfig
>   hwmon: tmp401: bail-out from tmp401_probe() in case of write errors
> 
> Patrick Titiano (1):
>   hwmon: tmp401: add support for TI TMP435
> 
>  Documentation/hwmon/tmp401 |  7 +++++--
>  drivers/hwmon/Kconfig      |  2 +-
>  drivers/hwmon/tmp401.c     | 45 ++++++++++++++++++++++++++++++++-------------
>  3 files changed, 38 insertions(+), 16 deletions(-)
> 
> -- 
> 2.1.3
> 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH v3 1/3] hwmon: tmp401: add support for TI TMP435
  2014-12-04 16:45   ` [lm-sensors] " Bartosz Golaszewski
@ 2014-12-04 21:24 ` Guenter Roeck
  -1 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2014-12-04 21:24 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors

On Thu, Dec 04, 2014 at 05:45:51PM +0100, Bartosz Golaszewski wrote:
> From: Patrick Titiano <ptitiano@baylibre.com>
> 
> Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
> [Bartosz Golaszewski: prepared for submission, code review fixes]
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/hwmon/tmp401.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
> index 7fa6e7d..ccd9938 100644
> --- a/drivers/hwmon/tmp401.c
> +++ b/drivers/hwmon/tmp401.c
> @@ -46,7 +46,7 @@
>  /* Addresses to scan */
>  static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
>  
> -enum chips { tmp401, tmp411, tmp431, tmp432 };
> +enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
>  
>  /*
>   * The TMP401 registers, note some registers have different addresses for
> @@ -136,6 +136,7 @@ static const u8 TMP432_STATUS_REG[] = {
>  #define TMP411C_DEVICE_ID			0x10
>  #define TMP431_DEVICE_ID			0x31
>  #define TMP432_DEVICE_ID			0x32
> +#define TMP435_DEVICE_ID			0x35
>  
>  /*
>   * Driver data (common to all clients)
> @@ -146,6 +147,7 @@ static const struct i2c_device_id tmp401_id[] = {
>  	{ "tmp411", tmp411 },
>  	{ "tmp431", tmp431 },
>  	{ "tmp432", tmp432 },
> +	{ "tmp435", tmp435 },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, tmp401_id);
> @@ -684,6 +686,11 @@ static int tmp401_detect(struct i2c_client *client,
>  			return -ENODEV;
>  		kind = tmp432;
>  		break;
> +	case TMP435_DEVICE_ID:
> +		if (client->addr != 0x4c)
> +			return -ENODEV;

On second thought, is this really correct ?

I had another look into the datasheet. It seems to me that the chip
may support up to 9 different addresses, though that is a bit vague
since the datasheet first claims that the address would be 0x4c,
only to go on and list the 9 addresses (0x48 to 0x4f as well as 0x37)
in the next paragraph.

Thanks,
Guenter

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

* Re: [lm-sensors] [PATCH v3 1/3] hwmon: tmp401: add support for TI TMP435
@ 2014-12-04 21:24 ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2014-12-04 21:24 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: LKML, Benoit Cousson, Patrick Titiano, LM Sensors

On Thu, Dec 04, 2014 at 05:45:51PM +0100, Bartosz Golaszewski wrote:
> From: Patrick Titiano <ptitiano@baylibre.com>
> 
> Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
> [Bartosz Golaszewski: prepared for submission, code review fixes]
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/hwmon/tmp401.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
> index 7fa6e7d..ccd9938 100644
> --- a/drivers/hwmon/tmp401.c
> +++ b/drivers/hwmon/tmp401.c
> @@ -46,7 +46,7 @@
>  /* Addresses to scan */
>  static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
>  
> -enum chips { tmp401, tmp411, tmp431, tmp432 };
> +enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
>  
>  /*
>   * The TMP401 registers, note some registers have different addresses for
> @@ -136,6 +136,7 @@ static const u8 TMP432_STATUS_REG[] = {
>  #define TMP411C_DEVICE_ID			0x10
>  #define TMP431_DEVICE_ID			0x31
>  #define TMP432_DEVICE_ID			0x32
> +#define TMP435_DEVICE_ID			0x35
>  
>  /*
>   * Driver data (common to all clients)
> @@ -146,6 +147,7 @@ static const struct i2c_device_id tmp401_id[] = {
>  	{ "tmp411", tmp411 },
>  	{ "tmp431", tmp431 },
>  	{ "tmp432", tmp432 },
> +	{ "tmp435", tmp435 },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(i2c, tmp401_id);
> @@ -684,6 +686,11 @@ static int tmp401_detect(struct i2c_client *client,
>  			return -ENODEV;
>  		kind = tmp432;
>  		break;
> +	case TMP435_DEVICE_ID:
> +		if (client->addr != 0x4c)
> +			return -ENODEV;

On second thought, is this really correct ?

I had another look into the datasheet. It seems to me that the chip
may support up to 9 different addresses, though that is a bit vague
since the datasheet first claims that the address would be 0x4c,
only to go on and list the 9 addresses (0x48 to 0x4f as well as 0x37)
in the next paragraph.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

end of thread, other threads:[~2014-12-04 21:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-04 16:45 [PATCH v3 0/3] hwmon: tmp401: support for TMP435 and fix for a probe issue Bartosz Golaszewski
2014-12-04 16:45 ` [lm-sensors] " Bartosz Golaszewski
2014-12-04 16:45 ` [PATCH v3 1/3] hwmon: tmp401: add support for TI TMP435 Bartosz Golaszewski
2014-12-04 16:45   ` [lm-sensors] " Bartosz Golaszewski
2014-12-04 16:45 ` [PATCH v3 2/3] hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kconfig Bartosz Golaszewski
2014-12-04 16:45   ` [lm-sensors] [PATCH v3 2/3] hwmon: tmp401: add TMP435 to the list of supported chips in docs and Kco Bartosz Golaszewski
2014-12-04 16:45 ` [PATCH v3 3/3] hwmon: tmp401: bail-out from tmp401_probe() in case of write errors Bartosz Golaszewski
2014-12-04 16:45   ` [lm-sensors] " Bartosz Golaszewski
2014-12-04 19:02 ` [PATCH v3 0/3] hwmon: tmp401: support for TMP435 and fix for a probe issue Guenter Roeck
2014-12-04 19:02   ` [lm-sensors] " Guenter Roeck
2014-12-04 21:24 [PATCH v3 1/3] hwmon: tmp401: add support for TI TMP435 Guenter Roeck
2014-12-04 21:24 ` [lm-sensors] " Guenter Roeck

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.