Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9eb16864
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,发现更多精彩内容 >>
提交
9eb16864
编写于
9月 10, 2008
作者:
K
Kyle McMartin
提交者:
Kyle McMartin
10月 10, 2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parisc: add rtc platform driver
Signed-off-by:
N
Kyle McMartin
<
kyle@mcmartin.ca
>
上级
f0514ae3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
141 addition
and
1 deletion
+141
-1
arch/parisc/Kconfig
arch/parisc/Kconfig
+2
-0
arch/parisc/kernel/time.c
arch/parisc/kernel/time.c
+19
-1
drivers/rtc/Kconfig
drivers/rtc/Kconfig
+8
-0
drivers/rtc/Makefile
drivers/rtc/Makefile
+1
-0
drivers/rtc/rtc-parisc.c
drivers/rtc/rtc-parisc.c
+111
-0
未找到文件。
arch/parisc/Kconfig
浏览文件 @
9eb16864
...
...
@@ -9,6 +9,8 @@ config PARISC
def_bool y
select HAVE_IDE
select HAVE_OPROFILE
select RTC_CLASS
select RTC_DRV_PARISC
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
in many of their workstations & servers (HP9000 700 and 800 series,
...
...
arch/parisc/kernel/time.c
浏览文件 @
9eb16864
...
...
@@ -23,6 +23,7 @@
#include <linux/smp.h>
#include <linux/profile.h>
#include <linux/clocksource.h>
#include <linux/platform_device.h>
#include <asm/uaccess.h>
#include <asm/io.h>
...
...
@@ -215,6 +216,24 @@ void __init start_cpu_itimer(void)
cpu_data
[
cpu
].
it_value
=
next_tick
;
}
struct
platform_device
rtc_parisc_dev
=
{
.
name
=
"rtc-parisc"
,
.
id
=
-
1
,
};
static
int
__init
rtc_init
(
void
)
{
int
ret
;
ret
=
platform_device_register
(
&
rtc_parisc_dev
);
if
(
ret
<
0
)
printk
(
KERN_ERR
"unable to register rtc device...
\n
"
);
/* not necessarily an error */
return
0
;
}
module_init
(
rtc_init
);
void
__init
time_init
(
void
)
{
static
struct
pdc_tod
tod_data
;
...
...
@@ -245,4 +264,3 @@ void __init time_init(void)
xtime
.
tv_nsec
=
0
;
}
}
drivers/rtc/Kconfig
浏览文件 @
9eb16864
...
...
@@ -575,6 +575,14 @@ config RTC_DRV_RS5C313
help
If you say yes here you get support for the Ricoh RS5C313 RTC chips.
config RTC_DRV_PARISC
tristate "PA-RISC firmware RTC support"
depends on PARISC
help
Say Y or M here to enable RTC support on PA-RISC systems using
firmware calls. If you do not know what you are doing, you should
just say Y.
config RTC_DRV_PPC
tristate "PowerPC machine dependent RTC support"
depends on PPC_MERGE
...
...
drivers/rtc/Makefile
浏览文件 @
9eb16864
...
...
@@ -45,6 +45,7 @@ obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o
obj-$(CONFIG_RTC_DRV_PCF8583)
+=
rtc-pcf8583.o
obj-$(CONFIG_RTC_DRV_PL030)
+=
rtc-pl030.o
obj-$(CONFIG_RTC_DRV_PL031)
+=
rtc-pl031.o
obj-$(CONFIG_RTC_DRV_PARISC)
+=
rtc-parisc.o
obj-$(CONFIG_RTC_DRV_PPC)
+=
rtc-ppc.o
obj-$(CONFIG_RTC_DRV_R9701)
+=
rtc-r9701.o
obj-$(CONFIG_RTC_DRV_RS5C313)
+=
rtc-rs5c313.o
...
...
drivers/rtc/rtc-parisc.c
0 → 100644
浏览文件 @
9eb16864
/* rtc-parisc: RTC for HP PA-RISC firmware
*
* Copyright (C) 2008 Kyle McMartin <kyle@mcmartin.ca>
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/platform_device.h>
#include <asm/rtc.h>
/* as simple as can be, and no simpler. */
struct
parisc_rtc
{
struct
rtc_device
*
rtc
;
spinlock_t
lock
;
};
static
int
parisc_get_time
(
struct
device
*
dev
,
struct
rtc_time
*
tm
)
{
struct
parisc_rtc
*
p
=
dev_get_drvdata
(
dev
);
unsigned
long
flags
,
ret
;
spin_lock_irqsave
(
&
p
->
lock
,
flags
);
ret
=
get_rtc_time
(
tm
);
spin_unlock_irqrestore
(
&
p
->
lock
,
flags
);
if
(
ret
&
RTC_BATT_BAD
)
return
-
EOPNOTSUPP
;
return
0
;
}
static
int
parisc_set_time
(
struct
device
*
dev
,
struct
rtc_time
*
tm
)
{
struct
parisc_rtc
*
p
=
dev_get_drvdata
(
dev
);
unsigned
long
flags
,
ret
;
spin_lock_irqsave
(
&
p
->
lock
,
flags
);
ret
=
set_rtc_time
(
tm
);
spin_unlock_irqrestore
(
&
p
->
lock
,
flags
);
if
(
ret
<
0
)
return
-
EOPNOTSUPP
;
return
0
;
}
static
const
struct
rtc_class_ops
parisc_rtc_ops
=
{
.
read_time
=
parisc_get_time
,
.
set_time
=
parisc_set_time
,
};
static
int
__devinit
parisc_rtc_probe
(
struct
platform_device
*
dev
)
{
struct
parisc_rtc
*
p
;
p
=
kzalloc
(
sizeof
(
*
p
),
GFP_KERNEL
);
if
(
!
p
)
return
-
ENOMEM
;
spin_lock_init
(
&
p
->
lock
);
p
->
rtc
=
rtc_device_register
(
"rtc-parisc"
,
&
dev
->
dev
,
&
parisc_rtc_ops
,
THIS_MODULE
);
if
(
IS_ERR
(
p
->
rtc
))
{
int
err
=
PTR_ERR
(
p
->
rtc
);
kfree
(
p
);
return
err
;
}
platform_set_drvdata
(
dev
,
p
);
return
0
;
}
static
int
__devexit
parisc_rtc_remove
(
struct
platform_device
*
dev
)
{
struct
parisc_rtc
*
p
=
platform_get_drvdata
(
dev
);
rtc_device_unregister
(
p
->
rtc
);
kfree
(
p
);
return
0
;
}
static
struct
platform_driver
parisc_rtc_driver
=
{
.
driver
=
{
.
name
=
"rtc-parisc"
,
.
owner
=
THIS_MODULE
,
},
.
probe
=
parisc_rtc_probe
,
.
remove
=
__devexit_p
(
parisc_rtc_remove
),
};
static
int
__init
parisc_rtc_init
(
void
)
{
return
platform_driver_register
(
&
parisc_rtc_driver
);
}
static
void
__exit
parisc_rtc_fini
(
void
)
{
platform_driver_unregister
(
&
parisc_rtc_driver
);
}
module_init
(
parisc_rtc_init
);
module_exit
(
parisc_rtc_fini
);
MODULE_AUTHOR
(
"Kyle McMartin <kyle@mcmartin.ca>"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DESCRIPTION
(
"HP PA-RISC RTC driver"
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录