Skip to content

Commit 1b2e883

Browse files
committed
spi: Merge up fix
One small fix that didn't seem worth sending before the merge window.
2 parents 75223bb + c3aa5cb commit 1b2e883

File tree

9 files changed

+37
-10
lines changed

9 files changed

+37
-10
lines changed

Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ properties:
2222
- const: fsl,imx35-cspi
2323
- const: fsl,imx51-ecspi
2424
- const: fsl,imx53-ecspi
25+
- items:
26+
- enum:
27+
- fsl,imx25-cspi
28+
- fsl,imx50-cspi
29+
- fsl,imx51-cspi
30+
- fsl,imx53-cspi
31+
- const: fsl,imx35-cspi
2532
- items:
2633
- const: fsl,imx8mp-ecspi
2734
- const: fsl,imx6ul-ecspi

drivers/spi/spi-cs42l43.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ static int cs42l43_spi_probe(struct platform_device *pdev)
256256

257257
ret = devm_spi_register_controller(priv->dev, priv->ctlr);
258258
if (ret) {
259-
pm_runtime_disable(priv->dev);
260259
dev_err(priv->dev, "Failed to register SPI controller: %d\n", ret);
261260
}
262261

drivers/spi/spi-gxp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static ssize_t gxp_spi_write(struct gxp_spi_chip *chip, const struct spi_mem_op
194194
return ret;
195195
}
196196

197-
return write_len;
197+
return 0;
198198
}
199199

200200
static int do_gxp_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op)

drivers/spi/spi-imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx,
662662
if (spi_imx->count >= 512)
663663
ctrl |= 0xFFF << MX51_ECSPI_CTRL_BL_OFFSET;
664664
else
665-
ctrl |= (spi_imx->count*8 - 1)
665+
ctrl |= (spi_imx->count * spi_imx->bits_per_word - 1)
666666
<< MX51_ECSPI_CTRL_BL_OFFSET;
667667
}
668668

