diff options
author | Jean Delvare <jdelvare@suse.de> | 2015-01-24 08:16:21 -0500 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2015-01-24 08:16:21 -0500 |
commit | e3d982034dd74b32f621fcba7adeb77716fa0fb4 (patch) | |
tree | 99f2e1e28040114aba4901b2dc2c052c49d5c79f | |
parent | b8d48ce9519b21021e5875dce1a69f2941b17d1e (diff) |
hwmon: (i5500_temp) Don't bind to disabled sensors
On many motherboards, for an unknown reason, the thermal sensor seems
to be disabled and will return a constant temperature value of 36.5
degrees Celsius. Don't bind to the device in that case, so that we
don't report this bogus value to userspace.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Romain Dolbeau <romain@dolbeau.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/i5500_temp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/i5500_temp.c b/drivers/hwmon/i5500_temp.c index fdcfa9fcf5c4..fb84a0ecbbad 100644 --- a/drivers/hwmon/i5500_temp.c +++ b/drivers/hwmon/i5500_temp.c | |||
@@ -121,6 +121,8 @@ static int i5500_temp_probe(struct pci_dev *pdev, | |||
121 | { | 121 | { |
122 | int err; | 122 | int err; |
123 | struct device *hwmon_dev; | 123 | struct device *hwmon_dev; |
124 | u32 tstimer; | ||
125 | s8 tsfsc; | ||
124 | 126 | ||
125 | err = pci_enable_device(pdev); | 127 | err = pci_enable_device(pdev); |
126 | if (err) { | 128 | if (err) { |
@@ -128,6 +130,13 @@ static int i5500_temp_probe(struct pci_dev *pdev, | |||
128 | return err; | 130 | return err; |
129 | } | 131 | } |
130 | 132 | ||
133 | pci_read_config_byte(pdev, REG_TSFSC, &tsfsc); | ||
134 | pci_read_config_dword(pdev, REG_TSTIMER, &tstimer); | ||
135 | if (tsfsc == 0x7F && tstimer == 0x07D30D40) { | ||
136 | dev_warn(&pdev->dev, "Sensor seems to be disabled\n"); | ||
137 | return -ENODEV; | ||
138 | } | ||
139 | |||
131 | hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev, | 140 | hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev, |
132 | "intel5500", NULL, | 141 | "intel5500", NULL, |
133 | i5500_temp_groups); | 142 | i5500_temp_groups); |