aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/emc2103.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/emc2103.c')
-rw-r--r--drivers/hwmon/emc2103.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c
index 0f51382df80a..9691f664c76e 100644
--- a/drivers/hwmon/emc2103.c
+++ b/drivers/hwmon/emc2103.c
@@ -1,21 +1,21 @@
1/* 1/*
2 emc2103.c - Support for SMSC EMC2103 2 * emc2103.c - Support for SMSC EMC2103
3 Copyright (c) 2010 SMSC 3 * Copyright (c) 2010 SMSC
4 4 *
5 This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 * (at your option) any later version.
9 9 *
10 This program is distributed in the hope that it will be useful, 10 * This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 * GNU General Public License for more details.
14 14 *
15 You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/ 18 */
19 19
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/init.h> 21#include <linux/init.h>
@@ -48,12 +48,14 @@ static const u8 REG_TEMP_MAX[4] = { 0x34, 0x30, 0x31, 0x32 };
48/* equation 4 from datasheet: rpm = (3932160 * multipler) / count */ 48/* equation 4 from datasheet: rpm = (3932160 * multipler) / count */
49#define FAN_RPM_FACTOR 3932160 49#define FAN_RPM_FACTOR 3932160
50 50
51/* 2103-2 and 2103-4's 3rd temperature sensor can be connected to two diodes 51/*
52 * 2103-2 and 2103-4's 3rd temperature sensor can be connected to two diodes
52 * in anti-parallel mode, and in this configuration both can be read 53 * in anti-parallel mode, and in this configuration both can be read
53 * independently (so we have 4 temperature inputs). The device can't 54 * independently (so we have 4 temperature inputs). The device can't
54 * detect if it's connected in this mode, so we have to manually enable 55 * detect if it's connected in this mode, so we have to manually enable
55 * it. Default is to leave the device in the state it's already in (-1). 56 * it. Default is to leave the device in the state it's already in (-1).
56 * This parameter allows APD mode to be optionally forced on or off */ 57 * This parameter allows APD mode to be optionally forced on or off
58 */
57static int apd = -1; 59static int apd = -1;
58module_param(apd, bint, 0); 60module_param(apd, bint, 0);
59MODULE_PARM_DESC(init, "Set to zero to disable anti-parallel diode mode"); 61MODULE_PARM_DESC(init, "Set to zero to disable anti-parallel diode mode");
@@ -302,10 +304,12 @@ show_fan_div(struct device *dev, struct device_attribute *da, char *buf)
302 return sprintf(buf, "%d\n", fan_div); 304 return sprintf(buf, "%d\n", fan_div);
303} 305}
304 306
305/* Note: we also update the fan target here, because its value is 307/*
306 determined in part by the fan clock divider. This follows the principle 308 * Note: we also update the fan target here, because its value is
307 of least surprise; the user doesn't expect the fan target to change just 309 * determined in part by the fan clock divider. This follows the principle
308 because the divider changed. */ 310 * of least surprise; the user doesn't expect the fan target to change just
311 * because the divider changed.
312 */
309static ssize_t set_fan_div(struct device *dev, struct device_attribute *da, 313static ssize_t set_fan_div(struct device *dev, struct device_attribute *da,
310 const char *buf, size_t count) 314 const char *buf, size_t count)
311{ 315{