Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
b049bd9d
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b049bd9d
编写于
8月 20, 2007
作者:
R
Russell King
提交者:
Russell King
10月 12, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ARM] pxa: update pxa serial driver to use clk support
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
ebebd9b0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
5 deletion
+23
-5
drivers/serial/pxa.c
drivers/serial/pxa.c
+23
-5
未找到文件。
drivers/serial/pxa.c
浏览文件 @
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录