Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
9823b2d0
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9823b2d0
编写于
16年前
作者:
T
Thomas Kunze
提交者:
Thomas Kunze
15年前
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
collie: support pda_power driver
This add the pda-power platform device to collie.
上级
f1fce597
无相关合并请求
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
0 deletion
+65
-0
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/collie.c
+65
-0
未找到文件。
arch/arm/mach-sa1100/collie.c
浏览文件 @
9823b2d0
...
...
@@ -26,6 +26,7 @@
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
#include <linux/gpio.h>
#include <linux/pda_power.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
...
...
@@ -89,6 +90,69 @@ static struct mcp_plat_data collie_mcp_data = {
.
gpio_base
=
COLLIE_TC35143_GPIO_BASE
,
};
/*
* Collie AC IN
*/
static
int
collie_power_init
(
struct
device
*
dev
)
{
int
ret
=
gpio_request
(
COLLIE_GPIO_AC_IN
,
"ac in"
);
if
(
ret
)
goto
err_gpio_req
;
ret
=
gpio_direction_input
(
COLLIE_GPIO_AC_IN
);
if
(
ret
)
goto
err_gpio_in
;
return
0
;
err_gpio_in:
gpio_free
(
COLLIE_GPIO_AC_IN
);
err_gpio_req:
return
ret
;
}
static
void
collie_power_exit
(
struct
device
*
dev
)
{
gpio_free
(
COLLIE_GPIO_AC_IN
);
}
static
int
collie_power_ac_online
(
void
)
{
return
gpio_get_value
(
COLLIE_GPIO_AC_IN
)
==
2
;
}
static
char
*
collie_ac_supplied_to
[]
=
{
"main-battery"
,
"backup-battery"
,
};
static
struct
pda_power_pdata
collie_power_data
=
{
.
init
=
collie_power_init
,
.
is_ac_online
=
collie_power_ac_online
,
.
exit
=
collie_power_exit
,
.
supplied_to
=
collie_ac_supplied_to
,
.
num_supplicants
=
ARRAY_SIZE
(
collie_ac_supplied_to
),
};
static
struct
resource
collie_power_resource
[]
=
{
{
.
name
=
"ac"
,
.
start
=
gpio_to_irq
(
COLLIE_GPIO_AC_IN
),
.
end
=
gpio_to_irq
(
COLLIE_GPIO_AC_IN
),
.
flags
=
IORESOURCE_IRQ
|
IORESOURCE_IRQ_HIGHEDGE
|
IORESOURCE_IRQ_LOWEDGE
,
},
};
static
struct
platform_device
collie_power_device
=
{
.
name
=
"pda-power"
,
.
id
=
-
1
,
.
dev
.
platform_data
=
&
collie_power_data
,
.
resource
=
collie_power_resource
,
.
num_resources
=
ARRAY_SIZE
(
collie_power_resource
),
};
#ifdef CONFIG_SHARP_LOCOMO
/*
* low-level UART features.
...
...
@@ -180,6 +244,7 @@ struct platform_device collie_locomo_device = {
static
struct
platform_device
*
devices
[]
__initdata
=
{
&
collie_locomo_device
,
&
colliescoop_device
,
&
collie_power_device
,
};
static
struct
mtd_partition
collie_partitions
[]
=
{
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部