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
Kirill Smelkov
linux
Commits
7c2fde9b
Commit
7c2fde9b
authored
Sep 01, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/mxs' into spi-next
parents
9020b754
29f0d488
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
drivers/spi/spi-mxs.c
drivers/spi/spi-mxs.c
+13
-15
No files found.
drivers/spi/spi-mxs.c
View file @
7c2fde9b
...
@@ -67,13 +67,8 @@ static int mxs_spi_setup_transfer(struct spi_device *dev,
...
@@ -67,13 +67,8 @@ static int mxs_spi_setup_transfer(struct spi_device *dev,
{
{
struct
mxs_spi
*
spi
=
spi_master_get_devdata
(
dev
->
master
);
struct
mxs_spi
*
spi
=
spi_master_get_devdata
(
dev
->
master
);
struct
mxs_ssp
*
ssp
=
&
spi
->
ssp
;
struct
mxs_ssp
*
ssp
=
&
spi
->
ssp
;
uint8_t
bits_per_word
;
uint32_t
hz
=
0
;
uint32_t
hz
=
0
;
bits_per_word
=
dev
->
bits_per_word
;
if
(
t
&&
t
->
bits_per_word
)
bits_per_word
=
t
->
bits_per_word
;
hz
=
dev
->
max_speed_hz
;
hz
=
dev
->
max_speed_hz
;
if
(
t
&&
t
->
speed_hz
)
if
(
t
&&
t
->
speed_hz
)
hz
=
min
(
hz
,
t
->
speed_hz
);
hz
=
min
(
hz
,
t
->
speed_hz
);
...
@@ -513,7 +508,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
...
@@ -513,7 +508,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
iores
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
iores
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
irq_err
=
platform_get_irq
(
pdev
,
0
);
irq_err
=
platform_get_irq
(
pdev
,
0
);
if
(
!
iores
||
irq_err
<
0
)
if
(
irq_err
<
0
)
return
-
EINVAL
;
return
-
EINVAL
;
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
iores
);
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
iores
);
...
@@ -563,25 +558,31 @@ static int mxs_spi_probe(struct platform_device *pdev)
...
@@ -563,25 +558,31 @@ static int mxs_spi_probe(struct platform_device *pdev)
goto
out_master_free
;
goto
out_master_free
;
}
}
clk_prepare_enable
(
ssp
->
clk
);
ret
=
clk_prepare_enable
(
ssp
->
clk
);
if
(
ret
)
goto
out_dma_release
;
clk_set_rate
(
ssp
->
clk
,
clk_freq
);
clk_set_rate
(
ssp
->
clk
,
clk_freq
);
ssp
->
clk_rate
=
clk_get_rate
(
ssp
->
clk
)
/
1000
;
ssp
->
clk_rate
=
clk_get_rate
(
ssp
->
clk
)
/
1000
;
stmp_reset_block
(
ssp
->
base
);
ret
=
stmp_reset_block
(
ssp
->
base
);
if
(
ret
)
goto
out_disable_clk
;
platform_set_drvdata
(
pdev
,
master
);
platform_set_drvdata
(
pdev
,
master
);
ret
=
spi_register_master
(
master
);
ret
=
spi_register_master
(
master
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"Cannot register SPI master, %d
\n
"
,
ret
);
dev_err
(
&
pdev
->
dev
,
"Cannot register SPI master, %d
\n
"
,
ret
);
goto
out_
free_dma
;
goto
out_
disable_clk
;
}
}
return
0
;
return
0
;
out_free_dma:
out_disable_clk:
dma_release_channel
(
ssp
->
dmach
);
clk_disable_unprepare
(
ssp
->
clk
);
clk_disable_unprepare
(
ssp
->
clk
);
out_dma_release:
dma_release_channel
(
ssp
->
dmach
);
out_master_free:
out_master_free:
spi_master_put
(
master
);
spi_master_put
(
master
);
return
ret
;
return
ret
;
...
@@ -598,11 +599,8 @@ static int mxs_spi_remove(struct platform_device *pdev)
...
@@ -598,11 +599,8 @@ static int mxs_spi_remove(struct platform_device *pdev)
ssp
=
&
spi
->
ssp
;
ssp
=
&
spi
->
ssp
;
spi_unregister_master
(
master
);
spi_unregister_master
(
master
);
dma_release_channel
(
ssp
->
dmach
);
clk_disable_unprepare
(
ssp
->
clk
);
clk_disable_unprepare
(
ssp
->
clk
);
dma_release_channel
(
ssp
->
dmach
);
spi_master_put
(
master
);
spi_master_put
(
master
);
return
0
;
return
0
;
...
...
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