drivers/spi/spi-intel-pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
7272
{ PCI_VDEVICE(INTEL, 0x4da4), (unsigned long)&bxt_info },
7373
{ PCI_VDEVICE(INTEL, 0x51a4), (unsigned long)&cnl_info },
7474
{ PCI_VDEVICE(INTEL, 0x54a4), (unsigned long)&cnl_info },
75+
{ PCI_VDEVICE(INTEL, 0x5794), (unsigned long)&cnl_info },
7576
{ PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info },
7677
{ PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
7778
{ PCI_VDEVICE(INTEL, 0x7e23), (unsigned long)&cnl_info },

drivers/spi/spi-npcm-fiu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem,
353353
uma_cfg |= ilog2(op->cmd.buswidth);
354354
uma_cfg |= ilog2(op->addr.buswidth)
355355
<< NPCM_FIU_UMA_CFG_ADBPCK_SHIFT;
356-
uma_cfg |= ilog2(op->dummy.buswidth)
357-
<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
356+
if (op->dummy.nbytes)
357+
uma_cfg |= ilog2(op->dummy.buswidth)
358+
<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
358359
uma_cfg |= ilog2(op->data.buswidth)
359360
<< NPCM_FIU_UMA_CFG_RDBPCK_SHIFT;
360361
uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT;

drivers/spi/spi-nxp-fspi.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static int nxp_fspi_read_ahb(struct nxp_fspi *f, const struct spi_mem_op *op)
759759
f->memmap_len = len > NXP_FSPI_MIN_IOMAP ?
760760
len : NXP_FSPI_MIN_IOMAP;
761761

762-
f->ahb_addr = ioremap_wc(f->memmap_phy + f->memmap_start,
762+
f->ahb_addr = ioremap(f->memmap_phy + f->memmap_start,
763763
f->memmap_len);
764764

765765
if (!f->ahb_addr) {
@@ -1084,6 +1084,13 @@ static int nxp_fspi_default_setup(struct nxp_fspi *f)
10841084
fspi_writel(f, FSPI_AHBCR_PREF_EN | FSPI_AHBCR_RDADDROPT,
10851085
base + FSPI_AHBCR);
10861086

1087+
/* Reset the FLSHxCR1 registers. */
1088+
reg = FSPI_FLSHXCR1_TCSH(0x3) | FSPI_FLSHXCR1_TCSS(0x3);
1089+
fspi_writel(f, reg, base + FSPI_FLSHA1CR1);
1090+
fspi_writel(f, reg, base + FSPI_FLSHA2CR1);
1091+
fspi_writel(f, reg, base + FSPI_FLSHB1CR1);
1092+
fspi_writel(f, reg, base + FSPI_FLSHB2CR1);
1093+
10871094
/* AHB Read - Set lut sequence ID for all CS. */
10881095
fspi_writel(f, SEQID_LUT, base + FSPI_FLSHA1CR2);
10891096
fspi_writel(f, SEQID_LUT, base + FSPI_FLSHA2CR2);

drivers/spi/spi-stm32.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ struct stm32_spi_cfg {
278278
* @fifo_size: size of the embedded fifo in bytes
279279
* @cur_midi: master inter-data idleness in ns
280280
* @cur_speed: speed configured in Hz
281+
* @cur_half_period: time of a half bit in us
281282
* @cur_bpw: number of bits in a single SPI data frame
282283
* @cur_fthlv: fifo threshold level (data frames in a single data packet)
283284
* @cur_comm: SPI communication mode
@@ -305,6 +306,7 @@ struct stm32_spi {
305306

306307
unsigned int cur_midi;
307308
unsigned int cur_speed;
309+
unsigned int cur_half_period;
308310
unsigned int cur_bpw;
309311
unsigned int cur_fthlv;
310312
unsigned int cur_comm;
@@ -469,6 +471,8 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz,
469471

470472
spi->cur_speed = spi->clk_rate / (1 << mbrdiv);
471473

474+
spi->cur_half_period = DIV_ROUND_CLOSEST(USEC_PER_SEC, 2 * spi->cur_speed);
475+
472476
return mbrdiv - 1;
473477
}
474478

@@ -710,6 +714,10 @@ static void stm32h7_spi_disable(struct stm32_spi *spi)
710714
return;
711715
}
712716

717+
/* Add a delay to make sure that transmission is ended. */
718+
if (spi->cur_half_period)
719+
udelay(spi->cur_half_period);
720+
713721
if (spi->cur_usedma && spi->dma_tx)
714722
dmaengine_terminate_async(spi->dma_tx);
715723
if (spi->cur_usedma && spi->dma_rx)

drivers/spi/spi-zynqmp-gqspi.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,9 +1340,9 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
13401340
return 0;
13411341

13421342
clk_dis_all:
1343-
pm_runtime_put_sync(&pdev->dev);
1344-
pm_runtime_set_suspended(&pdev->dev);
13451343
pm_runtime_disable(&pdev->dev);
1344+
pm_runtime_put_noidle(&pdev->dev);
1345+
pm_runtime_set_suspended(&pdev->dev);
13461346
clk_disable_unprepare(xqspi->refclk);
13471347
clk_dis_pclk:
13481348
clk_disable_unprepare(xqspi->pclk);
@@ -1366,11 +1366,15 @@ static void zynqmp_qspi_remove(struct platform_device *pdev)
13661366
{
13671367
struct zynqmp_qspi *xqspi = platform_get_drvdata(pdev);
13681368

1369+
pm_runtime_get_sync(&pdev->dev);
1370+
13691371
zynqmp_gqspi_write(xqspi, GQSPI_EN_OFST, 0x0);
1372+
1373+
pm_runtime_disable(&pdev->dev);
1374+
pm_runtime_put_noidle(&pdev->dev);
1375+
pm_runtime_set_suspended(&pdev->dev);
13701376
clk_disable_unprepare(xqspi->refclk);
13711377
clk_disable_unprepare(xqspi->pclk);
1372-
pm_runtime_set_suspended(&pdev->dev);
1373-
pm_runtime_disable(&pdev->dev);
13741378
}
13751379

13761380
MODULE_DEVICE_TABLE(of, zynqmp_qspi_of_match);

0 commit comments

Comments
 (0)