Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
5b66fd18
Commit
5b66fd18
authored
Oct 25, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/fix/mcspi' into spi-linus
parents
9270d827
5db542ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
drivers/spi/spi-omap2-mcspi.c
drivers/spi/spi-omap2-mcspi.c
+9
-3
No files found.
drivers/spi/spi-omap2-mcspi.c
View file @
5b66fd18
...
@@ -276,7 +276,7 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
...
@@ -276,7 +276,7 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
struct
omap2_mcspi_cs
*
cs
=
spi
->
controller_state
;
struct
omap2_mcspi_cs
*
cs
=
spi
->
controller_state
;
struct
omap2_mcspi
*
mcspi
;
struct
omap2_mcspi
*
mcspi
;
unsigned
int
wcnt
;
unsigned
int
wcnt
;
int
fifo_depth
,
bytes_per_word
;
int
max_fifo_depth
,
fifo_depth
,
bytes_per_word
;
u32
chconf
,
xferlevel
;
u32
chconf
,
xferlevel
;
mcspi
=
spi_master_get_devdata
(
master
);
mcspi
=
spi_master_get_devdata
(
master
);
...
@@ -287,7 +287,12 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
...
@@ -287,7 +287,12 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
if
(
t
->
len
%
bytes_per_word
!=
0
)
if
(
t
->
len
%
bytes_per_word
!=
0
)
goto
disable_fifo
;
goto
disable_fifo
;
fifo_depth
=
gcd
(
t
->
len
,
OMAP2_MCSPI_MAX_FIFODEPTH
);
if
(
t
->
rx_buf
!=
NULL
&&
t
->
tx_buf
!=
NULL
)
max_fifo_depth
=
OMAP2_MCSPI_MAX_FIFODEPTH
/
2
;
else
max_fifo_depth
=
OMAP2_MCSPI_MAX_FIFODEPTH
;
fifo_depth
=
gcd
(
t
->
len
,
max_fifo_depth
);
if
(
fifo_depth
<
2
||
fifo_depth
%
bytes_per_word
!=
0
)
if
(
fifo_depth
<
2
||
fifo_depth
%
bytes_per_word
!=
0
)
goto
disable_fifo
;
goto
disable_fifo
;
...
@@ -299,7 +304,8 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
...
@@ -299,7 +304,8 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi,
if
(
t
->
rx_buf
!=
NULL
)
{
if
(
t
->
rx_buf
!=
NULL
)
{
chconf
|=
OMAP2_MCSPI_CHCONF_FFER
;
chconf
|=
OMAP2_MCSPI_CHCONF_FFER
;
xferlevel
|=
(
fifo_depth
-
1
)
<<
8
;
xferlevel
|=
(
fifo_depth
-
1
)
<<
8
;
}
else
{
}
if
(
t
->
tx_buf
!=
NULL
)
{
chconf
|=
OMAP2_MCSPI_CHCONF_FFET
;
chconf
|=
OMAP2_MCSPI_CHCONF_FFET
;
xferlevel
|=
fifo_depth
-
1
;
xferlevel
|=
fifo_depth
-
1
;
}
}
...
...
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