Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b5c91666
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b5c91666
编写于
1月 17, 2009
作者:
D
Dave Jones
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CPUFREQ] checkpatch cleanups for cpufreq-nforce2
Signed-off-by:
N
Dave Jones
<
davej@redhat.com
>
上级
fff78ad5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
17 deletion
+21
-17
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
+21
-17
未找到文件。
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
浏览文件 @
b5c91666
...
...
@@ -32,7 +32,7 @@
* nforce2_chipset:
* FSB is changed using the chipset
*/
static
struct
pci_dev
*
nforce2_
chipset_
dev
;
static
struct
pci_dev
*
nforce2_dev
;
/* fid:
* multiplier * 10
...
...
@@ -56,7 +56,8 @@ MODULE_PARM_DESC(fid, "CPU multiplier to use (11.5 = 115)");
MODULE_PARM_DESC
(
min_fsb
,
"Minimum FSB to use, if not defined: current FSB - 50"
);
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg)
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"cpufreq-nforce2", msg)
/**
* nforce2_calc_fsb - calculate FSB
...
...
@@ -118,11 +119,11 @@ static void nforce2_write_pll(int pll)
int
temp
;
/* Set the pll addr. to 0x00 */
pci_write_config_dword
(
nforce2_
chipset_
dev
,
NFORCE2_PLLADR
,
0
);
pci_write_config_dword
(
nforce2_dev
,
NFORCE2_PLLADR
,
0
);
/* Now write the value in all 64 registers */
for
(
temp
=
0
;
temp
<=
0x3f
;
temp
++
)
pci_write_config_dword
(
nforce2_
chipset_
dev
,
NFORCE2_PLLREG
,
pll
);
pci_write_config_dword
(
nforce2_dev
,
NFORCE2_PLLREG
,
pll
);
return
;
}
...
...
@@ -139,8 +140,8 @@ static unsigned int nforce2_fsb_read(int bootfsb)
u32
fsb
,
temp
=
0
;
/* Get chipset boot FSB from subdevice 5 (FSB at boot-time) */
nforce2_sub5
=
pci_get_subsys
(
PCI_VENDOR_ID_NVIDIA
,
0x01EF
,
PCI_ANY_ID
,
PCI_ANY_ID
,
NULL
);
nforce2_sub5
=
pci_get_subsys
(
PCI_VENDOR_ID_NVIDIA
,
0x01EF
,
PCI_ANY_ID
,
PCI_ANY_ID
,
NULL
);
if
(
!
nforce2_sub5
)
return
0
;
...
...
@@ -148,13 +149,13 @@ static unsigned int nforce2_fsb_read(int bootfsb)
fsb
/=
1000000
;
/* Check if PLL register is already set */
pci_read_config_byte
(
nforce2_
chipset_
dev
,
NFORCE2_PLLENABLE
,
(
u8
*
)
&
temp
);
pci_read_config_byte
(
nforce2_dev
,
NFORCE2_PLLENABLE
,
(
u8
*
)
&
temp
);
if
(
bootfsb
||
!
temp
)
return
fsb
;
/* Use PLL register FSB value */
pci_read_config_dword
(
nforce2_
chipset_
dev
,
NFORCE2_PLLREG
,
&
temp
);
pci_read_config_dword
(
nforce2_dev
,
NFORCE2_PLLREG
,
&
temp
);
fsb
=
nforce2_calc_fsb
(
temp
);
return
fsb
;
...
...
@@ -185,7 +186,7 @@ static int nforce2_set_fsb(unsigned int fsb)
}
/* First write? Then set actual value */
pci_read_config_byte
(
nforce2_
chipset_
dev
,
NFORCE2_PLLENABLE
,
(
u8
*
)
&
temp
);
pci_read_config_byte
(
nforce2_dev
,
NFORCE2_PLLENABLE
,
(
u8
*
)
&
temp
);
if
(
!
temp
)
{
pll
=
nforce2_calc_pll
(
tfsb
);
...
...
@@ -197,7 +198,7 @@ static int nforce2_set_fsb(unsigned int fsb)
/* Enable write access */
temp
=
0x01
;
pci_write_config_byte
(
nforce2_
chipset_
dev
,
NFORCE2_PLLENABLE
,
(
u8
)
temp
);
pci_write_config_byte
(
nforce2_dev
,
NFORCE2_PLLENABLE
,
(
u8
)
temp
);
diff
=
tfsb
-
fsb
;
...
...
@@ -222,7 +223,7 @@ static int nforce2_set_fsb(unsigned int fsb)
}
temp
=
0x40
;
pci_write_config_byte
(
nforce2_
chipset_
dev
,
NFORCE2_PLLADR
,
(
u8
)
temp
);
pci_write_config_byte
(
nforce2_dev
,
NFORCE2_PLLADR
,
(
u8
)
temp
);
return
0
;
}
...
...
@@ -244,7 +245,8 @@ static unsigned int nforce2_get(unsigned int cpu)
* nforce2_target - set 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.
*/
...
...
@@ -328,7 +330,8 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
if
(
!
fid
)
{
if
(
!
cpu_khz
)
{
printk
(
KERN_WARNING
"cpufreq: cpu_khz not set, can't calculate multiplier!
\n
"
);
"cpufreq: cpu_khz not set, "
"can't calculate multiplier!
\n
"
);
return
-
ENODEV
;
}
...
...
@@ -392,17 +395,18 @@ static struct cpufreq_driver nforce2_driver = {
*/
static
unsigned
int
nforce2_detect_chipset
(
void
)
{
nforce2_
chipset_
dev
=
pci_get_subsys
(
PCI_VENDOR_ID_NVIDIA
,
nforce2_dev
=
pci_get_subsys
(
PCI_VENDOR_ID_NVIDIA
,
PCI_DEVICE_ID_NVIDIA_NFORCE2
,
PCI_ANY_ID
,
PCI_ANY_ID
,
NULL
);
if
(
nforce2_
chipset_
dev
==
NULL
)
if
(
nforce2_dev
==
NULL
)
return
-
ENODEV
;
printk
(
KERN_INFO
"cpufreq: Detected nForce2 chipset revision %X
\n
"
,
nforce2_
chipset_
dev
->
revision
);
nforce2_dev
->
revision
);
printk
(
KERN_INFO
"cpufreq: FSB changing is maybe unstable and can lead to crashes and data loss.
\n
"
);
"cpufreq: FSB changing is maybe unstable and can lead to "
"crashes and data loss.
\n
"
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录