Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
14a6650f
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
14a6650f
编写于
1月 18, 2009
作者:
D
Dave Jones
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CPUFREQ] checkpatch cleanups for powernow-k6
Signed-off-by:
N
Dave Jones
<
davej@redhat.com
>
上级
48ee923a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
18 deletion
+26
-18
arch/x86/kernel/cpu/cpufreq/powernow-k6.c
arch/x86/kernel/cpu/cpufreq/powernow-k6.c
+26
-18
未找到文件。
arch/x86/kernel/cpu/cpufreq/powernow-k6.c
浏览文件 @
14a6650f
/*
* This file was based upon code in Powertweak Linux (http://powertweak.sf.net)
* (C) 2000-2003 Dave Jones, Arjan van de Ven, Janne Pänkälä, Dominik Brodowski.
* (C) 2000-2003 Dave Jones, Arjan van de Ven, Janne Pänkälä,
* Dominik Brodowski.
*
* Licensed under the terms of the GNU GPL License version 2.
*
...
...
@@ -13,14 +14,15 @@
#include <linux/cpufreq.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <asm/msr.h>
#include <linux/timex.h>
#include <linux/io.h>
#include <asm/msr.h>
#define POWERNOW_IOPORT 0xfff0
/* it doesn't matter where, as long
as it is unused */
#define PFX "powernow-k6: "
static
unsigned
int
busfreq
;
/* FSB, in 10 kHz */
static
unsigned
int
max_multiplier
;
...
...
@@ -47,8 +49,8 @@ static struct cpufreq_frequency_table clock_ratio[] = {
*/
static
int
powernow_k6_get_cpu_multiplier
(
void
)
{
u64
invalue
=
0
;
u32
msrval
;
u64
invalue
=
0
;
u32
msrval
;
msrval
=
POWERNOW_IOPORT
+
0x1
;
wrmsr
(
MSR_K6_EPMR
,
msrval
,
0
);
/* enable the PowerNow port */
...
...
@@ -68,12 +70,12 @@ static int powernow_k6_get_cpu_multiplier(void)
*/
static
void
powernow_k6_set_state
(
unsigned
int
best_i
)
{
unsigned
long
outvalue
=
0
,
invalue
=
0
;
unsigned
long
msrval
;
struct
cpufreq_freqs
freqs
;
unsigned
long
outvalue
=
0
,
invalue
=
0
;
unsigned
long
msrval
;
struct
cpufreq_freqs
freqs
;
if
(
clock_ratio
[
best_i
].
index
>
max_multiplier
)
{
printk
(
KERN_ERR
"cpufreq:
invalid target frequency
\n
"
);
printk
(
KERN_ERR
PFX
"
invalid target frequency
\n
"
);
return
;
}
...
...
@@ -119,7 +121,8 @@ static int powernow_k6_verify(struct cpufreq_policy *policy)
* powernow_k6_setpolicy - sets a new CPUFreq policy
* @policy: new policy
* @target_freq: the target frequency
* @relation: how that frequency relates to achieved frequency (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
* @relation: how that frequency relates to achieved frequency
* (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
*
* sets a new CPUFreq policy
*/
...
...
@@ -127,9 +130,10 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
unsigned
int
target_freq
,
unsigned
int
relation
)
{
unsigned
int
newstate
=
0
;
unsigned
int
newstate
=
0
;
if
(
cpufreq_frequency_table_target
(
policy
,
&
clock_ratio
[
0
],
target_freq
,
relation
,
&
newstate
))
if
(
cpufreq_frequency_table_target
(
policy
,
&
clock_ratio
[
0
],
target_freq
,
relation
,
&
newstate
))
return
-
EINVAL
;
powernow_k6_set_state
(
newstate
);
...
...
@@ -140,7 +144,7 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
static
int
powernow_k6_cpu_init
(
struct
cpufreq_policy
*
policy
)
{
unsigned
int
i
;
unsigned
int
i
,
f
;
int
result
;
if
(
policy
->
cpu
!=
0
)
...
...
@@ -152,10 +156,11 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
/* table init */
for
(
i
=
0
;
(
clock_ratio
[
i
].
frequency
!=
CPUFREQ_TABLE_END
);
i
++
)
{
if
(
clock_ratio
[
i
].
index
>
max_multiplier
)
f
=
clock_ratio
[
i
].
index
;
if
(
f
>
max_multiplier
)
clock_ratio
[
i
].
frequency
=
CPUFREQ_ENTRY_INVALID
;
else
clock_ratio
[
i
].
frequency
=
busfreq
*
clock_ratio
[
i
].
index
;
clock_ratio
[
i
].
frequency
=
busfreq
*
f
;
}
/* cpuinfo and default policy values */
...
...
@@ -185,7 +190,9 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
static
unsigned
int
powernow_k6_get
(
unsigned
int
cpu
)
{
return
busfreq
*
powernow_k6_get_cpu_multiplier
();
unsigned
int
ret
;
ret
=
(
busfreq
*
powernow_k6_get_cpu_multiplier
());
return
ret
;
}
static
struct
freq_attr
*
powernow_k6_attr
[]
=
{
...
...
@@ -221,7 +228,7 @@ static int __init powernow_k6_init(void)
return
-
ENODEV
;
if
(
!
request_region
(
POWERNOW_IOPORT
,
16
,
"PowerNow!"
))
{
printk
(
"cpufreq:
PowerNow IOPORT region already used.
\n
"
);
printk
(
KERN_INFO
PFX
"
PowerNow IOPORT region already used.
\n
"
);
return
-
EIO
;
}
...
...
@@ -246,7 +253,8 @@ static void __exit powernow_k6_exit(void)
}
MODULE_AUTHOR
(
"Arjan van de Ven, Dave Jones <davej@redhat.com>, Dominik Brodowski <linux@brodo.de>"
);
MODULE_AUTHOR
(
"Arjan van de Ven, Dave Jones <davej@redhat.com>, "
"Dominik Brodowski <linux@brodo.de>"
);
MODULE_DESCRIPTION
(
"PowerNow! driver for AMD K6-2+ / K6-3+ processors."
);
MODULE_LICENSE
(
"GPL"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录