Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
abbce6e2
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
abbce6e2
编写于
6月 29, 2006
作者:
D
David S. Miller
提交者:
David S. Miller
6月 29, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64] power: Convert to of_driver.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
f2ad06a2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
39 deletion
+18
-39
arch/sparc64/kernel/power.c
arch/sparc64/kernel/power.c
+18
-39
未找到文件。
arch/sparc64/kernel/power.c
浏览文件 @
abbce6e2
...
...
@@ -17,9 +17,10 @@
#include <linux/pm.h>
#include <asm/system.h>
#include <asm/ebus.h>
#include <asm/isa.h>
#include <asm/auxio.h>
#include <asm/prom.h>
#include <asm/of_device.h>
#include <asm/io.h>
#include <linux/unistd.h>
...
...
@@ -30,6 +31,7 @@
int
scons_pwroff
=
1
;
#ifdef CONFIG_PCI
#include <linux/pci.h>
static
void
__iomem
*
power_reg
;
static
DECLARE_WAIT_QUEUE_HEAD
(
powerd_wait
);
...
...
@@ -115,18 +117,22 @@ static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
return
1
;
}
static
void
__devinit
power_probe_common
(
struct
of_device
*
dev
,
struct
resource
*
res
,
unsigned
int
irq
)
static
int
__devinit
power_probe
(
struct
of_device
*
op
,
const
struct
of_device_id
*
match
)
{
power_reg
=
ioremap
(
res
->
start
,
0x4
);
struct
resource
*
res
=
&
op
->
resource
[
0
];
unsigned
int
irq
=
op
->
irqs
[
0
];
printk
(
"power: Control reg at %p ... "
,
power_reg
);
power_reg
=
of_ioremap
(
res
,
0
,
0x4
,
"power"
);
printk
(
"%s: Control reg at %lx ... "
,
op
->
node
->
name
,
res
->
start
);
poweroff_method
=
machine_halt
;
/* able to use the standard halt */
if
(
has_button_interrupt
(
irq
,
dev
->
node
))
{
if
(
has_button_interrupt
(
irq
,
op
->
node
))
{
if
(
kernel_thread
(
powerd
,
NULL
,
CLONE_FS
)
<
0
)
{
printk
(
"Failed to start power daemon.
\n
"
);
return
;
return
0
;
}
printk
(
"powerd running.
\n
"
);
...
...
@@ -136,6 +142,8 @@ static void __devinit power_probe_common(struct of_device *dev, struct resource
}
else
{
printk
(
"not using powerd.
\n
"
);
}
return
0
;
}
static
struct
of_device_id
power_match
[]
=
{
...
...
@@ -145,44 +153,15 @@ static struct of_device_id power_match[] = {
{},
};
static
int
__devinit
ebus_power_probe
(
struct
of_device
*
dev
,
const
struct
of_device_id
*
match
)
{
struct
linux_ebus_device
*
edev
=
to_ebus_device
(
&
dev
->
dev
);
struct
resource
*
res
=
&
edev
->
resource
[
0
];
unsigned
int
irq
=
edev
->
irqs
[
0
];
power_probe_common
(
dev
,
res
,
irq
);
return
0
;
}
static
struct
of_platform_driver
ebus_power_driver
=
{
.
name
=
"power"
,
.
match_table
=
power_match
,
.
probe
=
ebus_power_probe
,
};
static
int
__devinit
isa_power_probe
(
struct
of_device
*
dev
,
const
struct
of_device_id
*
match
)
{
struct
sparc_isa_device
*
idev
=
to_isa_device
(
&
dev
->
dev
);
struct
resource
*
res
=
&
idev
->
resource
;
unsigned
int
irq
=
idev
->
irq
;
power_probe_common
(
dev
,
res
,
irq
);
return
0
;
}
static
struct
of_platform_driver
isa_power_driver
=
{
static
struct
of_platform_driver
power_driver
=
{
.
name
=
"power"
,
.
match_table
=
power_match
,
.
probe
=
isa_
power_probe
,
.
probe
=
power_probe
,
};
void
__init
power_init
(
void
)
{
of_register_driver
(
&
ebus_power_driver
,
&
ebus_bus_type
);
of_register_driver
(
&
isa_power_driver
,
&
isa_bus_type
);
of_register_driver
(
&
power_driver
,
&
of_bus_type
);
return
;
}
#endif
/* CONFIG_PCI */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录