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
2b657a58
Commit
2b657a58
authored
Apr 04, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/fix/imx' into spi-linus
parents
d7124d69
cd8dd41a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
drivers/spi/spi-imx.c
drivers/spi/spi-imx.c
+14
-2
No files found.
drivers/spi/spi-imx.c
View file @
2b657a58
...
...
@@ -211,11 +211,15 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
struct
spi_transfer
*
transfer
)
{
struct
spi_imx_data
*
spi_imx
=
spi_master_get_devdata
(
master
);
unsigned
int
bpw
=
transfer
->
bits_per_word
;
unsigned
int
bpw
;
if
(
!
master
->
dma_rx
)
return
false
;
if
(
!
transfer
)
return
false
;
bpw
=
transfer
->
bits_per_word
;
if
(
!
bpw
)
bpw
=
spi
->
bits_per_word
;
...
...
@@ -333,8 +337,9 @@ static void __maybe_unused mx51_ecspi_trigger(struct spi_imx_data *spi_imx)
static
int
__maybe_unused
mx51_ecspi_config
(
struct
spi_imx_data
*
spi_imx
,
struct
spi_imx_config
*
config
)
{
u32
ctrl
=
MX51_ECSPI_CTRL_ENABLE
,
cfg
=
0
;
u32
ctrl
=
MX51_ECSPI_CTRL_ENABLE
;
u32
clk
=
config
->
speed_hz
,
delay
,
reg
;
u32
cfg
=
readl
(
spi_imx
->
base
+
MX51_ECSPI_CONFIG
);
/*
* The hardware seems to have a race condition when changing modes. The
...
...
@@ -358,13 +363,20 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx,
if
(
config
->
mode
&
SPI_CPHA
)
cfg
|=
MX51_ECSPI_CONFIG_SCLKPHA
(
config
->
cs
);
else
cfg
&=
~
MX51_ECSPI_CONFIG_SCLKPHA
(
config
->
cs
);
if
(
config
->
mode
&
SPI_CPOL
)
{
cfg
|=
MX51_ECSPI_CONFIG_SCLKPOL
(
config
->
cs
);
cfg
|=
MX51_ECSPI_CONFIG_SCLKCTL
(
config
->
cs
);
}
else
{
cfg
&=
~
MX51_ECSPI_CONFIG_SCLKPOL
(
config
->
cs
);
cfg
&=
~
MX51_ECSPI_CONFIG_SCLKCTL
(
config
->
cs
);
}
if
(
config
->
mode
&
SPI_CS_HIGH
)
cfg
|=
MX51_ECSPI_CONFIG_SSBPOL
(
config
->
cs
);
else
cfg
&=
~
MX51_ECSPI_CONFIG_SSBPOL
(
config
->
cs
);
if
(
spi_imx
->
usedma
)
ctrl
|=
MX51_ECSPI_CTRL_SMC
;
...
...
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