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
c06eea7d
Commit
c06eea7d
authored
Nov 28, 2018
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'spi-4.20' into spi-4.21 for bcm stuff.
parents
942779c6
e82b0b38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
20 deletions
+31
-20
drivers/spi/spi-bcm2835.c
drivers/spi/spi-bcm2835.c
+6
-8
drivers/spi/spi-omap2-mcspi.c
drivers/spi/spi-omap2-mcspi.c
+25
-12
No files found.
drivers/spi/spi-bcm2835.c
View file @
c06eea7d
...
...
@@ -155,8 +155,7 @@ static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id)
/* Write as many bytes as possible to FIFO */
bcm2835_wr_fifo
(
bs
);
/* based on flags decide if we can finish the transfer */
if
(
bcm2835_rd
(
bs
,
BCM2835_SPI_CS
)
&
BCM2835_SPI_CS_DONE
)
{
if
(
!
bs
->
rx_len
)
{
/* Transfer complete - reset SPI HW */
bcm2835_spi_reset_hw
(
master
);
/* wake up the framework */
...
...
@@ -233,10 +232,9 @@ static void bcm2835_spi_dma_done(void *data)
* is called the tx-dma must have finished - can't get to this
* situation otherwise...
*/
if
(
cmpxchg
(
&
bs
->
dma_pending
,
true
,
false
))
{
dmaengine_terminate_all
(
master
->
dma_tx
);
/* mark as no longer pending */
bs
->
dma_pending
=
0
;
}
/* and mark as completed */
;
complete
(
&
master
->
xfer_completion
);
...
...
@@ -342,6 +340,7 @@ static int bcm2835_spi_transfer_one_dma(struct spi_master *master,
if
(
ret
)
{
/* need to reset on errors */
dmaengine_terminate_all
(
master
->
dma_tx
);
bs
->
dma_pending
=
false
;
bcm2835_spi_reset_hw
(
master
);
return
ret
;
}
...
...
@@ -617,10 +616,9 @@ static void bcm2835_spi_handle_err(struct spi_master *master,
struct
bcm2835_spi
*
bs
=
spi_master_get_devdata
(
master
);
/* if an error occurred and we have an active dma, then terminate */
if
(
bs
->
dma_pending
)
{
if
(
cmpxchg
(
&
bs
->
dma_pending
,
true
,
false
)
)
{
dmaengine_terminate_all
(
master
->
dma_tx
);
dmaengine_terminate_all
(
master
->
dma_rx
);
bs
->
dma_pending
=
0
;
}
/* and reset */
bcm2835_spi_reset_hw
(
master
);
...
...
drivers/spi/spi-omap2-mcspi.c
View file @
c06eea7d
...
...
@@ -1540,13 +1540,26 @@ static int omap2_mcspi_remove(struct platform_device *pdev)
/* work with hotplug and coldplug */
MODULE_ALIAS
(
"platform:omap2_mcspi"
);
#ifdef CONFIG_SUSPEND
static
int
omap2_mcspi_suspend_noirq
(
struct
device
*
dev
)
static
int
__maybe_unused
omap2_mcspi_suspend
(
struct
device
*
dev
)
{
return
pinctrl_pm_select_sleep_state
(
dev
);
struct
spi_master
*
master
=
dev_get_drvdata
(
dev
);
struct
omap2_mcspi
*
mcspi
=
spi_master_get_devdata
(
master
);
int
error
;
error
=
pinctrl_pm_select_sleep_state
(
dev
);
if
(
error
)
dev_warn
(
mcspi
->
dev
,
"%s: failed to set pins: %i
\n
"
,
__func__
,
error
);
error
=
spi_master_suspend
(
master
);
if
(
error
)
dev_warn
(
mcspi
->
dev
,
"%s: master suspend failed: %i
\n
"
,
__func__
,
error
);
return
pm_runtime_force_suspend
(
dev
);
}
static
int
omap2_mcspi_resume_noirq
(
struct
device
*
dev
)
static
int
__maybe_unused
omap2_mcspi_resume
(
struct
device
*
dev
)
{
struct
spi_master
*
master
=
dev_get_drvdata
(
dev
);
struct
omap2_mcspi
*
mcspi
=
spi_master_get_devdata
(
master
);
...
...
@@ -1557,17 +1570,17 @@ static int omap2_mcspi_resume_noirq(struct device *dev)
dev_warn
(
mcspi
->
dev
,
"%s: failed to set pins: %i
\n
"
,
__func__
,
error
);
return
0
;
}
error
=
spi_master_resume
(
master
);
if
(
error
)
dev_warn
(
mcspi
->
dev
,
"%s: master resume failed: %i
\n
"
,
__func__
,
error
);
#else
#define omap2_mcspi_suspend_noirq NULL
#define omap2_mcspi_resume_noirq NULL
#endif
return
pm_runtime_force_resume
(
dev
);
}
static
const
struct
dev_pm_ops
omap2_mcspi_pm_ops
=
{
.
suspend_noirq
=
omap2_mcspi_suspend_noirq
,
.
resume_noirq
=
omap2_mcspi_resume_noirq
,
SET_SYSTEM_SLEEP_PM_OPS
(
omap2_mcspi_suspend
,
omap2_mcspi_resume
)
.
runtime_resume
=
omap_mcspi_runtime_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