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
6072ace4
Commit
6072ace4
authored
Jan 18, 2009
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] checkpatch cleanups for sc520
Signed-off-by:
Dave Jones
<
davej@redhat.com
>
parent
14a6650f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
arch/x86/kernel/cpu/cpufreq/sc520_freq.c
arch/x86/kernel/cpu/cpufreq/sc520_freq.c
+17
-13
No files found.
arch/x86/kernel/cpu/cpufreq/sc520_freq.c
View file @
6072ace4
...
...
@@ -19,17 +19,19 @@
#include <linux/delay.h>
#include <linux/cpufreq.h>
#include <linux/timex.h>
#include <linux/io.h>
#include <asm/msr.h>
#include <asm/timex.h>
#include <asm/io.h>
#define MMCR_BASE 0xfffef000
/* The default base address */
#define OFFS_CPUCTL 0x2
/* CPU Control Register */
static
__u8
__iomem
*
cpuctl
;
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg)
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"sc520_freq", msg)
#define PFX "sc520_freq: "
static
struct
cpufreq_frequency_table
sc520_freq_table
[]
=
{
{
0x01
,
100000
},
...
...
@@ -43,7 +45,8 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
switch
(
clockspeed_reg
&
0x03
)
{
default:
printk
(
KERN_ERR
"sc520_freq: error: cpuctl register has unexpected value %02x
\n
"
,
clockspeed_reg
);
printk
(
KERN_ERR
PFX
"error: cpuctl register has unexpected "
"value %02x
\n
"
,
clockspeed_reg
);
case
0x01
:
return
100000
;
case
0x02
:
...
...
@@ -51,7 +54,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
}
}
static
void
sc520_freq_set_cpu_state
(
unsigned
int
state
)
static
void
sc520_freq_set_cpu_state
(
unsigned
int
state
)
{
struct
cpufreq_freqs
freqs
;
...
...
@@ -76,18 +79,19 @@ static void sc520_freq_set_cpu_state (unsigned int state)
cpufreq_notify_transition
(
&
freqs
,
CPUFREQ_POSTCHANGE
);
};
static
int
sc520_freq_verify
(
struct
cpufreq_policy
*
policy
)
static
int
sc520_freq_verify
(
struct
cpufreq_policy
*
policy
)
{
return
cpufreq_frequency_table_verify
(
policy
,
&
sc520_freq_table
[
0
]);
}
static
int
sc520_freq_target
(
struct
cpufreq_policy
*
policy
,
static
int
sc520_freq_target
(
struct
cpufreq_policy
*
policy
,
unsigned
int
target_freq
,
unsigned
int
relation
)
{
unsigned
int
newstate
=
0
;
if
(
cpufreq_frequency_table_target
(
policy
,
sc520_freq_table
,
target_freq
,
relation
,
&
newstate
))
if
(
cpufreq_frequency_table_target
(
policy
,
sc520_freq_table
,
target_freq
,
relation
,
&
newstate
))
return
-
EINVAL
;
sc520_freq_set_cpu_state
(
newstate
);
...
...
@@ -116,7 +120,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
result
=
cpufreq_frequency_table_cpuinfo
(
policy
,
sc520_freq_table
);
if
(
result
)
return
(
result
)
;
return
result
;
cpufreq_frequency_table_get_attr
(
sc520_freq_table
,
policy
->
cpu
);
...
...
@@ -131,7 +135,7 @@ static int sc520_freq_cpu_exit(struct cpufreq_policy *policy)
}
static
struct
freq_attr
*
sc520_freq_attr
[]
=
{
static
struct
freq_attr
*
sc520_freq_attr
[]
=
{
&
cpufreq_freq_attr_scaling_available_freqs
,
NULL
,
};
...
...
@@ -155,13 +159,13 @@ static int __init sc520_freq_init(void)
int
err
;
/* Test if we have the right hardware */
if
(
c
->
x86_vendor
!=
X86_VENDOR_AMD
||
c
->
x86
!=
4
||
c
->
x86_model
!=
9
)
{
if
(
c
->
x86_vendor
!=
X86_VENDOR_AMD
||
c
->
x86
!=
4
||
c
->
x86_model
!=
9
)
{
dprintk
(
"no Elan SC520 processor found!
\n
"
);
return
-
ENODEV
;
}
cpuctl
=
ioremap
((
unsigned
long
)(
MMCR_BASE
+
OFFS_CPUCTL
),
1
);
if
(
!
cpuctl
)
{
if
(
!
cpuctl
)
{
printk
(
KERN_ERR
"sc520_freq: error: failed to remap memory
\n
"
);
return
-
ENOMEM
;
}
...
...
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