Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
f1b6aa87
Commit
f1b6aa87
authored
Aug 27, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc32: Convert pmc to OF driver.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
7e7e2f03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
29 deletions
+28
-29
arch/sparc/kernel/pmc.c
arch/sparc/kernel/pmc.c
+28
-29
No files found.
arch/sparc/kernel/pmc.c
View file @
f1b6aa87
...
...
@@ -10,9 +10,10 @@
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/pm.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/io.h>
#include <asm/sbus.h>
#include <asm/oplib.h>
#include <asm/uaccess.h>
#include <asm/auxio.h>
...
...
@@ -30,10 +31,9 @@
#define PMC_IDLE_REG 0x00
#define PMC_IDLE_ON 0x01
volatile
static
u8
__iomem
*
regs
;
static
int
pmc_regsize
;
static
u8
__iomem
*
regs
;
#define pmc_readb(offs)
(sbus_readb(regs+offs))
#define pmc_readb(offs) (sbus_readb(regs+offs))
#define pmc_writeb(val, offs) (sbus_writeb(val, regs+offs))
/*
...
...
@@ -53,31 +53,11 @@ void pmc_swift_idle(void)
#endif
}
static
inline
void
pmc_free
(
void
)
static
int
__devinit
pmc_probe
(
struct
of_device
*
op
,
const
struct
of_device_id
*
match
)
{
sbus_iounmap
(
regs
,
pmc_regsize
);
}
static
int
__init
pmc_probe
(
void
)
{
struct
sbus_bus
*
sbus
=
NULL
;
struct
sbus_dev
*
sdev
=
NULL
;
for_each_sbus
(
sbus
)
{
for_each_sbusdev
(
sdev
,
sbus
)
{
if
(
!
strcmp
(
sdev
->
prom_name
,
PMC_OBPNAME
))
{
goto
sbus_done
;
}
}
}
sbus_done:
if
(
!
sdev
)
{
return
-
ENODEV
;
}
pmc_regsize
=
sdev
->
reg_addrs
[
0
].
reg_size
;
regs
=
sbus_ioremap
(
&
sdev
->
resource
[
0
],
0
,
pmc_regsize
,
PMC_OBPNAME
);
regs
=
of_ioremap
(
&
op
->
resource
[
0
],
0
,
resource_size
(
&
op
->
resource
[
0
]),
PMC_OBPNAME
);
if
(
!
regs
)
{
printk
(
KERN_ERR
"%s: unable to map registers
\n
"
,
PMC_DEVNAME
);
return
-
ENODEV
;
...
...
@@ -92,8 +72,27 @@ sbus_done:
return
0
;
}
static
struct
of_device_id
pmc_match
[]
=
{
{
.
name
=
PMC_OBPNAME
,
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
pmc_match
);
static
struct
of_platform_driver
pmc_driver
=
{
.
name
=
"pmc"
,
.
match_table
=
pmc_match
,
.
probe
=
pmc_probe
,
};
static
int
__init
pmc_init
(
void
)
{
return
of_register_driver
(
&
pmc_driver
,
&
of_bus_type
);
}
/* This driver is not critical to the boot process
* and is easiest to ioremap when SBus is already
* initialized, so we install ourselves thusly:
*/
__initcall
(
pmc_
probe
);
__initcall
(
pmc_
init
);
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