Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
6f8221c2
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看板
提交
6f8221c2
编写于
4月 05, 2009
作者:
G
Geert Uytterhoeven
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m68k: amiga - Parallel port platform device conversion
Signed-off-by:
N
Geert Uytterhoeven
<
geert@linux-m68k.org
>
上级
826e8c8c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
24 deletion
+43
-24
arch/m68k/amiga/platform.c
arch/m68k/amiga/platform.c
+3
-0
drivers/parport/parport_amiga.c
drivers/parport/parport_amiga.c
+40
-24
未找到文件。
arch/m68k/amiga/platform.c
浏览文件 @
6f8221c2
...
...
@@ -171,6 +171,9 @@ static int __init amiga_init_devices(void)
if
(
AMIGAHW_PRESENT
(
AMI_SERIAL
))
platform_device_register_simple
(
"amiga-serial"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_PARALLEL
))
platform_device_register_simple
(
"amiga-parallel"
,
-
1
,
NULL
,
0
);
return
0
;
}
...
...
drivers/parport/parport_amiga.c
浏览文件 @
6f8221c2
...
...
@@ -18,6 +18,8 @@
#include <linux/parport.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <asm/setup.h>
#include <asm/amigahw.h>
#include <asm/irq.h>
...
...
@@ -31,7 +33,6 @@
#define DPRINTK(x...) do { } while (0)
#endif
static
struct
parport
*
this_port
=
NULL
;
static
void
amiga_write_data
(
struct
parport
*
p
,
unsigned
char
data
)
{
...
...
@@ -227,18 +228,11 @@ static struct parport_operations pp_amiga_ops = {
/* ----------- Initialisation code --------------------------------- */
static
int
__init
parport_amiga_init
(
void
)
static
int
__init
amiga_parallel_probe
(
struct
platform_device
*
pdev
)
{
struct
parport
*
p
;
int
err
;
if
(
!
MACH_IS_AMIGA
||
!
AMIGAHW_PRESENT
(
AMI_PARALLEL
))
return
-
ENODEV
;
err
=
-
EBUSY
;
if
(
!
request_mem_region
(
CIAA_PHYSADDR
-
1
+
0x100
,
0x100
,
"parallel"
))
goto
out_mem
;
ciaa
.
ddrb
=
0xff
;
ciab
.
ddra
&=
0xf8
;
mb
();
...
...
@@ -246,41 +240,63 @@ static int __init parport_amiga_init(void)
p
=
parport_register_port
((
unsigned
long
)
&
ciaa
.
prb
,
IRQ_AMIGA_CIAA_FLG
,
PARPORT_DMA_NONE
,
&
pp_amiga_ops
);
if
(
!
p
)
goto
out_port
;
return
-
EBUSY
;
err
=
request_irq
(
IRQ_AMIGA_CIAA_FLG
,
parport_irq_handler
,
0
,
p
->
name
,
p
);
err
=
request_irq
(
IRQ_AMIGA_CIAA_FLG
,
parport_irq_handler
,
0
,
p
->
name
,
p
);
if
(
err
)
goto
out_irq
;
this_port
=
p
;
printk
(
KERN_INFO
"%s: Amiga built-in port using irq
\n
"
,
p
->
name
);
/* XXX: set operating mode */
parport_announce_port
(
p
);
platform_set_drvdata
(
pdev
,
p
);
return
0
;
out_irq:
parport_put_port
(
p
);
out_port:
release_mem_region
(
CIAA_PHYSADDR
-
1
+
0x100
,
0x100
);
out_mem:
return
err
;
}
static
void
__exit
parport_amiga_exit
(
void
)
static
int
__exit
amiga_parallel_remove
(
struct
platform_device
*
pdev
)
{
struct
parport
*
port
=
platform_get_drvdata
(
pdev
);
parport_remove_port
(
port
);
if
(
port
->
irq
!=
PARPORT_IRQ_NONE
)
free_irq
(
IRQ_AMIGA_CIAA_FLG
,
port
);
parport_put_port
(
port
);
platform_set_drvdata
(
pdev
,
NULL
);
return
0
;
}
static
struct
platform_driver
amiga_parallel_driver
=
{
.
remove
=
__exit_p
(
amiga_parallel_remove
),
.
driver
=
{
.
name
=
"amiga-parallel"
,
.
owner
=
THIS_MODULE
,
},
};
static
int
__init
amiga_parallel_init
(
void
)
{
return
platform_driver_probe
(
&
amiga_parallel_driver
,
amiga_parallel_probe
);
}
module_init
(
amiga_parallel_init
);
static
void
__exit
amiga_parallel_exit
(
void
)
{
parport_remove_port
(
this_port
);
if
(
this_port
->
irq
!=
PARPORT_IRQ_NONE
)
free_irq
(
IRQ_AMIGA_CIAA_FLG
,
this_port
);
parport_put_port
(
this_port
);
release_mem_region
(
CIAA_PHYSADDR
-
1
+
0x100
,
0x100
);
platform_driver_unregister
(
&
amiga_parallel_driver
);
}
module_exit
(
amiga_parallel_exit
);
MODULE_AUTHOR
(
"Joerg Dorchain <joerg@dorchain.net>"
);
MODULE_DESCRIPTION
(
"Parport Driver for Amiga builtin Port"
);
MODULE_SUPPORTED_DEVICE
(
"Amiga builtin Parallel Port"
);
MODULE_LICENSE
(
"GPL"
);
module_init
(
parport_amiga_init
)
module_exit
(
parport_amiga_exit
)
MODULE_ALIAS
(
"platform:amiga-parallel"
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录