Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6f8221c2
Commit
6f8221c2
authored
Apr 05, 2009
by
Geert Uytterhoeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m68k: amiga - Parallel port platform device conversion
Signed-off-by:
Geert Uytterhoeven
<
geert@linux-m68k.org
>
parent
826e8c8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
24 deletions
+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
No files found.
arch/m68k/amiga/platform.c
View file @
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
View file @
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"
);
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