diff options
author | Mark Brown <broonie@kernel.org> | 2019-09-15 05:32:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-15 05:32:04 -0400 |
commit | 262a2f33454fcecdc2032ca84d6fecdb08233468 (patch) | |
tree | 0689eaf3ef298f1ebd62db89a6c19680e5eb479c | |
parent | f74c2bb98776e2de508f4d607cd519873065118e (diff) | |
parent | 4c524191c0a21d758b519087c64f84348095e940 (diff) |
Merge branch 'spi-5.3' into spi-linus
-rw-r--r-- | Documentation/devicetree/bindings/spi/spi-controller.yaml | 2 | ||||
-rw-r--r-- | drivers/spi/spi-bcm-qspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 14 | ||||
-rw-r--r-- | drivers/spi/spi-dw-pci.c | 14 | ||||
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-uniphier.c | 1 | ||||
-rw-r--r-- | drivers/spi/spi-zynq-qspi.c | 2 |
7 files changed, 34 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index a02e2fe2bfb2..732339275848 100644 --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml | |||
@@ -31,7 +31,7 @@ properties: | |||
31 | If that property is used, the number of chip selects will be | 31 | If that property is used, the number of chip selects will be |
32 | increased automatically with max(cs-gpios, hardware chip selects). | 32 | increased automatically with max(cs-gpios, hardware chip selects). |
33 | 33 | ||
34 | So if, for example, the controller has 2 CS lines, and the | 34 | So if, for example, the controller has 4 CS lines, and the |
35 | cs-gpios looks like this | 35 | cs-gpios looks like this |
36 | cs-gpios = <&gpio1 0 0>, <0>, <&gpio1 1 0>, <&gpio1 2 0>; | 36 | cs-gpios = <&gpio1 0 0>, <0>, <&gpio1 1 0>, <&gpio1 2 0>; |
37 | 37 | ||
diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 902bdbfedea8..0dbfd2496ab8 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c | |||
@@ -343,7 +343,7 @@ static int bcm_qspi_bspi_set_flex_mode(struct bcm_qspi *qspi, | |||
343 | { | 343 | { |
344 | int bpc = 0, bpp = 0; | 344 | int bpc = 0, bpp = 0; |
345 | u8 command = op->cmd.opcode; | 345 | u8 command = op->cmd.opcode; |
346 | int width = op->cmd.buswidth ? op->cmd.buswidth : SPI_NBITS_SINGLE; | 346 | int width = op->data.buswidth ? op->data.buswidth : SPI_NBITS_SINGLE; |
347 | int addrlen = op->addr.nbytes; | 347 | int addrlen = op->addr.nbytes; |
348 | int flex_mode = 1; | 348 | int flex_mode = 1; |
349 | 349 | ||
@@ -981,7 +981,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem, | |||
981 | if (mspi_read) | 981 | if (mspi_read) |
982 | return bcm_qspi_mspi_exec_mem_op(spi, op); | 982 | return bcm_qspi_mspi_exec_mem_op(spi, op); |
983 | 983 | ||
984 | ret = bcm_qspi_bspi_set_mode(qspi, op, -1); | 984 | ret = bcm_qspi_bspi_set_mode(qspi, op, 0); |
985 | 985 | ||
986 | if (!ret) | 986 | if (!ret) |
987 | ret = bcm_qspi_bspi_exec_mem_op(spi, op); | 987 | ret = bcm_qspi_bspi_exec_mem_op(spi, op); |
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 840b1b8ff3dc..dfdcebb38830 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c | |||
@@ -319,6 +319,13 @@ static void bcm2835_spi_reset_hw(struct spi_controller *ctlr) | |||
319 | BCM2835_SPI_CS_INTD | | 319 | BCM2835_SPI_CS_INTD | |
320 | BCM2835_SPI_CS_DMAEN | | 320 | BCM2835_SPI_CS_DMAEN | |
321 | BCM2835_SPI_CS_TA); | 321 | BCM2835_SPI_CS_TA); |
322 | /* | ||
323 | * Transmission sometimes breaks unless the DONE bit is written at the | ||
324 | * end of every transfer. The spec says it's a RO bit. Either the | ||
325 | * spec is wrong and the bit is actually of type RW1C, or it's a | ||
326 | * hardware erratum. | ||
327 | */ | ||
328 | cs |= BCM2835_SPI_CS_DONE; | ||
322 | /* and reset RX/TX FIFOS */ | 329 | /* and reset RX/TX FIFOS */ |
323 | cs |= BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX; | 330 | cs |= BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX; |
324 | 331 | ||
@@ -477,7 +484,9 @@ static void bcm2835_spi_transfer_prologue(struct spi_controller *ctlr, | |||
477 | bcm2835_wr_fifo_count(bs, bs->rx_prologue); | 484 | bcm2835_wr_fifo_count(bs, bs->rx_prologue); |
478 | bcm2835_wait_tx_fifo_empty(bs); | 485 | bcm2835_wait_tx_fifo_empty(bs); |
479 | bcm2835_rd_fifo_count(bs, bs->rx_prologue); | 486 | bcm2835_rd_fifo_count(bs, bs->rx_prologue); |
480 | bcm2835_spi_reset_hw(ctlr); | 487 | bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_RX |
488 | | BCM2835_SPI_CS_CLEAR_TX | ||
489 | | BCM2835_SPI_CS_DONE); | ||
481 | 490 | ||
482 | dma_sync_single_for_device(ctlr->dma_rx->device->dev, | 491 | dma_sync_single_for_device(ctlr->dma_rx->device->dev, |
483 | sg_dma_address(&tfr->rx_sg.sgl[0]), | 492 | sg_dma_address(&tfr->rx_sg.sgl[0]), |
@@ -498,7 +507,8 @@ static void bcm2835_spi_transfer_prologue(struct spi_controller *ctlr, | |||
498 | | BCM2835_SPI_CS_DMAEN); | 507 | | BCM2835_SPI_CS_DMAEN); |
499 | bcm2835_wr_fifo_count(bs, tx_remaining); | 508 | bcm2835_wr_fifo_count(bs, tx_remaining); |
500 | bcm2835_wait_tx_fifo_empty(bs); | 509 | bcm2835_wait_tx_fifo_empty(bs); |
501 | bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_TX); | 510 | bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_TX |
511 | | BCM2835_SPI_CS_DONE); | ||
502 | } | 512 | } |
503 | 513 | ||
504 | if (likely(!bs->tx_spillover)) { | 514 | if (likely(!bs->tx_spillover)) { |
diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c index 9651679ee7f7..90e7b789da3b 100644 --- a/drivers/spi/spi-dw-pci.c +++ b/drivers/spi/spi-dw-pci.c | |||
@@ -19,6 +19,7 @@ struct spi_pci_desc { | |||
19 | int (*setup)(struct dw_spi *); | 19 | int (*setup)(struct dw_spi *); |
20 | u16 num_cs; | 20 | u16 num_cs; |
21 | u16 bus_num; | 21 | u16 bus_num; |
22 | u32 max_freq; | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | static struct spi_pci_desc spi_pci_mid_desc_1 = { | 25 | 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 | .bus_num = 1, | 34 | .bus_num = 1, |
34 | }; | 35 | }; |
35 | 36 | ||
37 | static struct spi_pci_desc spi_pci_ehl_desc = { | ||
38 | .num_cs = 1, | ||
39 | .bus_num = -1, | ||
40 | .max_freq = 100000000, | ||
41 | }; | ||
42 | |||
36 | static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 43 | static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
37 | { | 44 | { |
38 | struct dw_spi *dws; | 45 | struct dw_spi *dws; |
@@ -65,6 +72,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
65 | if (desc) { | 72 | if (desc) { |
66 | dws->num_cs = desc->num_cs; | 73 | dws->num_cs = desc->num_cs; |
67 | dws->bus_num = desc->bus_num; | 74 | dws->bus_num = desc->bus_num; |
75 | dws->max_freq = desc->max_freq; | ||
68 | 76 | ||
69 | if (desc->setup) { | 77 | if (desc->setup) { |
70 | ret = desc->setup(dws); | 78 | ret = desc->setup(dws); |
@@ -125,8 +133,14 @@ static const struct pci_device_id pci_ids[] = { | |||
125 | { PCI_VDEVICE(INTEL, 0x0800), (kernel_ulong_t)&spi_pci_mid_desc_1}, | 133 | { PCI_VDEVICE(INTEL, 0x0800), (kernel_ulong_t)&spi_pci_mid_desc_1}, |
126 | /* Intel MID platform SPI controller 2 */ | 134 | /* Intel MID platform SPI controller 2 */ |
127 | { PCI_VDEVICE(INTEL, 0x0812), (kernel_ulong_t)&spi_pci_mid_desc_2}, | 135 | { PCI_VDEVICE(INTEL, 0x0812), (kernel_ulong_t)&spi_pci_mid_desc_2}, |
136 | /* Intel Elkhart Lake PSE SPI controllers */ | ||
137 | { PCI_VDEVICE(INTEL, 0x4b84), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
138 | { PCI_VDEVICE(INTEL, 0x4b85), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
139 | { PCI_VDEVICE(INTEL, 0x4b86), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
140 | { PCI_VDEVICE(INTEL, 0x4b87), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
128 | {}, | 141 | {}, |
129 | }; | 142 | }; |
143 | MODULE_DEVICE_TABLE(pci, pci_ids); | ||
130 | 144 | ||
131 | static struct pci_driver dw_spi_driver = { | 145 | static struct pci_driver dw_spi_driver = { |
132 | .name = DRIVER_NAME, | 146 | .name = DRIVER_NAME, |
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 53335ccc98f6..545fc8189fb0 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c | |||
@@ -886,9 +886,11 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id) | |||
886 | trans_mode); | 886 | trans_mode); |
887 | } | 887 | } |
888 | } | 888 | } |
889 | |||
890 | return IRQ_HANDLED; | ||
889 | } | 891 | } |
890 | 892 | ||
891 | return IRQ_HANDLED; | 893 | return IRQ_NONE; |
892 | } | 894 | } |
893 | 895 | ||
894 | static const struct of_device_id fsl_dspi_dt_ids[] = { | 896 | static const struct of_device_id fsl_dspi_dt_ids[] = { |
diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c index b32c77df5d49..4e99a0f25c29 100644 --- a/drivers/spi/spi-uniphier.c +++ b/drivers/spi/spi-uniphier.c | |||
@@ -214,6 +214,7 @@ static void uniphier_spi_setup_transfer(struct spi_device *spi, | |||
214 | if (!priv->is_save_param || priv->mode != spi->mode) { | 214 | if (!priv->is_save_param || priv->mode != spi->mode) { |
215 | uniphier_spi_set_mode(spi); | 215 | uniphier_spi_set_mode(spi); |
216 | priv->mode = spi->mode; | 216 | priv->mode = spi->mode; |
217 | priv->is_save_param = false; | ||
217 | } | 218 | } |
218 | 219 | ||
219 | if (!priv->is_save_param || priv->bits_per_word != t->bits_per_word) { | 220 | if (!priv->is_save_param || priv->bits_per_word != t->bits_per_word) { |
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c index c6bee67decb5..d812a215ae5c 100644 --- a/drivers/spi/spi-zynq-qspi.c +++ b/drivers/spi/spi-zynq-qspi.c | |||
@@ -695,7 +695,7 @@ static int zynq_qspi_probe(struct platform_device *pdev) | |||
695 | ctlr->setup = zynq_qspi_setup_op; | 695 | ctlr->setup = zynq_qspi_setup_op; |
696 | ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2; | 696 | ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2; |
697 | ctlr->dev.of_node = np; | 697 | ctlr->dev.of_node = np; |
698 | ret = spi_register_controller(ctlr); | 698 | ret = devm_spi_register_controller(&pdev->dev, ctlr); |
699 | if (ret) { | 699 | if (ret) { |
700 | dev_err(&pdev->dev, "spi_register_master failed\n"); | 700 | dev_err(&pdev->dev, "spi_register_master failed\n"); |
701 | goto clk_dis_all; | 701 | goto clk_dis_all; |