Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
fbb6670d
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fbb6670d
编写于
1月 19, 2012
作者:
G
Guenter Roeck
提交者:
Guenter Roeck
3月 18, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hwmon: (adm1031) Fix multi-line comments
Signed-off-by:
N
Guenter Roeck
<
linux@roeck-us.net
>
上级
94b991d4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
33 addition
and
27 deletion
+33
-27
drivers/hwmon/adm1031.c
drivers/hwmon/adm1031.c
+33
-27
未找到文件。
drivers/hwmon/adm1031.c
浏览文件 @
fbb6670d
/*
/*
adm1031.c - Part of lm_sensors, Linux kernel modules for hardware
*
adm1031.c - Part of lm_sensors, Linux kernel modules for hardware
monitoring
*
monitoring
Based on lm75.c and lm85.c
*
Based on lm75.c and lm85.c
Supports adm1030 / adm1031
*
Supports adm1030 / adm1031
Copyright (C) 2004 Alexandre d'Alton <alex@alexdalton.org>
*
Copyright (C) 2004 Alexandre d'Alton <alex@alexdalton.org>
Reworked by Jean Delvare <khali@linux-fr.org>
*
Reworked by Jean Delvare <khali@linux-fr.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; either version 2 of the License, or
*
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*
(at your option) any later version.
*
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
*/
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -80,7 +80,8 @@ struct adm1031_data {
...
@@ -80,7 +80,8 @@ struct adm1031_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
int
update_interval
;
/* In milliseconds */
unsigned
int
update_interval
;
/* In milliseconds */
/* The chan_select_table contains the possible configurations for
/*
* The chan_select_table contains the possible configurations for
* auto fan control.
* auto fan control.
*/
*/
const
auto_chan_table_t
*
chan_select_table
;
const
auto_chan_table_t
*
chan_select_table
;
...
@@ -205,7 +206,8 @@ static int AUTO_TEMP_MAX_TO_REG(int val, int reg, int pwm)
...
@@ -205,7 +206,8 @@ static int AUTO_TEMP_MAX_TO_REG(int val, int reg, int pwm)
#define GET_FAN_AUTO_BITFIELD(data, idx) \
#define GET_FAN_AUTO_BITFIELD(data, idx) \
(*(data)->chan_select_table)[FAN_CHAN_FROM_REG((data)->conf1)][idx % 2]
(*(data)->chan_select_table)[FAN_CHAN_FROM_REG((data)->conf1)][idx % 2]
/* The tables below contains the possible values for the auto fan
/*
* The tables below contains the possible values for the auto fan
* control bitfields. the index in the table is the register value.
* control bitfields. the index in the table is the register value.
* MSb is the auto fan control enable bit, so the four first entries
* MSb is the auto fan control enable bit, so the four first entries
* in the table disables auto fan control when both bitfields are zero.
* in the table disables auto fan control when both bitfields are zero.
...
@@ -226,7 +228,8 @@ static const auto_chan_table_t auto_channel_select_table_adm1030 = {
...
@@ -226,7 +228,8 @@ static const auto_chan_table_t auto_channel_select_table_adm1030 = {
{
3
/* 0b11 */
,
0
},
{
3
/* 0b11 */
,
0
},
};
};
/* That function checks if a bitfield is valid and returns the other bitfield
/*
* That function checks if a bitfield is valid and returns the other bitfield
* nearest match if no exact match where found.
* nearest match if no exact match where found.
*/
*/
static
int
static
int
...
@@ -252,7 +255,8 @@ get_fan_auto_nearest(struct adm1031_data *data,
...
@@ -252,7 +255,8 @@ get_fan_auto_nearest(struct adm1031_data *data,
break
;
break
;
}
else
if
(
val
==
(
*
data
->
chan_select_table
)[
i
][
chan
]
&&
}
else
if
(
val
==
(
*
data
->
chan_select_table
)[
i
][
chan
]
&&
first_match
==
-
1
)
{
first_match
==
-
1
)
{
/* Save the first match in case of an exact match has
/*
* Save the first match in case of an exact match has
* not been found
* not been found
*/
*/
first_match
=
i
;
first_match
=
i
;
...
@@ -306,9 +310,11 @@ set_fan_auto_channel(struct device *dev, struct device_attribute *attr,
...
@@ -306,9 +310,11 @@ set_fan_auto_channel(struct device *dev, struct device_attribute *attr,
if
((
data
->
conf1
&
ADM1031_CONF1_AUTO_MODE
)
^
if
((
data
->
conf1
&
ADM1031_CONF1_AUTO_MODE
)
^
(
old_fan_mode
&
ADM1031_CONF1_AUTO_MODE
))
{
(
old_fan_mode
&
ADM1031_CONF1_AUTO_MODE
))
{
if
(
data
->
conf1
&
ADM1031_CONF1_AUTO_MODE
)
{
if
(
data
->
conf1
&
ADM1031_CONF1_AUTO_MODE
)
{
/* Switch to Auto Fan Mode
/*
* Switch to Auto Fan Mode
* Save PWM registers
* Save PWM registers
* Set PWM registers to 33% Both */
* Set PWM registers to 33% Both
*/
data
->
old_pwm
[
0
]
=
data
->
pwm
[
0
];
data
->
old_pwm
[
0
]
=
data
->
pwm
[
0
];
data
->
old_pwm
[
1
]
=
data
->
pwm
[
1
];
data
->
old_pwm
[
1
]
=
data
->
pwm
[
1
];
adm1031_write_value
(
client
,
ADM1031_REG_PWM
,
0x55
);
adm1031_write_value
(
client
,
ADM1031_REG_PWM
,
0x55
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录