Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
f91c75d6
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看板
提交
f91c75d6
编写于
3月 11, 2016
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'spi/topic/doc', 'spi/topic/dw' and 'spi/topic/flash' into spi-next
上级
6beb9fec
ee7683a3
2f6fdefb
49023d2e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
19 deletion
+21
-19
drivers/spi/spi-dw-mid.c
drivers/spi/spi-dw-mid.c
+2
-2
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-dw-mmio.c
+0
-5
drivers/spi/spi.c
drivers/spi/spi.c
+17
-12
include/linux/spi/spi.h
include/linux/spi/spi.h
+2
-0
未找到文件。
drivers/spi/spi-dw-mid.c
浏览文件 @
f91c75d6
...
@@ -89,10 +89,10 @@ static void mid_spi_dma_exit(struct dw_spi *dws)
...
@@ -89,10 +89,10 @@ static void mid_spi_dma_exit(struct dw_spi *dws)
if
(
!
dws
->
dma_inited
)
if
(
!
dws
->
dma_inited
)
return
;
return
;
dmaengine_terminate_
all
(
dws
->
txchan
);
dmaengine_terminate_
sync
(
dws
->
txchan
);
dma_release_channel
(
dws
->
txchan
);
dma_release_channel
(
dws
->
txchan
);
dmaengine_terminate_
all
(
dws
->
rxchan
);
dmaengine_terminate_
sync
(
dws
->
rxchan
);
dma_release_channel
(
dws
->
rxchan
);
dma_release_channel
(
dws
->
rxchan
);
}
}
...
...
drivers/spi/spi-dw-mmio.c
浏览文件 @
f91c75d6
...
@@ -47,11 +47,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
...
@@ -47,11 +47,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
/* Get basic io resource and map it */
/* Get basic io resource and map it */
mem
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
mem
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
mem
)
{
dev_err
(
&
pdev
->
dev
,
"no mem resource?
\n
"
);
return
-
EINVAL
;
}
dws
->
regs
=
devm_ioremap_resource
(
&
pdev
->
dev
,
mem
);
dws
->
regs
=
devm_ioremap_resource
(
&
pdev
->
dev
,
mem
);
if
(
IS_ERR
(
dws
->
regs
))
{
if
(
IS_ERR
(
dws
->
regs
))
{
dev_err
(
&
pdev
->
dev
,
"SPI region map failed
\n
"
);
dev_err
(
&
pdev
->
dev
,
"SPI region map failed
\n
"
);
...
...
drivers/spi/spi.c
浏览文件 @
f91c75d6
...
@@ -1047,6 +1047,7 @@ EXPORT_SYMBOL_GPL(spi_finalize_current_transfer);
...
@@ -1047,6 +1047,7 @@ EXPORT_SYMBOL_GPL(spi_finalize_current_transfer);
* __spi_pump_messages - function which processes spi message queue
* __spi_pump_messages - function which processes spi message queue
* @master: master to process queue for
* @master: master to process queue for
* @in_kthread: true if we are in the context of the message pump thread
* @in_kthread: true if we are in the context of the message pump thread
* @bus_locked: true if the bus mutex is held when calling this function
*
*
* This function checks if there is any spi message in the queue that
* This function checks if there is any spi message in the queue that
* needs processing and if so call out to the driver to initialize hardware
* needs processing and if so call out to the driver to initialize hardware
...
@@ -1056,7 +1057,8 @@ EXPORT_SYMBOL_GPL(spi_finalize_current_transfer);
...
@@ -1056,7 +1057,8 @@ EXPORT_SYMBOL_GPL(spi_finalize_current_transfer);
* inside spi_sync(); the queue extraction handling at the top of the
* inside spi_sync(); the queue extraction handling at the top of the
* function should deal with this safely.
* function should deal with this safely.
*/
*/
static
void
__spi_pump_messages
(
struct
spi_master
*
master
,
bool
in_kthread
)
static
void
__spi_pump_messages
(
struct
spi_master
*
master
,
bool
in_kthread
,
bool
bus_locked
)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
bool
was_busy
=
false
;
bool
was_busy
=
false
;
...
@@ -1152,7 +1154,9 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
...
@@ -1152,7 +1154,9 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
}
}
}
}
mutex_lock
(
&
master
->
bus_lock_mutex
);
if
(
!
bus_locked
)
mutex_lock
(
&
master
->
bus_lock_mutex
);
trace_spi_message_start
(
master
->
cur_msg
);
trace_spi_message_start
(
master
->
cur_msg
);
if
(
master
->
prepare_message
)
{
if
(
master
->
prepare_message
)
{
...
@@ -1162,8 +1166,7 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
...
@@ -1162,8 +1166,7 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
"failed to prepare message: %d
\n
"
,
ret
);
"failed to prepare message: %d
\n
"
,
ret
);
master
->
cur_msg
->
status
=
ret
;
master
->
cur_msg
->
status
=
ret
;
spi_finalize_current_message
(
master
);
spi_finalize_current_message
(
master
);
mutex_unlock
(
&
master
->
bus_lock_mutex
);
goto
out
;
return
;
}
}
master
->
cur_msg_prepared
=
true
;
master
->
cur_msg_prepared
=
true
;
}
}
...
@@ -1172,21 +1175,23 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
...
@@ -1172,21 +1175,23 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
if
(
ret
)
{
if
(
ret
)
{
master
->
cur_msg
->
status
=
ret
;
master
->
cur_msg
->
status
=
ret
;
spi_finalize_current_message
(
master
);
spi_finalize_current_message
(
master
);
mutex_unlock
(
&
master
->
bus_lock_mutex
);
goto
out
;
return
;
}
}
ret
=
master
->
transfer_one_message
(
master
,
master
->
cur_msg
);
ret
=
master
->
transfer_one_message
(
master
,
master
->
cur_msg
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
&
master
->
dev
,
dev_err
(
&
master
->
dev
,
"failed to transfer one message from queue
\n
"
);
"failed to transfer one message from queue
\n
"
);
mutex_unlock
(
&
master
->
bus_lock_mutex
);
goto
out
;
return
;
}
}
mutex_unlock
(
&
master
->
bus_lock_mutex
);
out:
if
(
!
bus_locked
)
mutex_unlock
(
&
master
->
bus_lock_mutex
);
/* Prod the scheduler in case transfer_one() was busy waiting */
/* Prod the scheduler in case transfer_one() was busy waiting */
cond_resched
();
if
(
!
ret
)
cond_resched
();
}
}
/**
/**
...
@@ -1198,7 +1203,7 @@ static void spi_pump_messages(struct kthread_work *work)
...
@@ -1198,7 +1203,7 @@ static void spi_pump_messages(struct kthread_work *work)
struct
spi_master
*
master
=
struct
spi_master
*
master
=
container_of
(
work
,
struct
spi_master
,
pump_messages
);
container_of
(
work
,
struct
spi_master
,
pump_messages
);
__spi_pump_messages
(
master
,
true
);
__spi_pump_messages
(
master
,
true
,
false
);
}
}
static
int
spi_init_queue
(
struct
spi_master
*
master
)
static
int
spi_init_queue
(
struct
spi_master
*
master
)
...
@@ -2479,7 +2484,7 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message,
...
@@ -2479,7 +2484,7 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message,
spi_sync_immediate
);
spi_sync_immediate
);
SPI_STATISTICS_INCREMENT_FIELD
(
&
spi
->
statistics
,
SPI_STATISTICS_INCREMENT_FIELD
(
&
spi
->
statistics
,
spi_sync_immediate
);
spi_sync_immediate
);
__spi_pump_messages
(
master
,
false
);
__spi_pump_messages
(
master
,
false
,
bus_locked
);
}
}
wait_for_completion
(
&
done
);
wait_for_completion
(
&
done
);
...
...
include/linux/spi/spi.h
浏览文件 @
f91c75d6
...
@@ -304,6 +304,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
...
@@ -304,6 +304,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
* @min_speed_hz: Lowest supported transfer speed
* @min_speed_hz: Lowest supported transfer speed
* @max_speed_hz: Highest supported transfer speed
* @max_speed_hz: Highest supported transfer speed
* @flags: other constraints relevant to this driver
* @flags: other constraints relevant to this driver
* @max_transfer_size: function that returns the max transfer size for
* a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
* @bus_lock_spinlock: spinlock for SPI bus locking
* @bus_lock_spinlock: spinlock for SPI bus locking
* @bus_lock_mutex: mutex for SPI bus locking
* @bus_lock_mutex: mutex for SPI bus locking
* @bus_lock_flag: indicates that the SPI bus is locked for exclusive use
* @bus_lock_flag: indicates that the SPI bus is locked for exclusive use
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录