From 3a10e755293478199d1ad9d5564c99662c4cd17b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 9 Oct 2013 15:58:33 +0000 Subject: [PATCH] Add detection of Texas Instruments TMP451 --- CHANGES | 1 + prog/detect/sensors-detect | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 53a34d95..9a24540d 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ SVN HEAD Detect incorrect non-interactive runs Rework option handling Fix use of uninitialized value 'vendor_id' on ppc64 + Add detection of TMP451 3.3.4 (2013-05-27) sensors.conf.5: Mention "sensors -u" to get the raw feature names diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index f12f9837..9d2a8b89 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2,7 +2,7 @@ # # sensors-detect - Detect hardware monitoring chips # Copyright (C) 1998 - 2002 Frodo Looijaard -# Copyright (C) 2004 - 2012 Jean Delvare +# Copyright (C) 2004 - 2013 Jean Delvare # # 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 @@ -1027,6 +1027,11 @@ use vars qw(@i2c_adapter_names); driver => "to-be-written", # tmp401 i2c_addrs => [0x4c, 0x4d], i2c_detect => sub { lm90_detect(@_, 17); }, + }, { + name => "Texas Instruments TMP451", + driver => "lm90", + i2c_addrs => [0x4c], + i2c_detect => sub { lm90_detect(@_, 18); }, }, { name => "Texas Instruments AMC6821", driver => "amc6821", @@ -4563,7 +4568,7 @@ sub max6680_95_detect # 8 = W83L771W/G, 9 = TMP401, 10 = TMP411, # 11 = W83L771AWG/ASG, 12 = MAX6690, # 13 = ADT7461A/NCT1008, 14 = SA56004, -# 15 = G781, 16 = TMP431, 17 = TMP432 +# 15 = G781, 16 = TMP431, 17 = TMP432, 18 = TMP451 # Registers used: # 0x03: Configuration # 0x04: Conversion rate @@ -4693,6 +4698,12 @@ sub lm90_detect return if $mid != 0x55; # Texas Instruments return 6 if ($cid == 0x32); # TMP432A/B } + if ($chip == 18) { + return if ($conf & 0x1B) != 0; + return if $rate > 0x09; + return if $mid != 0x55; # Texas Instruments + return 4 if ($cid == 0x00); # TMP451 + } return; }