Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
c1d926a5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
c1d926a5
编写于
6月 04, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'spi/fix/xilinx' into spi-linus
上级
ae6c1383
68c315bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
39 deletion
+35
-39
drivers/spi/spi-xilinx.c
drivers/spi/spi-xilinx.c
+35
-39
未找到文件。
drivers/spi/spi-xilinx.c
浏览文件 @
c1d926a5
...
...
@@ -267,7 +267,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
{
struct
xilinx_spi
*
xspi
=
spi_master_get_devdata
(
spi
->
master
);
u32
ipif_ier
;
u16
cr
;
/* We get here with transmitter inhibited */
...
...
@@ -276,7 +275,6 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
xspi
->
remaining_bytes
=
t
->
len
;
INIT_COMPLETION
(
xspi
->
done
);
xilinx_spi_fill_tx_fifo
(
xspi
);
/* Enable the transmit empty interrupt, which we use to determine
* progress on the transmission.
...
...
@@ -285,12 +283,41 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
xspi
->
write_fn
(
ipif_ier
|
XSPI_INTR_TX_EMPTY
,
xspi
->
regs
+
XIPIF_V123B_IIER_OFFSET
);
/* Start the transfer by not inhibiting the transmitter any longer */
cr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_CR_OFFSET
)
&
~
XSPI_CR_TRANS_INHIBIT
;
xspi
->
write_fn
(
cr
,
xspi
->
regs
+
XSPI_CR_OFFSET
);
for
(;;)
{
u16
cr
;
u8
sr
;
xilinx_spi_fill_tx_fifo
(
xspi
);
/* Start the transfer by not inhibiting the transmitter any
* longer
*/
cr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_CR_OFFSET
)
&
~
XSPI_CR_TRANS_INHIBIT
;
xspi
->
write_fn
(
cr
,
xspi
->
regs
+
XSPI_CR_OFFSET
);
wait_for_completion
(
&
xspi
->
done
);
/* A transmit has just completed. Process received data and
* check for more data to transmit. Always inhibit the
* transmitter while the Isr refills the transmit register/FIFO,
* or make sure it is stopped if we're done.
*/
cr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_CR_OFFSET
);
xspi
->
write_fn
(
cr
|
XSPI_CR_TRANS_INHIBIT
,
xspi
->
regs
+
XSPI_CR_OFFSET
);
/* Read out all the data from the Rx FIFO */
sr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_SR_OFFSET
);
while
((
sr
&
XSPI_SR_RX_EMPTY_MASK
)
==
0
)
{
xspi
->
rx_fn
(
xspi
);
sr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_SR_OFFSET
);
}
wait_for_completion
(
&
xspi
->
done
);
/* See if there is more data to send */
if
(
!
xspi
->
remaining_bytes
>
0
)
break
;
}
/* Disable the transmit empty interrupt */
xspi
->
write_fn
(
ipif_ier
,
xspi
->
regs
+
XIPIF_V123B_IIER_OFFSET
);
...
...
@@ -314,38 +341,7 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id)
xspi
->
write_fn
(
ipif_isr
,
xspi
->
regs
+
XIPIF_V123B_IISR_OFFSET
);
if
(
ipif_isr
&
XSPI_INTR_TX_EMPTY
)
{
/* Transmission completed */
u16
cr
;
u8
sr
;
/* A transmit has just completed. Process received data and
* check for more data to transmit. Always inhibit the
* transmitter while the Isr refills the transmit register/FIFO,
* or make sure it is stopped if we're done.
*/
cr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_CR_OFFSET
);
xspi
->
write_fn
(
cr
|
XSPI_CR_TRANS_INHIBIT
,
xspi
->
regs
+
XSPI_CR_OFFSET
);
/* Read out all the data from the Rx FIFO */
sr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_SR_OFFSET
);
while
((
sr
&
XSPI_SR_RX_EMPTY_MASK
)
==
0
)
{
xspi
->
rx_fn
(
xspi
);
sr
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_SR_OFFSET
);
}
/* See if there is more data to send */
if
(
xspi
->
remaining_bytes
>
0
)
{
xilinx_spi_fill_tx_fifo
(
xspi
);
/* Start the transfer by not inhibiting the
* transmitter any longer
*/
xspi
->
write_fn
(
cr
,
xspi
->
regs
+
XSPI_CR_OFFSET
);
}
else
{
/* No more data to send.
* Indicate the transfer is completed.
*/
complete
(
&
xspi
->
done
);
}
complete
(
&
xspi
->
done
);
}
return
IRQ_HANDLED
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录