Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ed893559
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ed893559
编写于
6月 26, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'spi/topic/xilinx' into spi-next
上级
592cd34d
913b1966
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
11 deletion
+21
-11
drivers/mfd/timberdale.c
drivers/mfd/timberdale.c
+0
-1
drivers/spi/spi-xilinx.c
drivers/spi/spi-xilinx.c
+21
-9
include/linux/spi/xilinx_spi.h
include/linux/spi/xilinx_spi.h
+0
-1
未找到文件。
drivers/mfd/timberdale.c
浏览文件 @
ed893559
...
...
@@ -145,7 +145,6 @@ static struct spi_board_info timberdale_spi_8bit_board_info[] = {
static
struct
xspi_platform_data
timberdale_xspi_platform_data
=
{
.
num_chipselect
=
3
,
.
little_endian
=
true
,
/* bits per word and devices will be filled in runtime depending
* on the HW config
*/
...
...
drivers/spi/spi-xilinx.c
浏览文件 @
ed893559
...
...
@@ -30,6 +30,7 @@
*/
#define XSPI_CR_OFFSET 0x60
/* Control Register */
#define XSPI_CR_LOOP 0x01
#define XSPI_CR_ENABLE 0x02
#define XSPI_CR_MASTER_MODE 0x04
#define XSPI_CR_CPOL 0x08
...
...
@@ -340,11 +341,12 @@ static const struct of_device_id xilinx_spi_of_match[] = {
MODULE_DEVICE_TABLE
(
of
,
xilinx_spi_of_match
);
struct
spi_master
*
xilinx_spi_init
(
struct
device
*
dev
,
struct
resource
*
mem
,
u32
irq
,
s16
bus_num
,
int
num_cs
,
int
little_endian
,
int
bits_per_word
)
u32
irq
,
s16
bus_num
,
int
num_cs
,
int
bits_per_word
)
{
struct
spi_master
*
master
;
struct
xilinx_spi
*
xspi
;
int
ret
;
u32
tmp
;
master
=
spi_alloc_master
(
dev
,
sizeof
(
struct
xilinx_spi
));
if
(
!
master
)
...
...
@@ -376,13 +378,25 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem,
xspi
->
mem
=
*
mem
;
xspi
->
irq
=
irq
;
if
(
little_endian
)
{
xspi
->
read_fn
=
xspi_read32
;
xspi
->
write_fn
=
xspi_write32
;
}
else
{
/*
* Detect endianess on the IP via loop bit in CR. Detection
* must be done before reset is sent because incorrect reset
* value generates error interrupt.
* Setup little endian helper functions first and try to use them
* and check if bit was correctly setup or not.
*/
xspi
->
read_fn
=
xspi_read32
;
xspi
->
write_fn
=
xspi_write32
;
xspi
->
write_fn
(
XSPI_CR_LOOP
,
xspi
->
regs
+
XSPI_CR_OFFSET
);
tmp
=
xspi
->
read_fn
(
xspi
->
regs
+
XSPI_CR_OFFSET
);
tmp
&=
XSPI_CR_LOOP
;
if
(
tmp
!=
XSPI_CR_LOOP
)
{
xspi
->
read_fn
=
xspi_read32_be
;
xspi
->
write_fn
=
xspi_write32_be
;
}
xspi
->
bits_per_word
=
bits_per_word
;
if
(
xspi
->
bits_per_word
==
8
)
{
xspi
->
tx_fn
=
xspi_tx8
;
...
...
@@ -446,14 +460,13 @@ static int xilinx_spi_probe(struct platform_device *dev)
{
struct
xspi_platform_data
*
pdata
;
struct
resource
*
r
;
int
irq
,
num_cs
=
0
,
little_endian
=
0
,
bits_per_word
=
8
;
int
irq
,
num_cs
=
0
,
bits_per_word
=
8
;
struct
spi_master
*
master
;
u8
i
;
pdata
=
dev
->
dev
.
platform_data
;
if
(
pdata
)
{
num_cs
=
pdata
->
num_chipselect
;
little_endian
=
pdata
->
little_endian
;
bits_per_word
=
pdata
->
bits_per_word
;
}
...
...
@@ -485,7 +498,7 @@ static int xilinx_spi_probe(struct platform_device *dev)
return
-
ENXIO
;
master
=
xilinx_spi_init
(
&
dev
->
dev
,
r
,
irq
,
dev
->
id
,
num_cs
,
little_endian
,
bits_per_word
);
bits_per_word
);
if
(
!
master
)
return
-
ENODEV
;
...
...
@@ -501,7 +514,6 @@ static int xilinx_spi_probe(struct platform_device *dev)
static
int
xilinx_spi_remove
(
struct
platform_device
*
dev
)
{
xilinx_spi_deinit
(
platform_get_drvdata
(
dev
));
platform_set_drvdata
(
dev
,
0
);
return
0
;
}
...
...
include/linux/spi/xilinx_spi.h
浏览文件 @
ed893559
...
...
@@ -11,7 +11,6 @@
*/
struct
xspi_platform_data
{
u16
num_chipselect
;
bool
little_endian
;
u8
bits_per_word
;
struct
spi_board_info
*
devices
;
u8
num_devices
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录