Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
19f15f0e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
19f15f0e
编写于
11月 09, 2012
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'spi-core' and 'spi-tegra' into spi-next
上级
fad8f9c0
caae070c
24bc8971
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
15 addition
and
6 deletion
+15
-6
drivers/spi/spi-tegra20-slink.c
drivers/spi/spi-tegra20-slink.c
+2
-3
drivers/spi/spi.c
drivers/spi/spi.c
+13
-3
未找到文件。
drivers/spi/spi-tegra20-slink.c
浏览文件 @
19f15f0e
...
@@ -727,8 +727,7 @@ static int tegra_slink_start_transfer_one(struct spi_device *spi,
...
@@ -727,8 +727,7 @@ static int tegra_slink_start_transfer_one(struct spi_device *spi,
unsigned
long
command
;
unsigned
long
command
;
unsigned
long
command2
;
unsigned
long
command2
;
bits_per_word
=
t
->
bits_per_word
?
t
->
bits_per_word
:
bits_per_word
=
t
->
bits_per_word
;
spi
->
bits_per_word
;
speed
=
t
->
speed_hz
?
t
->
speed_hz
:
spi
->
max_speed_hz
;
speed
=
t
->
speed_hz
?
t
->
speed_hz
:
spi
->
max_speed_hz
;
if
(
!
speed
)
if
(
!
speed
)
speed
=
tspi
->
spi_max_frequency
;
speed
=
tspi
->
spi_max_frequency
;
...
@@ -1110,8 +1109,8 @@ const struct tegra_slink_chip_data tegra20_spi_cdata = {
...
@@ -1110,8 +1109,8 @@ const struct tegra_slink_chip_data tegra20_spi_cdata = {
};
};
static
struct
of_device_id
tegra_slink_of_match
[]
__devinitconst
=
{
static
struct
of_device_id
tegra_slink_of_match
[]
__devinitconst
=
{
{
.
compatible
=
"nvidia,tegra20-slink"
,
.
data
=
&
tegra20_spi_cdata
,
},
{
.
compatible
=
"nvidia,tegra30-slink"
,
.
data
=
&
tegra30_spi_cdata
,
},
{
.
compatible
=
"nvidia,tegra30-slink"
,
.
data
=
&
tegra30_spi_cdata
,
},
{
.
compatible
=
"nvidia,tegra20-slink"
,
.
data
=
&
tegra20_spi_cdata
,
},
{}
{}
};
};
MODULE_DEVICE_TABLE
(
of
,
tegra_slink_of_match
);
MODULE_DEVICE_TABLE
(
of
,
tegra_slink_of_match
);
...
...
drivers/spi/spi.c
浏览文件 @
19f15f0e
...
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL_GPL(spi_busnum_to_master);
...
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL_GPL(spi_busnum_to_master);
int
spi_setup
(
struct
spi_device
*
spi
)
int
spi_setup
(
struct
spi_device
*
spi
)
{
{
unsigned
bad_bits
;
unsigned
bad_bits
;
int
status
;
int
status
=
0
;
/* help drivers fail *cleanly* when they need options
/* help drivers fail *cleanly* when they need options
* that aren't supported with their current master
* that aren't supported with their current master
...
@@ -1171,6 +1171,7 @@ int spi_setup(struct spi_device *spi)
...
@@ -1171,6 +1171,7 @@ int spi_setup(struct spi_device *spi)
if
(
!
spi
->
bits_per_word
)
if
(
!
spi
->
bits_per_word
)
spi
->
bits_per_word
=
8
;
spi
->
bits_per_word
=
8
;
if
(
spi
->
master
->
setup
)
status
=
spi
->
master
->
setup
(
spi
);
status
=
spi
->
master
->
setup
(
spi
);
dev_dbg
(
&
spi
->
dev
,
"setup mode %d, %s%s%s%s"
dev_dbg
(
&
spi
->
dev
,
"setup mode %d, %s%s%s%s"
...
@@ -1190,6 +1191,7 @@ EXPORT_SYMBOL_GPL(spi_setup);
...
@@ -1190,6 +1191,7 @@ EXPORT_SYMBOL_GPL(spi_setup);
static
int
__spi_async
(
struct
spi_device
*
spi
,
struct
spi_message
*
message
)
static
int
__spi_async
(
struct
spi_device
*
spi
,
struct
spi_message
*
message
)
{
{
struct
spi_master
*
master
=
spi
->
master
;
struct
spi_master
*
master
=
spi
->
master
;
struct
spi_transfer
*
xfer
;
/* Half-duplex links include original MicroWire, and ones with
/* Half-duplex links include original MicroWire, and ones with
* only one data pin like SPI_3WIRE (switches direction) or where
* only one data pin like SPI_3WIRE (switches direction) or where
...
@@ -1198,7 +1200,6 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
...
@@ -1198,7 +1200,6 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
*/
*/
if
((
master
->
flags
&
SPI_MASTER_HALF_DUPLEX
)
if
((
master
->
flags
&
SPI_MASTER_HALF_DUPLEX
)
||
(
spi
->
mode
&
SPI_3WIRE
))
{
||
(
spi
->
mode
&
SPI_3WIRE
))
{
struct
spi_transfer
*
xfer
;
unsigned
flags
=
master
->
flags
;
unsigned
flags
=
master
->
flags
;
list_for_each_entry
(
xfer
,
&
message
->
transfers
,
transfer_list
)
{
list_for_each_entry
(
xfer
,
&
message
->
transfers
,
transfer_list
)
{
...
@@ -1211,6 +1212,15 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
...
@@ -1211,6 +1212,15 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
}
}
}
}
/**
* Set transfer bits_per_word as spi device default if it is not
* set for this transfer.
*/
list_for_each_entry
(
xfer
,
&
message
->
transfers
,
transfer_list
)
{
if
(
!
xfer
->
bits_per_word
)
xfer
->
bits_per_word
=
spi
->
bits_per_word
;
}
message
->
spi
=
spi
;
message
->
spi
=
spi
;
message
->
status
=
-
EINPROGRESS
;
message
->
status
=
-
EINPROGRESS
;
return
master
->
transfer
(
spi
,
message
);
return
master
->
transfer
(
spi
,
message
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录