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
0c0c5b8f
Commit
0c0c5b8f
authored
May 30, 2020
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/for-5.7' into spi-linus
parents
9cb1fd0e
65e318e1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
65 additions
and
49 deletions
+65
-49
drivers/spi/spi-axi-spi-engine.c
drivers/spi/spi-axi-spi-engine.c
+16
-16
drivers/spi/spi-bcm-qspi.c
drivers/spi/spi-bcm-qspi.c
+23
-20
drivers/spi/spi-bcm2835.c
drivers/spi/spi-bcm2835.c
+3
-1
drivers/spi/spi-bcm2835aux.c
drivers/spi/spi-bcm2835aux.c
+3
-1
drivers/spi/spi-dw.c
drivers/spi/spi-dw.c
+3
-1
drivers/spi/spi-ep93xx.c
drivers/spi/spi-ep93xx.c
+6
-2
drivers/spi/spi-mux.c
drivers/spi/spi-mux.c
+4
-4
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-pxa2xx.c
+3
-2
drivers/spi/spi-sc18is602.c
drivers/spi/spi-sc18is602.c
+1
-1
drivers/spi/spi.c
drivers/spi/spi.c
+3
-1
No files found.
drivers/spi/spi-axi-spi-engine.c
View file @
0c0c5b8f
...
@@ -489,22 +489,6 @@ static int spi_engine_probe(struct platform_device *pdev)
...
@@ -489,22 +489,6 @@ static int spi_engine_probe(struct platform_device *pdev)
spin_lock_init
(
&
spi_engine
->
lock
);
spin_lock_init
(
&
spi_engine
->
lock
);
spi_engine
->
base
=
devm_platform_ioremap_resource
(
pdev
,
0
);
if
(
IS_ERR
(
spi_engine
->
base
))
{
ret
=
PTR_ERR
(
spi_engine
->
base
);
goto
err_put_master
;
}
version
=
readl
(
spi_engine
->
base
+
SPI_ENGINE_REG_VERSION
);
if
(
SPI_ENGINE_VERSION_MAJOR
(
version
)
!=
1
)
{
dev_err
(
&
pdev
->
dev
,
"Unsupported peripheral version %u.%u.%c
\n
"
,
SPI_ENGINE_VERSION_MAJOR
(
version
),
SPI_ENGINE_VERSION_MINOR
(
version
),
SPI_ENGINE_VERSION_PATCH
(
version
));
ret
=
-
ENODEV
;
goto
err_put_master
;
}
spi_engine
->
clk
=
devm_clk_get
(
&
pdev
->
dev
,
"s_axi_aclk"
);
spi_engine
->
clk
=
devm_clk_get
(
&
pdev
->
dev
,
"s_axi_aclk"
);
if
(
IS_ERR
(
spi_engine
->
clk
))
{
if
(
IS_ERR
(
spi_engine
->
clk
))
{
ret
=
PTR_ERR
(
spi_engine
->
clk
);
ret
=
PTR_ERR
(
spi_engine
->
clk
);
...
@@ -525,6 +509,22 @@ static int spi_engine_probe(struct platform_device *pdev)
...
@@ -525,6 +509,22 @@ static int spi_engine_probe(struct platform_device *pdev)
if
(
ret
)
if
(
ret
)
goto
err_clk_disable
;
goto
err_clk_disable
;
spi_engine
->
base
=
devm_platform_ioremap_resource
(
pdev
,
0
);
if
(
IS_ERR
(
spi_engine
->
base
))
{
ret
=
PTR_ERR
(
spi_engine
->
base
);
goto
err_ref_clk_disable
;
}
version
=
readl
(
spi_engine
->
base
+
SPI_ENGINE_REG_VERSION
);
if
(
SPI_ENGINE_VERSION_MAJOR
(
version
)
!=
1
)
{
dev_err
(
&
pdev
->
dev
,
"Unsupported peripheral version %u.%u.%c
\n
"
,
SPI_ENGINE_VERSION_MAJOR
(
version
),
SPI_ENGINE_VERSION_MINOR
(
version
),
SPI_ENGINE_VERSION_PATCH
(
version
));
ret
=
-
ENODEV
;
goto
err_ref_clk_disable
;
}
writel_relaxed
(
0x00
,
spi_engine
->
base
+
SPI_ENGINE_REG_RESET
);
writel_relaxed
(
0x00
,
spi_engine
->
base
+
SPI_ENGINE_REG_RESET
);
writel_relaxed
(
0xff
,
spi_engine
->
base
+
SPI_ENGINE_REG_INT_PENDING
);
writel_relaxed
(
0xff
,
spi_engine
->
base
+
SPI_ENGINE_REG_INT_PENDING
);
writel_relaxed
(
0x00
,
spi_engine
->
base
+
SPI_ENGINE_REG_INT_ENABLE
);
writel_relaxed
(
0x00
,
spi_engine
->
base
+
SPI_ENGINE_REG_INT_ENABLE
);
...
...
drivers/spi/spi-bcm-qspi.c
View file @
0c0c5b8f
...
@@ -612,19 +612,15 @@ static int update_qspi_trans_byte_count(struct bcm_qspi *qspi,
...
@@ -612,19 +612,15 @@ static int update_qspi_trans_byte_count(struct bcm_qspi *qspi,
if
(
qt
->
trans
->
cs_change
&&
if
(
qt
->
trans
->
cs_change
&&
(
flags
&
TRANS_STATUS_BREAK_CS_CHANGE
))
(
flags
&
TRANS_STATUS_BREAK_CS_CHANGE
))
ret
|=
TRANS_STATUS_BREAK_CS_CHANGE
;
ret
|=
TRANS_STATUS_BREAK_CS_CHANGE
;
if
(
ret
)
goto
done
;
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"advance msg exit
\n
"
);
if
(
bcm_qspi_mspi_transfer_is_last
(
qspi
,
qt
))
if
(
bcm_qspi_mspi_transfer_is_last
(
qspi
,
qt
))
ret
=
TRANS_STATUS_BREAK_EOM
;
ret
|
=
TRANS_STATUS_BREAK_EOM
;
else
else
ret
=
TRANS_STATUS_BREAK_NO_BYTES
;
ret
|
=
TRANS_STATUS_BREAK_NO_BYTES
;
qt
->
trans
=
NULL
;
qt
->
trans
=
NULL
;
}
}
done:
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"trans %p len %d byte %d ret %x
\n
"
,
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"trans %p len %d byte %d ret %x
\n
"
,
qt
->
trans
,
qt
->
trans
?
qt
->
trans
->
len
:
0
,
qt
->
byte
,
ret
);
qt
->
trans
,
qt
->
trans
?
qt
->
trans
->
len
:
0
,
qt
->
byte
,
ret
);
return
ret
;
return
ret
;
...
@@ -670,7 +666,7 @@ static void read_from_hw(struct bcm_qspi *qspi, int slots)
...
@@ -670,7 +666,7 @@ static void read_from_hw(struct bcm_qspi *qspi, int slots)
if
(
buf
)
if
(
buf
)
buf
[
tp
.
byte
]
=
read_rxram_slot_u8
(
qspi
,
slot
);
buf
[
tp
.
byte
]
=
read_rxram_slot_u8
(
qspi
,
slot
);
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"RD %02x
\n
"
,
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"RD %02x
\n
"
,
buf
?
buf
[
tp
.
byte
]
:
0x
ff
);
buf
?
buf
[
tp
.
byte
]
:
0x
0
);
}
else
{
}
else
{
u16
*
buf
=
tp
.
trans
->
rx_buf
;
u16
*
buf
=
tp
.
trans
->
rx_buf
;
...
@@ -678,7 +674,7 @@ static void read_from_hw(struct bcm_qspi *qspi, int slots)
...
@@ -678,7 +674,7 @@ static void read_from_hw(struct bcm_qspi *qspi, int slots)
buf
[
tp
.
byte
/
2
]
=
read_rxram_slot_u16
(
qspi
,
buf
[
tp
.
byte
/
2
]
=
read_rxram_slot_u16
(
qspi
,
slot
);
slot
);
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"RD %04x
\n
"
,
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"RD %04x
\n
"
,
buf
?
buf
[
tp
.
byte
]
:
0xffff
);
buf
?
buf
[
tp
.
byte
/
2
]
:
0x0
);
}
}
update_qspi_trans_byte_count
(
qspi
,
&
tp
,
update_qspi_trans_byte_count
(
qspi
,
&
tp
,
...
@@ -733,13 +729,13 @@ static int write_to_hw(struct bcm_qspi *qspi, struct spi_device *spi)
...
@@ -733,13 +729,13 @@ static int write_to_hw(struct bcm_qspi *qspi, struct spi_device *spi)
while
(
!
tstatus
&&
slot
<
MSPI_NUM_CDRAM
)
{
while
(
!
tstatus
&&
slot
<
MSPI_NUM_CDRAM
)
{
if
(
tp
.
trans
->
bits_per_word
<=
8
)
{
if
(
tp
.
trans
->
bits_per_word
<=
8
)
{
const
u8
*
buf
=
tp
.
trans
->
tx_buf
;
const
u8
*
buf
=
tp
.
trans
->
tx_buf
;
u8
val
=
buf
?
buf
[
tp
.
byte
]
:
0x
ff
;
u8
val
=
buf
?
buf
[
tp
.
byte
]
:
0x
00
;
write_txram_slot_u8
(
qspi
,
slot
,
val
);
write_txram_slot_u8
(
qspi
,
slot
,
val
);
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"WR %02x
\n
"
,
val
);
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"WR %02x
\n
"
,
val
);
}
else
{
}
else
{
const
u16
*
buf
=
tp
.
trans
->
tx_buf
;
const
u16
*
buf
=
tp
.
trans
->
tx_buf
;
u16
val
=
buf
?
buf
[
tp
.
byte
/
2
]
:
0x
ffff
;
u16
val
=
buf
?
buf
[
tp
.
byte
/
2
]
:
0x
0000
;
write_txram_slot_u16
(
qspi
,
slot
,
val
);
write_txram_slot_u16
(
qspi
,
slot
,
val
);
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"WR %04x
\n
"
,
val
);
dev_dbg
(
&
qspi
->
pdev
->
dev
,
"WR %04x
\n
"
,
val
);
...
@@ -771,7 +767,16 @@ static int write_to_hw(struct bcm_qspi *qspi, struct spi_device *spi)
...
@@ -771,7 +767,16 @@ static int write_to_hw(struct bcm_qspi *qspi, struct spi_device *spi)
bcm_qspi_write
(
qspi
,
MSPI
,
MSPI_NEWQP
,
0
);
bcm_qspi_write
(
qspi
,
MSPI
,
MSPI_NEWQP
,
0
);
bcm_qspi_write
(
qspi
,
MSPI
,
MSPI_ENDQP
,
slot
-
1
);
bcm_qspi_write
(
qspi
,
MSPI
,
MSPI_ENDQP
,
slot
-
1
);
if
(
tstatus
&
TRANS_STATUS_BREAK_DESELECT
)
{
/*
* case 1) EOM =1, cs_change =0: SSb inactive
* case 2) EOM =1, cs_change =1: SSb stay active
* case 3) EOM =0, cs_change =0: SSb stay active
* case 4) EOM =0, cs_change =1: SSb inactive
*/
if
(((
tstatus
&
TRANS_STATUS_BREAK_DESELECT
)
==
TRANS_STATUS_BREAK_CS_CHANGE
)
||
((
tstatus
&
TRANS_STATUS_BREAK_DESELECT
)
==
TRANS_STATUS_BREAK_EOM
))
{
mspi_cdram
=
read_cdram_slot
(
qspi
,
slot
-
1
)
&
mspi_cdram
=
read_cdram_slot
(
qspi
,
slot
-
1
)
&
~
MSPI_CDRAM_CONT_BIT
;
~
MSPI_CDRAM_CONT_BIT
;
write_cdram_slot
(
qspi
,
slot
-
1
,
mspi_cdram
);
write_cdram_slot
(
qspi
,
slot
-
1
,
mspi_cdram
);
...
@@ -1222,6 +1227,11 @@ int bcm_qspi_probe(struct platform_device *pdev,
...
@@ -1222,6 +1227,11 @@ int bcm_qspi_probe(struct platform_device *pdev,
}
}
qspi
=
spi_master_get_devdata
(
master
);
qspi
=
spi_master_get_devdata
(
master
);
qspi
->
clk
=
devm_clk_get_optional
(
&
pdev
->
dev
,
NULL
);
if
(
IS_ERR
(
qspi
->
clk
))
return
PTR_ERR
(
qspi
->
clk
);
qspi
->
pdev
=
pdev
;
qspi
->
pdev
=
pdev
;
qspi
->
trans_pos
.
trans
=
NULL
;
qspi
->
trans_pos
.
trans
=
NULL
;
qspi
->
trans_pos
.
byte
=
0
;
qspi
->
trans_pos
.
byte
=
0
;
...
@@ -1335,13 +1345,6 @@ int bcm_qspi_probe(struct platform_device *pdev,
...
@@ -1335,13 +1345,6 @@ int bcm_qspi_probe(struct platform_device *pdev,
qspi
->
soc_intc
=
NULL
;
qspi
->
soc_intc
=
NULL
;
}
}
qspi
->
clk
=
devm_clk_get
(
&
pdev
->
dev
,
NULL
);
if
(
IS_ERR
(
qspi
->
clk
))
{
dev_warn
(
dev
,
"unable to get clock
\n
"
);
ret
=
PTR_ERR
(
qspi
->
clk
);
goto
qspi_probe_err
;
}
ret
=
clk_prepare_enable
(
qspi
->
clk
);
ret
=
clk_prepare_enable
(
qspi
->
clk
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
dev
,
"failed to prepare clock
\n
"
);
dev_err
(
dev
,
"failed to prepare clock
\n
"
);
...
@@ -1406,7 +1409,7 @@ static int __maybe_unused bcm_qspi_suspend(struct device *dev)
...
@@ -1406,7 +1409,7 @@ static int __maybe_unused bcm_qspi_suspend(struct device *dev)
bcm_qspi_read
(
qspi
,
BSPI
,
BSPI_STRAP_OVERRIDE_CTRL
);
bcm_qspi_read
(
qspi
,
BSPI
,
BSPI_STRAP_OVERRIDE_CTRL
);
spi_master_suspend
(
qspi
->
master
);
spi_master_suspend
(
qspi
->
master
);
clk_disable
(
qspi
->
clk
);
clk_disable
_unprepare
(
qspi
->
clk
);
bcm_qspi_hw_uninit
(
qspi
);
bcm_qspi_hw_uninit
(
qspi
);
return
0
;
return
0
;
...
@@ -1424,7 +1427,7 @@ static int __maybe_unused bcm_qspi_resume(struct device *dev)
...
@@ -1424,7 +1427,7 @@ static int __maybe_unused bcm_qspi_resume(struct device *dev)
qspi
->
soc_intc
->
bcm_qspi_int_set
(
qspi
->
soc_intc
,
MSPI_DONE
,
qspi
->
soc_intc
->
bcm_qspi_int_set
(
qspi
->
soc_intc
,
MSPI_DONE
,
true
);
true
);
ret
=
clk_enable
(
qspi
->
clk
);
ret
=
clk_
prepare_
enable
(
qspi
->
clk
);
if
(
!
ret
)
if
(
!
ret
)
spi_master_resume
(
qspi
->
master
);
spi_master_resume
(
qspi
->
master
);
...
...
drivers/spi/spi-bcm2835.c
View file @
0c0c5b8f
...
@@ -1347,7 +1347,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
...
@@ -1347,7 +1347,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
goto
out_dma_release
;
goto
out_dma_release
;
}
}
err
=
devm_spi_register_controller
(
&
pdev
->
dev
,
ctlr
);
err
=
spi_register_controller
(
ctlr
);
if
(
err
)
{
if
(
err
)
{
dev_err
(
&
pdev
->
dev
,
"could not register SPI controller: %d
\n
"
,
dev_err
(
&
pdev
->
dev
,
"could not register SPI controller: %d
\n
"
,
err
);
err
);
...
@@ -1374,6 +1374,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
...
@@ -1374,6 +1374,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
bcm2835_debugfs_remove
(
bs
);
bcm2835_debugfs_remove
(
bs
);
spi_unregister_controller
(
ctlr
);
/* Clear FIFOs, and disable the HW block */
/* Clear FIFOs, and disable the HW block */
bcm2835_wr
(
bs
,
BCM2835_SPI_CS
,
bcm2835_wr
(
bs
,
BCM2835_SPI_CS
,
BCM2835_SPI_CS_CLEAR_RX
|
BCM2835_SPI_CS_CLEAR_TX
);
BCM2835_SPI_CS_CLEAR_RX
|
BCM2835_SPI_CS_CLEAR_TX
);
...
...
drivers/spi/spi-bcm2835aux.c
View file @
0c0c5b8f
...
@@ -569,7 +569,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
...
@@ -569,7 +569,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
goto
out_clk_disable
;
goto
out_clk_disable
;
}
}
err
=
devm_spi_register_master
(
&
pdev
->
dev
,
master
);
err
=
spi_register_master
(
master
);
if
(
err
)
{
if
(
err
)
{
dev_err
(
&
pdev
->
dev
,
"could not register SPI master: %d
\n
"
,
err
);
dev_err
(
&
pdev
->
dev
,
"could not register SPI master: %d
\n
"
,
err
);
goto
out_clk_disable
;
goto
out_clk_disable
;
...
@@ -593,6 +593,8 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev)
...
@@ -593,6 +593,8 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev)
bcm2835aux_debugfs_remove
(
bs
);
bcm2835aux_debugfs_remove
(
bs
);
spi_unregister_master
(
master
);
bcm2835aux_spi_reset_hw
(
bs
);
bcm2835aux_spi_reset_hw
(
bs
);
/* disable the HW block by releasing the clock */
/* disable the HW block by releasing the clock */
...
...
drivers/spi/spi-dw.c
View file @
0c0c5b8f
...
@@ -526,7 +526,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
...
@@ -526,7 +526,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
}
}
}
}
ret
=
devm_spi_register_controller
(
dev
,
master
);
ret
=
spi_register_controller
(
master
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
&
master
->
dev
,
"problem registering spi master
\n
"
);
dev_err
(
&
master
->
dev
,
"problem registering spi master
\n
"
);
goto
err_dma_exit
;
goto
err_dma_exit
;
...
@@ -550,6 +550,8 @@ void dw_spi_remove_host(struct dw_spi *dws)
...
@@ -550,6 +550,8 @@ void dw_spi_remove_host(struct dw_spi *dws)
{
{
dw_spi_debugfs_remove
(
dws
);
dw_spi_debugfs_remove
(
dws
);
spi_unregister_controller
(
dws
->
master
);
if
(
dws
->
dma_ops
&&
dws
->
dma_ops
->
dma_exit
)
if
(
dws
->
dma_ops
&&
dws
->
dma_ops
->
dma_exit
)
dws
->
dma_ops
->
dma_exit
(
dws
);
dws
->
dma_ops
->
dma_exit
(
dws
);
...
...
drivers/spi/spi-ep93xx.c
View file @
0c0c5b8f
...
@@ -31,7 +31,8 @@
...
@@ -31,7 +31,8 @@
#include <linux/platform_data/spi-ep93xx.h>
#include <linux/platform_data/spi-ep93xx.h>
#define SSPCR0 0x0000
#define SSPCR0 0x0000
#define SSPCR0_MODE_SHIFT 6
#define SSPCR0_SPO BIT(6)
#define SSPCR0_SPH BIT(7)
#define SSPCR0_SCR_SHIFT 8
#define SSPCR0_SCR_SHIFT 8
#define SSPCR1 0x0004
#define SSPCR1 0x0004
...
@@ -159,7 +160,10 @@ static int ep93xx_spi_chip_setup(struct spi_master *master,
...
@@ -159,7 +160,10 @@ static int ep93xx_spi_chip_setup(struct spi_master *master,
return
err
;
return
err
;
cr0
=
div_scr
<<
SSPCR0_SCR_SHIFT
;
cr0
=
div_scr
<<
SSPCR0_SCR_SHIFT
;
cr0
|=
(
spi
->
mode
&
(
SPI_CPHA
|
SPI_CPOL
))
<<
SSPCR0_MODE_SHIFT
;
if
(
spi
->
mode
&
SPI_CPOL
)
cr0
|=
SSPCR0_SPO
;
if
(
spi
->
mode
&
SPI_CPHA
)
cr0
|=
SSPCR0_SPH
;
cr0
|=
dss
;
cr0
|=
dss
;
dev_dbg
(
&
master
->
dev
,
"setup: mode %d, cpsr %d, scr %d, dss %d
\n
"
,
dev_dbg
(
&
master
->
dev
,
"setup: mode %d, cpsr %d, scr %d, dss %d
\n
"
,
...
...
drivers/spi/spi-mux.c
View file @
0c0c5b8f
...
@@ -51,6 +51,10 @@ static int spi_mux_select(struct spi_device *spi)
...
@@ -51,6 +51,10 @@ static int spi_mux_select(struct spi_device *spi)
struct
spi_mux_priv
*
priv
=
spi_controller_get_devdata
(
spi
->
controller
);
struct
spi_mux_priv
*
priv
=
spi_controller_get_devdata
(
spi
->
controller
);
int
ret
;
int
ret
;
ret
=
mux_control_select
(
priv
->
mux
,
spi
->
chip_select
);
if
(
ret
)
return
ret
;
if
(
priv
->
current_cs
==
spi
->
chip_select
)
if
(
priv
->
current_cs
==
spi
->
chip_select
)
return
0
;
return
0
;
...
@@ -62,10 +66,6 @@ static int spi_mux_select(struct spi_device *spi)
...
@@ -62,10 +66,6 @@ static int spi_mux_select(struct spi_device *spi)
priv
->
spi
->
mode
=
spi
->
mode
;
priv
->
spi
->
mode
=
spi
->
mode
;
priv
->
spi
->
bits_per_word
=
spi
->
bits_per_word
;
priv
->
spi
->
bits_per_word
=
spi
->
bits_per_word
;
ret
=
mux_control_select
(
priv
->
mux
,
spi
->
chip_select
);
if
(
ret
)
return
ret
;
priv
->
current_cs
=
spi
->
chip_select
;
priv
->
current_cs
=
spi
->
chip_select
;
return
0
;
return
0
;
...
...
drivers/spi/spi-pxa2xx.c
View file @
0c0c5b8f
...
@@ -1884,7 +1884,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
...
@@ -1884,7 +1884,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
/* Register with the SPI framework */
/* Register with the SPI framework */
platform_set_drvdata
(
pdev
,
drv_data
);
platform_set_drvdata
(
pdev
,
drv_data
);
status
=
devm_spi_register_controller
(
&
pdev
->
dev
,
controller
);
status
=
spi_register_controller
(
controller
);
if
(
status
!=
0
)
{
if
(
status
!=
0
)
{
dev_err
(
&
pdev
->
dev
,
"problem registering spi controller
\n
"
);
dev_err
(
&
pdev
->
dev
,
"problem registering spi controller
\n
"
);
goto
out_error_pm_runtime_enabled
;
goto
out_error_pm_runtime_enabled
;
...
@@ -1893,7 +1893,6 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
...
@@ -1893,7 +1893,6 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
return
status
;
return
status
;
out_error_pm_runtime_enabled:
out_error_pm_runtime_enabled:
pm_runtime_put_noidle
(
&
pdev
->
dev
);
pm_runtime_disable
(
&
pdev
->
dev
);
pm_runtime_disable
(
&
pdev
->
dev
);
out_error_clock_enabled:
out_error_clock_enabled:
...
@@ -1916,6 +1915,8 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
...
@@ -1916,6 +1915,8 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
pm_runtime_get_sync
(
&
pdev
->
dev
);
pm_runtime_get_sync
(
&
pdev
->
dev
);
spi_unregister_controller
(
drv_data
->
controller
);
/* Disable the SSP at the peripheral and SOC level */
/* Disable the SSP at the peripheral and SOC level */
pxa2xx_spi_write
(
drv_data
,
SSCR0
,
0
);
pxa2xx_spi_write
(
drv_data
,
SSCR0
,
0
);
clk_disable_unprepare
(
ssp
->
clk
);
clk_disable_unprepare
(
ssp
->
clk
);
...
...
drivers/spi/spi-sc18is602.c
View file @
0c0c5b8f
...
@@ -345,6 +345,6 @@ static struct i2c_driver sc18is602_driver = {
...
@@ -345,6 +345,6 @@ static struct i2c_driver sc18is602_driver = {
module_i2c_driver
(
sc18is602_driver
);
module_i2c_driver
(
sc18is602_driver
);
MODULE_DESCRIPTION
(
"SC18I
C
602/603 SPI Master Driver"
);
MODULE_DESCRIPTION
(
"SC18I
S
602/603 SPI Master Driver"
);
MODULE_AUTHOR
(
"Guenter Roeck"
);
MODULE_AUTHOR
(
"Guenter Roeck"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
drivers/spi/spi.c
View file @
0c0c5b8f
...
@@ -2111,6 +2111,7 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
...
@@ -2111,6 +2111,7 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
}
}
lookup
->
max_speed_hz
=
sb
->
connection_speed
;
lookup
->
max_speed_hz
=
sb
->
connection_speed
;
lookup
->
bits_per_word
=
sb
->
data_bit_length
;
if
(
sb
->
clock_phase
==
ACPI_SPI_SECOND_PHASE
)
if
(
sb
->
clock_phase
==
ACPI_SPI_SECOND_PHASE
)
lookup
->
mode
|=
SPI_CPHA
;
lookup
->
mode
|=
SPI_CPHA
;
...
@@ -2760,6 +2761,8 @@ void spi_unregister_controller(struct spi_controller *ctlr)
...
@@ -2760,6 +2761,8 @@ void spi_unregister_controller(struct spi_controller *ctlr)
struct
spi_controller
*
found
;
struct
spi_controller
*
found
;
int
id
=
ctlr
->
bus_num
;
int
id
=
ctlr
->
bus_num
;
device_for_each_child
(
&
ctlr
->
dev
,
NULL
,
__unregister
);
/* First make sure that this controller was ever added */
/* First make sure that this controller was ever added */
mutex_lock
(
&
board_lock
);
mutex_lock
(
&
board_lock
);
found
=
idr_find
(
&
spi_master_idr
,
id
);
found
=
idr_find
(
&
spi_master_idr
,
id
);
...
@@ -2772,7 +2775,6 @@ void spi_unregister_controller(struct spi_controller *ctlr)
...
@@ -2772,7 +2775,6 @@ void spi_unregister_controller(struct spi_controller *ctlr)
list_del
(
&
ctlr
->
list
);
list_del
(
&
ctlr
->
list
);
mutex_unlock
(
&
board_lock
);
mutex_unlock
(
&
board_lock
);
device_for_each_child
(
&
ctlr
->
dev
,
NULL
,
__unregister
);
device_unregister
(
&
ctlr
->
dev
);
device_unregister
(
&
ctlr
->
dev
);
/* free bus id */
/* free bus id */
mutex_lock
(
&
board_lock
);
mutex_lock
(
&
board_lock
);
...
...
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