Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
cf6c0ab5
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
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看板
提交
cf6c0ab5
编写于
10月 15, 2014
作者:
V
Vinod Koul
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/dma_control_fsl_acks' into for-linus
上级
2856fcdc
b80719b6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
19 deletion
+44
-19
drivers/dma/fsldma.c
drivers/dma/fsldma.c
+15
-10
drivers/misc/carma/carma-fpga-program.c
drivers/misc/carma/carma-fpga-program.c
+6
-6
include/linux/dmaengine.h
include/linux/dmaengine.h
+10
-3
include/linux/fsldma.h
include/linux/fsldma.h
+13
-0
未找到文件。
drivers/dma/fsldma.c
浏览文件 @
cf6c0ab5
...
...
@@ -36,7 +36,7 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/fsldma.h>
#include "dmaengine.h"
#include "fsldma.h"
...
...
@@ -367,6 +367,20 @@ static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable)
chan
->
feature
&=
~
FSL_DMA_CHAN_START_EXT
;
}
int
fsl_dma_external_start
(
struct
dma_chan
*
dchan
,
int
enable
)
{
struct
fsldma_chan
*
chan
;
if
(
!
dchan
)
return
-
EINVAL
;
chan
=
to_fsl_chan
(
dchan
);
fsl_chan_toggle_ext_start
(
chan
,
enable
);
return
0
;
}
EXPORT_SYMBOL_GPL
(
fsl_dma_external_start
);
static
void
append_ld_queue
(
struct
fsldma_chan
*
chan
,
struct
fsl_desc_sw
*
desc
)
{
struct
fsl_desc_sw
*
tail
=
to_fsl_desc
(
chan
->
ld_pending
.
prev
);
...
...
@@ -998,15 +1012,6 @@ static int fsl_dma_device_control(struct dma_chan *dchan,
chan
->
set_request_count
(
chan
,
size
);
return
0
;
case
FSLDMA_EXTERNAL_START
:
/* make sure the channel supports external start */
if
(
!
chan
->
toggle_ext_start
)
return
-
ENXIO
;
chan
->
toggle_ext_start
(
chan
,
arg
);
return
0
;
default:
return
-
ENXIO
;
}
...
...
drivers/misc/carma/carma-fpga-program.c
浏览文件 @
cf6c0ab5
...
...
@@ -16,6 +16,7 @@
#include <linux/completion.h>
#include <linux/miscdevice.h>
#include <linux/dmaengine.h>
#include <linux/fsldma.h>
#include <linux/interrupt.h>
#include <linux/highmem.h>
#include <linux/kernel.h>
...
...
@@ -518,23 +519,22 @@ static noinline int fpga_program_dma(struct fpga_dev *priv)
config
.
direction
=
DMA_MEM_TO_DEV
;
config
.
dst_addr_width
=
DMA_SLAVE_BUSWIDTH_4_BYTES
;
config
.
dst_maxburst
=
fpga_fifo_size
(
priv
->
regs
)
/
2
/
4
;
ret
=
chan
->
device
->
device_control
(
chan
,
DMA_SLAVE_CONFIG
,
(
unsigned
long
)
&
config
);
ret
=
dmaengine_slave_config
(
chan
,
&
config
);
if
(
ret
)
{
dev_err
(
priv
->
dev
,
"DMA slave configuration failed
\n
"
);
goto
out_dma_unmap
;
}
ret
=
chan
->
device
->
device_control
(
chan
,
FSLDMA_EXTERNAL_START
,
1
);
ret
=
fsl_dma_external_start
(
chan
,
1
)
if
(
ret
)
{
dev_err
(
priv
->
dev
,
"DMA external control setup failed
\n
"
);
goto
out_dma_unmap
;
}
/* setup and submit the DMA transaction */
tx
=
chan
->
device
->
device_prep_dma_sg
(
chan
,
table
.
sgl
,
num_pages
,
vb
->
sglist
,
vb
->
sglen
,
0
);
tx
=
dmaengine_prep_dma_sg
(
chan
,
table
.
sgl
,
num_pages
,
vb
->
sglist
,
vb
->
sglen
,
0
);
if
(
!
tx
)
{
dev_err
(
priv
->
dev
,
"Unable to prep DMA transaction
\n
"
);
ret
=
-
ENOMEM
;
...
...
include/linux/dmaengine.h
浏览文件 @
cf6c0ab5
...
...
@@ -199,15 +199,12 @@ enum dma_ctrl_flags {
* configuration data in statically from the platform). An additional
* argument of struct dma_slave_config must be passed in with this
* command.
* @FSLDMA_EXTERNAL_START: this command will put the Freescale DMA controller
* into external start mode.
*/
enum
dma_ctrl_cmd
{
DMA_TERMINATE_ALL
,
DMA_PAUSE
,
DMA_RESUME
,
DMA_SLAVE_CONFIG
,
FSLDMA_EXTERNAL_START
,
};
/**
...
...
@@ -757,6 +754,16 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
return
chan
->
device
->
device_prep_interleaved_dma
(
chan
,
xt
,
flags
);
}
static
inline
struct
dma_async_tx_descriptor
*
dmaengine_prep_dma_sg
(
struct
dma_chan
*
chan
,
struct
scatterlist
*
dst_sg
,
unsigned
int
dst_nents
,
struct
scatterlist
*
src_sg
,
unsigned
int
src_nents
,
unsigned
long
flags
)
{
return
chan
->
device
->
device_prep_dma_sg
(
chan
,
dst_sg
,
dst_nents
,
src_sg
,
src_nents
,
flags
);
}
static
inline
int
dma_get_slave_caps
(
struct
dma_chan
*
chan
,
struct
dma_slave_caps
*
caps
)
{
if
(
!
chan
||
!
caps
)
...
...
include/linux/fsldma.h
0 → 100644
浏览文件 @
cf6c0ab5
/*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef FSL_DMA_H
#define FSL_DMA_H
/* fsl dma API for enxternal start */
int
fsl_dma_external_start
(
struct
dma_chan
*
dchan
,
int
enable
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录