Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
01d9def5
Commit
01d9def5
authored
Jan 19, 2012
by
Guenter Roeck
Committed by
Guenter Roeck
Mar 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hwmon: (w83l786ng) Fix multi-line comments
Signed-off-by:
Guenter Roeck
<
linux@roeck-us.net
>
parent
130067d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
32 deletions
+36
-32
drivers/hwmon/w83l786ng.c
drivers/hwmon/w83l786ng.c
+36
-32
No files found.
drivers/hwmon/w83l786ng.c
View file @
01d9def5
/*
/*
w83l786ng.c - Linux kernel driver for hardware monitoring
*
w83l786ng.c - Linux kernel driver for hardware monitoring
Copyright (c) 2007 Kevin Lo <kevlo@kevlo.org>
*
Copyright (c) 2007 Kevin Lo <kevlo@kevlo.org>
*
This program is free software; you can redistribute it and/or modify
*
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
*
it under the terms of the GNU General Public License as published by
the Free Software Foundation - version 2.
*
the Free Software Foundation - version 2.
*
This program is distributed in the hope that it will be useful,
*
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
*
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*
GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License
*
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
*
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
*
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*
02110-1301 USA.
*/
*/
/*
/*
Supports following chips:
*
Supports following chips:
*
Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
*
Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
w83l786ng 3 2 2 2 0x7b 0x5ca3 yes no
*
w83l786ng 3 2 2 2 0x7b 0x5ca3 yes no
*/
*/
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -100,9 +100,11 @@ FAN_TO_REG(long rpm, int div)
...
@@ -100,9 +100,11 @@ FAN_TO_REG(long rpm, int div)
#define TEMP_FROM_REG(val) (((val) & 0x80 ? \
#define TEMP_FROM_REG(val) (((val) & 0x80 ? \
(val) - 0x100 : (val)) * 1000)
(val) - 0x100 : (val)) * 1000)
/* The analog voltage inputs have 8mV LSB. Since the sysfs output is
/*
in mV as would be measured on the chip input pin, need to just
* The analog voltage inputs have 8mV LSB. Since the sysfs output is
multiply/divide by 8 to translate from/to register values. */
* in mV as would be measured on the chip input pin, need to just
* multiply/divide by 8 to translate from/to register values.
*/
#define IN_TO_REG(val) (SENSORS_LIMIT((((val) + 4) / 8), 0, 255))
#define IN_TO_REG(val) (SENSORS_LIMIT((((val) + 4) / 8), 0, 255))
#define IN_FROM_REG(val) ((val) * 8)
#define IN_FROM_REG(val) ((val) * 8)
...
@@ -127,7 +129,7 @@ struct w83l786ng_data {
...
@@ -127,7 +129,7 @@ struct w83l786ng_data {
char
valid
;
/* !=0 if following fields are valid */
char
valid
;
/* !=0 if following fields are valid */
unsigned
long
last_updated
;
/* In jiffies */
unsigned
long
last_updated
;
/* In jiffies */
unsigned
long
last_nonvolatile
;
/* In jiffies, last time we update the
unsigned
long
last_nonvolatile
;
/* In jiffies, last time we update the
nonvolatile registers */
*
nonvolatile registers */
u8
in
[
3
];
u8
in
[
3
];
u8
in_max
[
3
];
u8
in_max
[
3
];
...
@@ -139,10 +141,10 @@ struct w83l786ng_data {
...
@@ -139,10 +141,10 @@ struct w83l786ng_data {
u8
temp
[
2
][
3
];
u8
temp
[
2
][
3
];
u8
pwm
[
2
];
u8
pwm
[
2
];
u8
pwm_mode
[
2
];
/* 0->DC variable voltage
u8
pwm_mode
[
2
];
/* 0->DC variable voltage
1->PWM variable duty cycle */
*
1->PWM variable duty cycle */
u8
pwm_enable
[
2
];
/* 1->manual
u8
pwm_enable
[
2
];
/* 1->manual
2->thermal cruise (also called SmartFan I) */
*
2->thermal cruise (also called SmartFan I) */
u8
tolerance
[
2
];
u8
tolerance
[
2
];
};
};
...
@@ -285,10 +287,12 @@ show_fan_div(struct device *dev, struct device_attribute *attr,
...
@@ -285,10 +287,12 @@ show_fan_div(struct device *dev, struct device_attribute *attr,
return
sprintf
(
buf
,
"%u
\n
"
,
DIV_FROM_REG
(
data
->
fan_div
[
nr
]));
return
sprintf
(
buf
,
"%u
\n
"
,
DIV_FROM_REG
(
data
->
fan_div
[
nr
]));
}
}
/* Note: we save and restore the fan minimum here, because its value is
/*
determined in part by the fan divisor. This follows the principle of
* Note: we save and restore the fan minimum here, because its value is
least surprise; the user doesn't expect the fan minimum to change just
* determined in part by the fan divisor. This follows the principle of
because the divisor changed. */
* least surprise; the user doesn't expect the fan minimum to change just
* because the divisor changed.
*/
static
ssize_t
static
ssize_t
store_fan_div
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
store_fan_div
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
const
char
*
buf
,
size_t
count
)
const
char
*
buf
,
size_t
count
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment