Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
0faa3146
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0faa3146
编写于
5月 13, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'spi/fix/atmel' into spi-linus
上级
f722406f
f557c98b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
9 deletion
+38
-9
drivers/spi/spi-atmel.c
drivers/spi/spi-atmel.c
+38
-9
未找到文件。
drivers/spi/spi-atmel.c
浏览文件 @
0faa3146
...
...
@@ -526,13 +526,17 @@ static void atmel_spi_next_xfer_pio(struct spi_master *master,
}
if
(
xfer
->
tx_buf
)
spi_writel
(
as
,
TDR
,
*
(
u8
*
)(
xfer
->
tx_buf
));
if
(
xfer
->
bits_per_word
>
8
)
spi_writel
(
as
,
TDR
,
*
(
u16
*
)(
xfer
->
tx_buf
));
else
spi_writel
(
as
,
TDR
,
*
(
u8
*
)(
xfer
->
tx_buf
));
else
spi_writel
(
as
,
TDR
,
0
);
dev_dbg
(
master
->
dev
.
parent
,
" start pio xfer %p: len %u tx %p rx %p
\n
"
,
xfer
,
xfer
->
len
,
xfer
->
tx_buf
,
xfer
->
rx_buf
);
" start pio xfer %p: len %u tx %p rx %p bitpw %d
\n
"
,
xfer
,
xfer
->
len
,
xfer
->
tx_buf
,
xfer
->
rx_buf
,
xfer
->
bits_per_word
);
/* Enable relevant interrupts */
spi_writel
(
as
,
IER
,
SPI_BIT
(
RDRF
)
|
SPI_BIT
(
OVRES
));
...
...
@@ -950,21 +954,39 @@ atmel_spi_pump_pio_data(struct atmel_spi *as, struct spi_transfer *xfer)
{
u8
*
txp
;
u8
*
rxp
;
u16
*
txp16
;
u16
*
rxp16
;
unsigned
long
xfer_pos
=
xfer
->
len
-
as
->
current_remaining_bytes
;
if
(
xfer
->
rx_buf
)
{
rxp
=
((
u8
*
)
xfer
->
rx_buf
)
+
xfer_pos
;
*
rxp
=
spi_readl
(
as
,
RDR
);
if
(
xfer
->
bits_per_word
>
8
)
{
rxp16
=
(
u16
*
)(((
u8
*
)
xfer
->
rx_buf
)
+
xfer_pos
);
*
rxp16
=
spi_readl
(
as
,
RDR
);
}
else
{
rxp
=
((
u8
*
)
xfer
->
rx_buf
)
+
xfer_pos
;
*
rxp
=
spi_readl
(
as
,
RDR
);
}
}
else
{
spi_readl
(
as
,
RDR
);
}
as
->
current_remaining_bytes
--
;
if
(
xfer
->
bits_per_word
>
8
)
{
as
->
current_remaining_bytes
-=
2
;
if
(
as
->
current_remaining_bytes
<
0
)
as
->
current_remaining_bytes
=
0
;
}
else
{
as
->
current_remaining_bytes
--
;
}
if
(
as
->
current_remaining_bytes
)
{
if
(
xfer
->
tx_buf
)
{
txp
=
((
u8
*
)
xfer
->
tx_buf
)
+
xfer_pos
+
1
;
spi_writel
(
as
,
TDR
,
*
txp
);
if
(
xfer
->
bits_per_word
>
8
)
{
txp16
=
(
u16
*
)(((
u8
*
)
xfer
->
tx_buf
)
+
xfer_pos
+
2
);
spi_writel
(
as
,
TDR
,
*
txp16
);
}
else
{
txp
=
((
u8
*
)
xfer
->
tx_buf
)
+
xfer_pos
+
1
;
spi_writel
(
as
,
TDR
,
*
txp
);
}
}
else
{
spi_writel
(
as
,
TDR
,
0
);
}
...
...
@@ -1378,6 +1400,13 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
}
}
if
(
xfer
->
bits_per_word
>
8
)
{
if
(
xfer
->
len
%
2
)
{
dev_dbg
(
&
spi
->
dev
,
"buffer len should be 16 bits aligned
\n
"
);
return
-
EINVAL
;
}
}
/* FIXME implement these protocol options!! */
if
(
xfer
->
speed_hz
)
{
dev_dbg
(
&
spi
->
dev
,
"no protocol options yet
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录