Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC
Commits
a1a8d2cb
Commit
a1a8d2cb
authored
Aug 12, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv:dma: split DMA control func
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
4f2c8eaf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
19 deletions
+34
-19
spec-gn412x-dma.c
software/kernel/spec-gn412x-dma.c
+34
-19
No files found.
software/kernel/spec-gn412x-dma.c
View file @
a1a8d2cb
...
...
@@ -183,7 +183,7 @@ struct gn412x_dma_tx_hw {
* @pending_list: list of pending transfers
* @tx_curr: current transfer
* @task: tasklet for DMA start
* @lock: protects
the pending_list and tx_curr from concurrent changes
* @lock: protects
: pending_list, tx_curr, sconfig
* @sconfig: channel configuration to be used
* @error: number of errors detected
*/
...
...
@@ -539,22 +539,24 @@ static enum dma_status gn412x_dma_tx_status(struct dma_chan *chan,
return
DMA_ERROR
;
}
static
int
gn412x_dma_device_control
(
struct
dma_chan
*
chan
,
enum
dma_ctrl_cmd
cmd
,
unsigned
long
arg
)
static
int
gn412x_dma_slave_config
(
struct
dma_chan
*
chan
,
struct
dma_slave_config
*
sconfig
)
{
struct
gn412x_dma_device
*
gn412x_dma
=
to_gn412x_dma_device
(
chan
->
device
);
switch
(
cmd
)
{
case
DMA_SLAVE_CONFIG
:
{
struct
gn412x_dma_chan
*
gn412x_dma_chan
=
to_gn412x_dma_chan
(
chan
);
struct
dma_slave_config
*
sconfig
=
(
struct
dma_slave_config
*
)
arg
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
gn412x_dma_chan
->
lock
,
flags
);
memcpy
(
&
gn412x_dma_chan
->
sconfig
,
sconfig
,
sizeof
(
struct
dma_slave_config
));
break
;
}
case
DMA_TERMINATE_ALL
:
spin_unlock_irqrestore
(
&
gn412x_dma_chan
->
lock
,
flags
);
return
0
;
}
static
int
gn412x_dma_terminate_all
(
struct
dma_chan
*
chan
)
{
struct
gn412x_dma_device
*
gn412x_dma
=
to_gn412x_dma_device
(
chan
->
device
);
gn412x_dma_ctrl_abort
(
gn412x_dma
);
/* FIXME remove all pending */
if
(
!
gn412x_dma_is_abort
(
gn412x_dma
))
{
...
...
@@ -562,7 +564,20 @@ static int gn412x_dma_device_control(struct dma_chan *chan,
"Failed to abort DMA transfer
\n
"
);
return
-
EINVAL
;
}
break
;
return
0
;
}
static
int
gn412x_dma_device_control
(
struct
dma_chan
*
chan
,
enum
dma_ctrl_cmd
cmd
,
unsigned
long
arg
)
{
switch
(
cmd
)
{
case
DMA_SLAVE_CONFIG
:
return
gn412x_dma_slave_config
(
chan
,
(
struct
dma_slave_config
*
)
arg
);
case
DMA_TERMINATE_ALL
:
return
gn412x_dma_terminate_all
(
chan
);
case
DMA_PAUSE
:
break
;
case
DMA_RESUME
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment