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
826e8c8c
Commit
826e8c8c
authored
Apr 05, 2009
by
Geert Uytterhoeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m68k: amiga - Serial port platform device conversion
Signed-off-by:
Geert Uytterhoeven
<
geert@linux-m68k.org
>
parent
314c926f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
26 deletions
+38
-26
arch/m68k/amiga/platform.c
arch/m68k/amiga/platform.c
+3
-0
drivers/char/amiserial.c
drivers/char/amiserial.c
+35
-26
No files found.
arch/m68k/amiga/platform.c
View file @
826e8c8c
...
...
@@ -168,6 +168,9 @@ static int __init amiga_init_devices(void)
if
(
AMIGAHW_PRESENT
(
AMI_MOUSE
))
platform_device_register_simple
(
"amiga-mouse"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_SERIAL
))
platform_device_register_simple
(
"amiga-serial"
,
-
1
,
NULL
,
0
);
return
0
;
}
...
...
drivers/char/amiserial.c
View file @
826e8c8c
...
...
@@ -84,6 +84,7 @@ static char *serial_version = "4.30";
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <asm/setup.h>
...
...
@@ -1954,29 +1955,16 @@ static const struct tty_operations serial_ops = {
/*
* The serial driver boot-time initialization code!
*/
static
int
__init
rs_init
(
void
)
static
int
__init
amiga_serial_probe
(
struct
platform_device
*
pdev
)
{
unsigned
long
flags
;
struct
serial_state
*
state
;
int
error
;
if
(
!
MACH_IS_AMIGA
||
!
AMIGAHW_PRESENT
(
AMI_SERIAL
))
return
-
ENODEV
;
serial_driver
=
alloc_tty_driver
(
1
);
if
(
!
serial_driver
)
return
-
ENOMEM
;
/*
* We request SERDAT and SERPER only, because the serial registers are
* too spreaded over the custom register space
*/
if
(
!
request_mem_region
(
CUSTOM_PHYSADDR
+
0x30
,
4
,
"amiserial [Paula]"
))
{
error
=
-
EBUSY
;
goto
fail_put_tty_driver
;
}
IRQ_ports
=
NULL
;
show_serial_version
();
...
...
@@ -1998,7 +1986,7 @@ static int __init rs_init(void)
error
=
tty_register_driver
(
serial_driver
);
if
(
error
)
goto
fail_
release_mem_region
;
goto
fail_
put_tty_driver
;
state
=
rs_table
;
state
->
magic
=
SSTATE_MAGIC
;
...
...
@@ -2050,23 +2038,24 @@ static int __init rs_init(void)
ciab
.
ddra
|=
(
SER_DTR
|
SER_RTS
);
/* outputs */
ciab
.
ddra
&=
~
(
SER_DCD
|
SER_CTS
|
SER_DSR
);
/* inputs */
platform_set_drvdata
(
pdev
,
state
);
return
0
;
fail_free_irq:
free_irq
(
IRQ_AMIGA_TBE
,
state
);
fail_unregister:
tty_unregister_driver
(
serial_driver
);
fail_release_mem_region:
release_mem_region
(
CUSTOM_PHYSADDR
+
0x30
,
4
);
fail_put_tty_driver:
put_tty_driver
(
serial_driver
);
return
error
;
}
static
__exit
void
rs_exit
(
void
)
static
int
__exit
amiga_serial_remove
(
struct
platform_device
*
pdev
)
{
int
error
;
struct
async_struct
*
info
=
rs_table
[
0
].
info
;
struct
serial_state
*
state
=
platform_get_drvdata
(
pdev
);
struct
async_struct
*
info
=
state
->
info
;
/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
tasklet_kill
(
&
info
->
tlet
);
...
...
@@ -2075,19 +2064,38 @@ static __exit void rs_exit(void)
error
);
put_tty_driver
(
serial_driver
);
if
(
info
)
{
rs_table
[
0
].
info
=
NULL
;
kfree
(
info
);
}
rs_table
[
0
].
info
=
NULL
;
kfree
(
info
);
free_irq
(
IRQ_AMIGA_TBE
,
rs_table
);
free_irq
(
IRQ_AMIGA_RBF
,
rs_table
);
release_mem_region
(
CUSTOM_PHYSADDR
+
0x30
,
4
);
platform_set_drvdata
(
pdev
,
NULL
);
return
error
;
}
static
struct
platform_driver
amiga_serial_driver
=
{
.
remove
=
__exit_p
(
amiga_serial_remove
),
.
driver
=
{
.
name
=
"amiga-serial"
,
.
owner
=
THIS_MODULE
,
},
};
static
int
__init
amiga_serial_init
(
void
)
{
return
platform_driver_probe
(
&
amiga_serial_driver
,
amiga_serial_probe
);
}
module_init
(
amiga_serial_init
);
static
void
__exit
amiga_serial_exit
(
void
)
{
platform_driver_unregister
(
&
amiga_serial_driver
);
}
module_init
(
rs_init
)
module_exit
(
rs_exit
)
module_exit
(
amiga_serial_exit
);
#if defined(CONFIG_SERIAL_CONSOLE) && !defined(MODULE)
...
...
@@ -2154,3 +2162,4 @@ console_initcall(amiserial_console_init);
#endif
/* CONFIG_SERIAL_CONSOLE && !MODULE */
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"platform:amiga-serial"
);
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