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
b049bd9d
Commit
b049bd9d
authored
Aug 20, 2007
by
Russell King
Committed by
Russell King
Oct 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] pxa: update pxa serial driver to use clk support
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
ebebd9b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
drivers/serial/pxa.c
drivers/serial/pxa.c
+23
-5
No files found.
drivers/serial/pxa.c
View file @
b049bd9d
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <linux/tty.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/tty_flip.h>
#include <linux/serial_core.h>
#include <linux/serial_core.h>
#include <linux/clk.h>
#include <asm/io.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/hardware.h>
...
@@ -55,7 +56,7 @@ struct uart_pxa_port {
...
@@ -55,7 +56,7 @@ struct uart_pxa_port {
unsigned
char
lcr
;
unsigned
char
lcr
;
unsigned
char
mcr
;
unsigned
char
mcr
;
unsigned
int
lsr_break_flag
;
unsigned
int
lsr_break_flag
;
unsigned
int
cken
;
struct
clk
*
clk
;
char
*
name
;
char
*
name
;
};
};
...
@@ -351,6 +352,8 @@ static int serial_pxa_startup(struct uart_port *port)
...
@@ -351,6 +352,8 @@ static int serial_pxa_startup(struct uart_port *port)
else
else
up
->
mcr
=
0
;
up
->
mcr
=
0
;
up
->
port
.
uartclk
=
clk_get_rate
(
up
->
clk
);
/*
/*
* Allocate the IRQ
* Allocate the IRQ
*/
*/
...
@@ -546,9 +549,11 @@ serial_pxa_pm(struct uart_port *port, unsigned int state,
...
@@ -546,9 +549,11 @@ serial_pxa_pm(struct uart_port *port, unsigned int state,
unsigned
int
oldstate
)
unsigned
int
oldstate
)
{
{
struct
uart_pxa_port
*
up
=
(
struct
uart_pxa_port
*
)
port
;
struct
uart_pxa_port
*
up
=
(
struct
uart_pxa_port
*
)
port
;
pxa_set_cken
(
up
->
cken
,
!
state
);
if
(
!
state
)
if
(
!
state
)
udelay
(
1
);
clk_enable
(
up
->
clk
);
else
clk_disable
(
up
->
clk
);
}
}
static
void
serial_pxa_release_port
(
struct
uart_port
*
port
)
static
void
serial_pxa_release_port
(
struct
uart_port
*
port
)
...
@@ -635,6 +640,8 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
...
@@ -635,6 +640,8 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
struct
uart_pxa_port
*
up
=
serial_pxa_ports
[
co
->
index
];
struct
uart_pxa_port
*
up
=
serial_pxa_ports
[
co
->
index
];
unsigned
int
ier
;
unsigned
int
ier
;
clk_enable
(
up
->
clk
);
/*
/*
* First save the IER then disable the interrupts
* First save the IER then disable the interrupts
*/
*/
...
@@ -649,6 +656,8 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
...
@@ -649,6 +656,8 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
*/
*/
wait_for_xmitr
(
up
);
wait_for_xmitr
(
up
);
serial_out
(
up
,
UART_IER
,
ier
);
serial_out
(
up
,
UART_IER
,
ier
);
clk_disable
(
up
->
clk
);
}
}
static
int
__init
static
int
__init
...
@@ -752,6 +761,12 @@ static int serial_pxa_probe(struct platform_device *dev)
...
@@ -752,6 +761,12 @@ static int serial_pxa_probe(struct platform_device *dev)
if
(
!
sport
)
if
(
!
sport
)
return
-
ENOMEM
;
return
-
ENOMEM
;
sport
->
clk
=
clk_get
(
&
dev
->
dev
,
"UARTCLK"
);
if
(
IS_ERR
(
sport
->
clk
))
{
ret
=
PTR_ERR
(
sport
->
clk
);
goto
err_free
;
}
sport
->
port
.
type
=
PORT_PXA
;
sport
->
port
.
type
=
PORT_PXA
;
sport
->
port
.
iotype
=
UPIO_MEM
;
sport
->
port
.
iotype
=
UPIO_MEM
;
sport
->
port
.
mapbase
=
mmres
->
start
;
sport
->
port
.
mapbase
=
mmres
->
start
;
...
@@ -761,7 +776,7 @@ static int serial_pxa_probe(struct platform_device *dev)
...
@@ -761,7 +776,7 @@ static int serial_pxa_probe(struct platform_device *dev)
sport
->
port
.
line
=
dev
->
id
;
sport
->
port
.
line
=
dev
->
id
;
sport
->
port
.
dev
=
&
dev
->
dev
;
sport
->
port
.
dev
=
&
dev
->
dev
;
sport
->
port
.
flags
=
UPF_IOREMAP
|
UPF_BOOT_AUTOCONF
;
sport
->
port
.
flags
=
UPF_IOREMAP
|
UPF_BOOT_AUTOCONF
;
sport
->
port
.
uartclk
=
921600
*
16
;
sport
->
port
.
uartclk
=
clk_get_rate
(
sport
->
clk
)
;
/*
/*
* Is it worth keeping this?
* Is it worth keeping this?
...
@@ -780,7 +795,7 @@ static int serial_pxa_probe(struct platform_device *dev)
...
@@ -780,7 +795,7 @@ static int serial_pxa_probe(struct platform_device *dev)
sport
->
port
.
membase
=
ioremap
(
mmres
->
start
,
mmres
->
end
-
mmres
->
start
+
1
);
sport
->
port
.
membase
=
ioremap
(
mmres
->
start
,
mmres
->
end
-
mmres
->
start
+
1
);
if
(
!
sport
->
port
.
membase
)
{
if
(
!
sport
->
port
.
membase
)
{
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
err_
free
;
goto
err_
clk
;
}
}
serial_pxa_ports
[
dev
->
id
]
=
sport
;
serial_pxa_ports
[
dev
->
id
]
=
sport
;
...
@@ -790,6 +805,8 @@ static int serial_pxa_probe(struct platform_device *dev)
...
@@ -790,6 +805,8 @@ static int serial_pxa_probe(struct platform_device *dev)
return
0
;
return
0
;
err_clk:
clk_put
(
sport
->
clk
);
err_free:
err_free:
kfree
(
sport
);
kfree
(
sport
);
return
ret
;
return
ret
;
...
@@ -802,6 +819,7 @@ static int serial_pxa_remove(struct platform_device *dev)
...
@@ -802,6 +819,7 @@ static int serial_pxa_remove(struct platform_device *dev)
platform_set_drvdata
(
dev
,
NULL
);
platform_set_drvdata
(
dev
,
NULL
);
uart_remove_one_port
(
&
serial_pxa_reg
,
&
sport
->
port
);
uart_remove_one_port
(
&
serial_pxa_reg
,
&
sport
->
port
);
clk_put
(
sport
->
clk
);
kfree
(
sport
);
kfree
(
sport
);
return
0
;
return
0
;
...
...
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