aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/smsc47b397.c64
1 files changed, 34 insertions, 30 deletions
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c
index 65c88ff5645a..d3b778da3f86 100644
--- a/drivers/hwmon/smsc47b397.c
+++ b/drivers/hwmon/smsc47b397.c
@@ -1,30 +1,30 @@
1/* 1/*
2 smsc47b397.c - Part of lm_sensors, Linux kernel modules 2 * smsc47b397.c - Part of lm_sensors, Linux kernel modules
3 for hardware monitoring 3 * for hardware monitoring
4 4 *
5 Supports the SMSC LPC47B397-NC Super-I/O chip. 5 * Supports the SMSC LPC47B397-NC Super-I/O chip.
6 6 *
7 Author/Maintainer: Mark M. Hoffman <mhoffman@lightlink.com> 7 * Author/Maintainer: Mark M. Hoffman <mhoffman@lightlink.com>
8 Copyright (C) 2004 Utilitek Systems, Inc. 8 * Copyright (C) 2004 Utilitek Systems, Inc.
9 9 *
10 derived in part from smsc47m1.c: 10 * derived in part from smsc47m1.c:
11 Copyright (C) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> 11 * Copyright (C) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
12 Copyright (C) 2004 Jean Delvare <khali@linux-fr.org> 12 * Copyright (C) 2004 Jean Delvare <khali@linux-fr.org>
13 13 *
14 This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or 16 * the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version. 17 * (at your option) any later version.
18 18 *
19 This program is distributed in the hope that it will be useful, 19 * This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details. 22 * GNU General Public License for more details.
23 23 *
24 You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software 25 * along with this program; if not, write to the Free Software
26 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27*/ 27 */
28 28
29#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 29#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30 30
@@ -157,8 +157,10 @@ static struct smsc47b397_data *smsc47b397_update_device(struct device *dev)
157 return data; 157 return data;
158} 158}
159 159
160/* TEMP: 0.001C/bit (-128C to +127C) 160/*
161 REG: 1C/bit, two's complement */ 161 * TEMP: 0.001C/bit (-128C to +127C)
162 * REG: 1C/bit, two's complement
163 */
162static int temp_from_reg(u8 reg) 164static int temp_from_reg(u8 reg)
163{ 165{
164 return (s8)reg * 1000; 166 return (s8)reg * 1000;
@@ -177,8 +179,10 @@ static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 1);
177static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 2); 179static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 2);
178static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3); 180static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3);
179 181
180/* FAN: 1 RPM/bit 182/*
181 REG: count of 90kHz pulses / revolution */ 183 * FAN: 1 RPM/bit
184 * REG: count of 90kHz pulses / revolution
185 */
182static int fan_from_reg(u16 reg) 186static int fan_from_reg(u16 reg)
183{ 187{
184 if (reg == 0 || reg == 0xffff) 188 if (reg == 0 || reg == 0xffff)