diff options
author | Mark Brown <broonie@kernel.org> | 2019-08-23 07:00:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-08-23 07:00:22 -0400 |
commit | 795227660d05e109b57896e2df1de0f012c64662 (patch) | |
tree | 063c92088ee4c90b006a3b7e5c8f7837280694f7 | |
parent | be28f76b7e8ffaf04690e30fd17683d8afea1fd9 (diff) | |
parent | d41f36a6464a85c06ad920703d878e4491d2c023 (diff) |
Merge branch 'spi-5.3' into spi-5.4
-rw-r--r-- | Documentation/devicetree/bindings/spi/spi-controller.yaml | 3 | ||||
-rw-r--r-- | drivers/spi/spi-bcm-qspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-dw-pci.c | 13 | ||||
-rw-r--r-- | drivers/spi/spi-fsl-qspi.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-gpio.c | 6 | ||||
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 14 | ||||
-rw-r--r-- | drivers/spi/spi-zynq-qspi.c | 2 |
8 files changed, 38 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index 876c0623f322..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 | ||
@@ -73,7 +73,6 @@ patternProperties: | |||
73 | Compatible of the SPI device. | 73 | Compatible of the SPI device. |
74 | 74 | ||
75 | reg: | 75 | reg: |
76 | maxItems: 1 | ||
77 | minimum: 0 | 76 | minimum: 0 |
78 | maximum: 256 | 77 | maximum: 256 |
79 | description: | 78 | description: |
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 c96797844688..4b89e0a04ffd 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c | |||
@@ -834,7 +834,8 @@ static int bcm2835_spi_transfer_one(struct spi_controller *ctlr, | |||
834 | bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); | 834 | bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); |
835 | 835 | ||
836 | /* handle all the 3-wire mode */ | 836 | /* handle all the 3-wire mode */ |
837 | if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf)) | 837 | if (spi->mode & SPI_3WIRE && tfr->rx_buf && |
838 | tfr->rx_buf != ctlr->dummy_rx) | ||
838 | cs |= BCM2835_SPI_CS_REN; | 839 | cs |= BCM2835_SPI_CS_REN; |
839 | else | 840 | else |
840 | cs &= ~BCM2835_SPI_CS_REN; | 841 | cs &= ~BCM2835_SPI_CS_REN; |
diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c index c1e2401cace0..4e3a4c317636 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); |
@@ -123,6 +131,11 @@ static const struct pci_device_id pci_ids[] = { | |||
123 | { PCI_VDEVICE(INTEL, 0x0800), (kernel_ulong_t)&spi_pci_mid_desc_1}, | 131 | { PCI_VDEVICE(INTEL, 0x0800), (kernel_ulong_t)&spi_pci_mid_desc_1}, |
124 | /* Intel MID platform SPI controller 2 */ | 132 | /* Intel MID platform SPI controller 2 */ |
125 | { PCI_VDEVICE(INTEL, 0x0812), (kernel_ulong_t)&spi_pci_mid_desc_2}, | 133 | { PCI_VDEVICE(INTEL, 0x0812), (kernel_ulong_t)&spi_pci_mid_desc_2}, |
134 | /* Intel Elkhart Lake PSE SPI controllers */ | ||
135 | { PCI_VDEVICE(INTEL, 0x4b84), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
136 | { PCI_VDEVICE(INTEL, 0x4b85), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
137 | { PCI_VDEVICE(INTEL, 0x4b86), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
138 | { PCI_VDEVICE(INTEL, 0x4b87), (kernel_ulong_t)&spi_pci_ehl_desc}, | ||
126 | {}, | 139 | {}, |
127 | }; | 140 | }; |
128 | 141 | ||
diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index 443d4c1196c2..c02e24c01136 100644 --- a/drivers/spi/spi-fsl-qspi.c +++ b/drivers/spi/spi-fsl-qspi.c | |||
@@ -206,7 +206,7 @@ static const struct fsl_qspi_devtype_data imx6sx_data = { | |||
206 | }; | 206 | }; |
207 | 207 | ||
208 | static const struct fsl_qspi_devtype_data imx7d_data = { | 208 | static const struct fsl_qspi_devtype_data imx7d_data = { |
209 | .rxfifo = SZ_512, | 209 | .rxfifo = SZ_128, |
210 | .txfifo = SZ_512, | 210 | .txfifo = SZ_512, |
211 | .ahb_buf_size = SZ_1K, | 211 | .ahb_buf_size = SZ_1K, |
212 | .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_4X_INT_CLK, | 212 | .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_4X_INT_CLK, |
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index eca9d52ecf65..9eb82150666e 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c | |||
@@ -410,6 +410,12 @@ static int spi_gpio_probe(struct platform_device *pdev) | |||
410 | 410 | ||
411 | bb = &spi_gpio->bitbang; | 411 | bb = &spi_gpio->bitbang; |
412 | bb->master = master; | 412 | bb->master = master; |
413 | /* | ||
414 | * There is some additional business, apart from driving the CS GPIO | ||
415 | * line, that we need to do on selection. This makes the local | ||
416 | * callback for chipselect always get called. | ||
417 | */ | ||
418 | master->flags |= SPI_MASTER_GPIO_SS; | ||
413 | bb->chipselect = spi_gpio_chipselect; | 419 | bb->chipselect = spi_gpio_chipselect; |
414 | bb->set_line_direction = spi_gpio_set_direction; | 420 | bb->set_line_direction = spi_gpio_set_direction; |
415 | 421 | ||
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index fc7ab4b26880..bb6a14d1ab0f 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1457,6 +1457,14 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = { | |||
1457 | { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP }, | 1457 | { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP }, |
1458 | { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP }, | 1458 | { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP }, |
1459 | { PCI_VDEVICE(INTEL, 0x02fb), LPSS_CNL_SSP }, | 1459 | { PCI_VDEVICE(INTEL, 0x02fb), LPSS_CNL_SSP }, |
1460 | /* TGL-LP */ | ||
1461 | { PCI_VDEVICE(INTEL, 0xa0aa), LPSS_CNL_SSP }, | ||
1462 | { PCI_VDEVICE(INTEL, 0xa0ab), LPSS_CNL_SSP }, | ||
1463 | { PCI_VDEVICE(INTEL, 0xa0de), LPSS_CNL_SSP }, | ||
1464 | { PCI_VDEVICE(INTEL, 0xa0df), LPSS_CNL_SSP }, | ||
1465 | { PCI_VDEVICE(INTEL, 0xa0fb), LPSS_CNL_SSP }, | ||
1466 | { PCI_VDEVICE(INTEL, 0xa0fd), LPSS_CNL_SSP }, | ||
1467 | { PCI_VDEVICE(INTEL, 0xa0fe), LPSS_CNL_SSP }, | ||
1460 | { }, | 1468 | { }, |
1461 | }; | 1469 | }; |
1462 | 1470 | ||
@@ -1831,14 +1839,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) | |||
1831 | status = devm_spi_register_controller(&pdev->dev, controller); | 1839 | status = devm_spi_register_controller(&pdev->dev, controller); |
1832 | if (status != 0) { | 1840 | if (status != 0) { |
1833 | dev_err(&pdev->dev, "problem registering spi controller\n"); | 1841 | dev_err(&pdev->dev, "problem registering spi controller\n"); |
1834 | goto out_error_clock_enabled; | 1842 | goto out_error_pm_runtime_enabled; |
1835 | } | 1843 | } |
1836 | 1844 | ||
1837 | return status; | 1845 | return status; |
1838 | 1846 | ||
1839 | out_error_clock_enabled: | 1847 | out_error_pm_runtime_enabled: |
1840 | pm_runtime_put_noidle(&pdev->dev); | 1848 | pm_runtime_put_noidle(&pdev->dev); |
1841 | pm_runtime_disable(&pdev->dev); | 1849 | pm_runtime_disable(&pdev->dev); |
1850 | |||
1851 | out_error_clock_enabled: | ||
1842 | clk_disable_unprepare(ssp->clk); | 1852 | clk_disable_unprepare(ssp->clk); |
1843 | 1853 | ||
1844 | out_error_dma_irq_alloc: | 1854 | out_error_dma_irq_alloc: |
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c index 3155e2cabb1e..4a5326ccf65a 100644 --- a/drivers/spi/spi-zynq-qspi.c +++ b/drivers/spi/spi-zynq-qspi.c | |||
@@ -694,7 +694,7 @@ static int zynq_qspi_probe(struct platform_device *pdev) | |||
694 | ctlr->setup = zynq_qspi_setup_op; | 694 | ctlr->setup = zynq_qspi_setup_op; |
695 | ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2; | 695 | ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2; |
696 | ctlr->dev.of_node = np; | 696 | ctlr->dev.of_node = np; |
697 | ret = spi_register_controller(ctlr); | 697 | ret = devm_spi_register_controller(&pdev->dev, ctlr); |
698 | if (ret) { | 698 | if (ret) { |
699 | dev_err(&pdev->dev, "spi_register_master failed\n"); | 699 | dev_err(&pdev->dev, "spi_register_master failed\n"); |
700 | goto clk_dis_all; | 700 | goto clk_dis_all; |