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
1ebee0ad
Commit
1ebee0ad
authored
Aug 30, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv:spi: wrap push/pop operations in functions
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
2f7d70a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
spi-ocores.c
software/kernel/spi-ocores.c
+13
-3
No files found.
software/kernel/spi-ocores.c
View file @
1ebee0ad
...
@@ -264,6 +264,11 @@ static void spi_ocores_hw_xfer_tx_push128(struct spi_ocores *sp)
...
@@ -264,6 +264,11 @@ static void spi_ocores_hw_xfer_tx_push128(struct spi_ocores *sp)
}
}
}
}
static
void
spi_ocores_hw_xfer_tx_push
(
struct
spi_ocores
*
sp
)
{
sp
->
cur_tx_push
(
sp
);
}
static
void
spi_ocores_hw_xfer_rx_pop8
(
struct
spi_ocores
*
sp
)
static
void
spi_ocores_hw_xfer_rx_pop8
(
struct
spi_ocores
*
sp
)
{
{
uint32_t
data
;
uint32_t
data
;
...
@@ -332,6 +337,11 @@ static void spi_ocores_hw_xfer_rx_pop128(struct spi_ocores *sp)
...
@@ -332,6 +337,11 @@ static void spi_ocores_hw_xfer_rx_pop128(struct spi_ocores *sp)
}
}
}
}
static
void
spi_ocores_hw_xfer_rx_pop
(
struct
spi_ocores
*
sp
)
{
sp
->
cur_rx_pop
(
sp
);
}
static
void
spi_ocores_hw_xfer_start
(
struct
spi_ocores
*
sp
)
static
void
spi_ocores_hw_xfer_start
(
struct
spi_ocores
*
sp
)
{
{
unsigned
int
cs
=
sp
->
master
->
cur_msg
->
spi
->
chip_select
;
unsigned
int
cs
=
sp
->
master
->
cur_msg
->
spi
->
chip_select
;
...
@@ -501,7 +511,7 @@ static int spi_ocores_sw_xfer_next_start(struct spi_ocores *sp)
...
@@ -501,7 +511,7 @@ static int spi_ocores_sw_xfer_next_start(struct spi_ocores *sp)
err
=
spi_ocores_sw_xfer_next_init
(
sp
);
err
=
spi_ocores_sw_xfer_next_init
(
sp
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
sp
->
cu
r_tx_push
(
sp
);
sp
i_ocores_hw_xfe
r_tx_push
(
sp
);
spi_ocores_hw_xfer_start
(
sp
);
spi_ocores_hw_xfer_start
(
sp
);
return
0
;
return
0
;
...
@@ -546,7 +556,7 @@ static int spi_ocores_process(struct spi_ocores *sp)
...
@@ -546,7 +556,7 @@ static int spi_ocores_process(struct spi_ocores *sp)
if
(
ctrl
&
SPI_OCORES_CTRL_BUSY
)
if
(
ctrl
&
SPI_OCORES_CTRL_BUSY
)
return
-
ENODATA
;
return
-
ENODATA
;
sp
->
cu
r_rx_pop
(
sp
);
sp
i_ocores_hw_xfe
r_rx_pop
(
sp
);
/*
/*
* When we read is because a complete HW transfer is over, so we
* When we read is because a complete HW transfer is over, so we
* can safely decrease the counter of pending bytes
* can safely decrease the counter of pending bytes
...
@@ -555,7 +565,7 @@ static int spi_ocores_process(struct spi_ocores *sp)
...
@@ -555,7 +565,7 @@ static int spi_ocores_process(struct spi_ocores *sp)
sp
->
cur_len
-=
(
nbits
/
8
);
/* FIXME not working for !pow2 */
sp
->
cur_len
-=
(
nbits
/
8
);
/* FIXME not working for !pow2 */
if
(
spi_ocores_sw_xfer_pending
(
sp
))
{
if
(
spi_ocores_sw_xfer_pending
(
sp
))
{
sp
->
cu
r_tx_push
(
sp
);
sp
i_ocores_hw_xfe
r_tx_push
(
sp
);
spi_ocores_hw_xfer_start
(
sp
);
spi_ocores_hw_xfer_start
(
sp
);
}
else
{
}
else
{
int
err
;
int
err
;
...
...
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