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
Kirill Smelkov
linux
Commits
b5c91666
Commit
b5c91666
authored
Jan 17, 2009
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] checkpatch cleanups for cpufreq-nforce2
Signed-off-by:
Dave Jones
<
davej@redhat.com
>
parent
fff78ad5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
+21
-17
No files found.
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
View file @
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
;
}
...
...
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