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
262a2f33
Commit
262a2f33
authored
Sep 15, 2019
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'spi-5.3' into spi-linus
parents
f74c2bb9
4c524191
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
7 deletions
+34
-7
Documentation/devicetree/bindings/spi/spi-controller.yaml
Documentation/devicetree/bindings/spi/spi-controller.yaml
+1
-1
drivers/spi/spi-bcm-qspi.c
drivers/spi/spi-bcm-qspi.c
+2
-2
drivers/spi/spi-bcm2835.c
drivers/spi/spi-bcm2835.c
+12
-2
drivers/spi/spi-dw-pci.c
drivers/spi/spi-dw-pci.c
+14
-0
drivers/spi/spi-fsl-dspi.c
drivers/spi/spi-fsl-dspi.c
+3
-1
drivers/spi/spi-uniphier.c
drivers/spi/spi-uniphier.c
+1
-0
drivers/spi/spi-zynq-qspi.c
drivers/spi/spi-zynq-qspi.c
+1
-1
No files found.
Documentation/devicetree/bindings/spi/spi-controller.yaml
View file @
262a2f33
...
@@ -31,7 +31,7 @@ properties:
...
@@ -31,7 +31,7 @@ properties:
If that property is used, the number of chip selects will be
If that property is used, the number of chip selects will be
increased automatically with max(cs-gpios, hardware chip selects).
increased automatically with max(cs-gpios, hardware chip selects).
So if, for example, the controller has
2
CS lines, and the
So if, for example, the controller has
4
CS lines, and the
cs-gpios looks like this
cs-gpios looks like this
cs-gpios = <&gpio1 0 0>, <0>, <&gpio1 1 0>, <&gpio1 2 0>;
cs-gpios = <&gpio1 0 0>, <0>, <&gpio1 1 0>, <&gpio1 2 0>;
...
...
drivers/spi/spi-bcm-qspi.c
View file @
262a2f33
...
@@ -343,7 +343,7 @@ static int bcm_qspi_bspi_set_flex_mode(struct bcm_qspi *qspi,
...
@@ -343,7 +343,7 @@ static int bcm_qspi_bspi_set_flex_mode(struct bcm_qspi *qspi,
{
{
int
bpc
=
0
,
bpp
=
0
;
int
bpc
=
0
,
bpp
=
0
;
u8
command
=
op
->
cmd
.
opcode
;
u8
command
=
op
->
cmd
.
opcode
;
int
width
=
op
->
cmd
.
buswidth
?
op
->
cmd
.
buswidth
:
SPI_NBITS_SINGLE
;
int
width
=
op
->
data
.
buswidth
?
op
->
data
.
buswidth
:
SPI_NBITS_SINGLE
;
int
addrlen
=
op
->
addr
.
nbytes
;
int
addrlen
=
op
->
addr
.
nbytes
;
int
flex_mode
=
1
;
int
flex_mode
=
1
;
...
@@ -981,7 +981,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
...
@@ -981,7 +981,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
if
(
mspi_read
)
if
(
mspi_read
)
return
bcm_qspi_mspi_exec_mem_op
(
spi
,
op
);
return
bcm_qspi_mspi_exec_mem_op
(
spi
,
op
);
ret
=
bcm_qspi_bspi_set_mode
(
qspi
,
op
,
-
1
);
ret
=
bcm_qspi_bspi_set_mode
(
qspi
,
op
,
0
);
if
(
!
ret
)
if
(
!
ret
)
ret
=
bcm_qspi_bspi_exec_mem_op
(
spi
,
op
);
ret
=
bcm_qspi_bspi_exec_mem_op
(
spi
,
op
);
...
...
drivers/spi/spi-bcm2835.c
View file @
262a2f33
...
@@ -319,6 +319,13 @@ static void bcm2835_spi_reset_hw(struct spi_controller *ctlr)
...
@@ -319,6 +319,13 @@ static void bcm2835_spi_reset_hw(struct spi_controller *ctlr)
BCM2835_SPI_CS_INTD
|
BCM2835_SPI_CS_INTD
|
BCM2835_SPI_CS_DMAEN
|
BCM2835_SPI_CS_DMAEN
|
BCM2835_SPI_CS_TA
);
BCM2835_SPI_CS_TA
);
/*
* Transmission sometimes breaks unless the DONE bit is written at the
* end of every transfer. The spec says it's a RO bit. Either the
* spec is wrong and the bit is actually of type RW1C, or it's a
* hardware erratum.
*/
cs
|=
BCM2835_SPI_CS_DONE
;
/* and reset RX/TX FIFOS */
/* and reset RX/TX FIFOS */
cs
|=
BCM2835_SPI_CS_CLEAR_RX
|
BCM2835_SPI_CS_CLEAR_TX
;
cs
|=
BCM2835_SPI_CS_CLEAR_RX
|
BCM2835_SPI_CS_CLEAR_TX
;
...
@@ -477,7 +484,9 @@ static void bcm2835_spi_transfer_prologue(struct spi_controller *ctlr,
...
@@ -477,7 +484,9 @@ static void bcm2835_spi_transfer_prologue(struct spi_controller *ctlr,
bcm2835_wr_fifo_count
(
bs
,
bs
->
rx_prologue
);
bcm2835_wr_fifo_count
(
bs
,
bs
->
rx_prologue
);
bcm2835_wait_tx_fifo_empty
(
bs
);
bcm2835_wait_tx_fifo_empty
(
bs
);
bcm2835_rd_fifo_count
(
bs
,
bs
->
rx_prologue
);
bcm2835_rd_fifo_count
(
bs
,
bs
->
rx_prologue
);
bcm2835_spi_reset_hw
(
ctlr
);
bcm2835_wr
(
bs
,
BCM2835_SPI_CS
,
cs
|
BCM2835_SPI_CS_CLEAR_RX
|
BCM2835_SPI_CS_CLEAR_TX
|
BCM2835_SPI_CS_DONE
);
dma_sync_single_for_device
(
ctlr
->
dma_rx
->
device
->
dev
,
dma_sync_single_for_device
(
ctlr
->
dma_rx
->
device
->
dev
,
sg_dma_address
(
&
tfr
->
rx_sg
.
sgl
[
0
]),
sg_dma_address
(
&
tfr
->
rx_sg
.
sgl
[
0
]),
...
@@ -498,7 +507,8 @@ static void bcm2835_spi_transfer_prologue(struct spi_controller *ctlr,
...
@@ -498,7 +507,8 @@ static void bcm2835_spi_transfer_prologue(struct spi_controller *ctlr,
|
BCM2835_SPI_CS_DMAEN
);
|
BCM2835_SPI_CS_DMAEN
);
bcm2835_wr_fifo_count
(
bs
,
tx_remaining
);
bcm2835_wr_fifo_count
(
bs
,
tx_remaining
);
bcm2835_wait_tx_fifo_empty
(
bs
);
bcm2835_wait_tx_fifo_empty
(
bs
);
bcm2835_wr
(
bs
,
BCM2835_SPI_CS
,
cs
|
BCM2835_SPI_CS_CLEAR_TX
);
bcm2835_wr
(
bs
,
BCM2835_SPI_CS
,
cs
|
BCM2835_SPI_CS_CLEAR_TX
|
BCM2835_SPI_CS_DONE
);
}
}
if
(
likely
(
!
bs
->
tx_spillover
))
{
if
(
likely
(
!
bs
->
tx_spillover
))
{
...
...
drivers/spi/spi-dw-pci.c
View file @
262a2f33
...
@@ -19,6 +19,7 @@ struct spi_pci_desc {
...
@@ -19,6 +19,7 @@ struct spi_pci_desc {
int
(
*
setup
)(
struct
dw_spi
*
);
int
(
*
setup
)(
struct
dw_spi
*
);
u16
num_cs
;
u16
num_cs
;
u16
bus_num
;
u16
bus_num
;
u32
max_freq
;
};
};
static
struct
spi_pci_desc
spi_pci_mid_desc_1
=
{
static
struct
spi_pci_desc
spi_pci_mid_desc_1
=
{
...
@@ -33,6 +34,12 @@ static struct spi_pci_desc spi_pci_mid_desc_2 = {
...
@@ -33,6 +34,12 @@ static struct spi_pci_desc spi_pci_mid_desc_2 = {
.
bus_num
=
1
,
.
bus_num
=
1
,
};
};
static
struct
spi_pci_desc
spi_pci_ehl_desc
=
{
.
num_cs
=
1
,
.
bus_num
=
-
1
,
.
max_freq
=
100000000
,
};
static
int
spi_pci_probe
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
)
static
int
spi_pci_probe
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
)
{
{
struct
dw_spi
*
dws
;
struct
dw_spi
*
dws
;
...
@@ -65,6 +72,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
...
@@ -65,6 +72,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if
(
desc
)
{
if
(
desc
)
{
dws
->
num_cs
=
desc
->
num_cs
;
dws
->
num_cs
=
desc
->
num_cs
;
dws
->
bus_num
=
desc
->
bus_num
;
dws
->
bus_num
=
desc
->
bus_num
;
dws
->
max_freq
=
desc
->
max_freq
;
if
(
desc
->
setup
)
{
if
(
desc
->
setup
)
{
ret
=
desc
->
setup
(
dws
);
ret
=
desc
->
setup
(
dws
);
...
@@ -125,8 +133,14 @@ static const struct pci_device_id pci_ids[] = {
...
@@ -125,8 +133,14 @@ static const struct pci_device_id pci_ids[] = {
{
PCI_VDEVICE
(
INTEL
,
0x0800
),
(
kernel_ulong_t
)
&
spi_pci_mid_desc_1
},
{
PCI_VDEVICE
(
INTEL
,
0x0800
),
(
kernel_ulong_t
)
&
spi_pci_mid_desc_1
},
/* Intel MID platform SPI controller 2 */
/* Intel MID platform SPI controller 2 */
{
PCI_VDEVICE
(
INTEL
,
0x0812
),
(
kernel_ulong_t
)
&
spi_pci_mid_desc_2
},
{
PCI_VDEVICE
(
INTEL
,
0x0812
),
(
kernel_ulong_t
)
&
spi_pci_mid_desc_2
},
/* Intel Elkhart Lake PSE SPI controllers */
{
PCI_VDEVICE
(
INTEL
,
0x4b84
),
(
kernel_ulong_t
)
&
spi_pci_ehl_desc
},
{
PCI_VDEVICE
(
INTEL
,
0x4b85
),
(
kernel_ulong_t
)
&
spi_pci_ehl_desc
},
{
PCI_VDEVICE
(
INTEL
,
0x4b86
),
(
kernel_ulong_t
)
&
spi_pci_ehl_desc
},
{
PCI_VDEVICE
(
INTEL
,
0x4b87
),
(
kernel_ulong_t
)
&
spi_pci_ehl_desc
},
{},
{},
};
};
MODULE_DEVICE_TABLE
(
pci
,
pci_ids
);
static
struct
pci_driver
dw_spi_driver
=
{
static
struct
pci_driver
dw_spi_driver
=
{
.
name
=
DRIVER_NAME
,
.
name
=
DRIVER_NAME
,
...
...
drivers/spi/spi-fsl-dspi.c
View file @
262a2f33
...
@@ -886,9 +886,11 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
...
@@ -886,9 +886,11 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
trans_mode
);
trans_mode
);
}
}
}
}
return
IRQ_HANDLED
;
}
}
return
IRQ_
HANDLED
;
return
IRQ_
NONE
;
}
}
static
const
struct
of_device_id
fsl_dspi_dt_ids
[]
=
{
static
const
struct
of_device_id
fsl_dspi_dt_ids
[]
=
{
...
...
drivers/spi/spi-uniphier.c
View file @
262a2f33
...
@@ -214,6 +214,7 @@ static void uniphier_spi_setup_transfer(struct spi_device *spi,
...
@@ -214,6 +214,7 @@ static void uniphier_spi_setup_transfer(struct spi_device *spi,
if
(
!
priv
->
is_save_param
||
priv
->
mode
!=
spi
->
mode
)
{
if
(
!
priv
->
is_save_param
||
priv
->
mode
!=
spi
->
mode
)
{
uniphier_spi_set_mode
(
spi
);
uniphier_spi_set_mode
(
spi
);
priv
->
mode
=
spi
->
mode
;
priv
->
mode
=
spi
->
mode
;
priv
->
is_save_param
=
false
;
}
}
if
(
!
priv
->
is_save_param
||
priv
->
bits_per_word
!=
t
->
bits_per_word
)
{
if
(
!
priv
->
is_save_param
||
priv
->
bits_per_word
!=
t
->
bits_per_word
)
{
...
...
drivers/spi/spi-zynq-qspi.c
View file @
262a2f33
...
@@ -695,7 +695,7 @@ static int zynq_qspi_probe(struct platform_device *pdev)
...
@@ -695,7 +695,7 @@ static int zynq_qspi_probe(struct platform_device *pdev)
ctlr
->
setup
=
zynq_qspi_setup_op
;
ctlr
->
setup
=
zynq_qspi_setup_op
;
ctlr
->
max_speed_hz
=
clk_get_rate
(
xqspi
->
refclk
)
/
2
;
ctlr
->
max_speed_hz
=
clk_get_rate
(
xqspi
->
refclk
)
/
2
;
ctlr
->
dev
.
of_node
=
np
;
ctlr
->
dev
.
of_node
=
np
;
ret
=
spi_register_controller
(
ctlr
);
ret
=
devm_spi_register_controller
(
&
pdev
->
dev
,
ctlr
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"spi_register_master failed
\n
"
);
dev_err
(
&
pdev
->
dev
,
"spi_register_master failed
\n
"
);
goto
clk_dis_all
;
goto
clk_dis_all
;
...
...
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