Skip to content

Commit

Permalink
Merge tag 'spi-fix-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few more fixes for SPI, plus one new PCI ID for another Intel
  chipset.

  All device specific stuff"

* tag 'spi-fix-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller
  spi: cadence-quadspi: fix incorrect supports_op() return value
  spi: intel: Add support for Raptor Lake-S SPI serial flash
  spi: spi-mtk-nor: initialize spi controller after resume
  • Loading branch information
Linus Torvalds committed Apr 19, 2022
2 parents 705191b + 8c235cc commit b7f7340
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/atmel-quadspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ static int atmel_qspi_find_mode(const struct spi_mem_op *op)
static bool atmel_qspi_supports_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{
if (!spi_mem_default_supports_op(mem, op))
return false;

if (atmel_qspi_find_mode(op) < 0)
return false;

Expand Down
19 changes: 17 additions & 2 deletions drivers/spi/spi-cadence-quadspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,9 +1415,24 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
all_false = !op->cmd.dtr && !op->addr.dtr && !op->dummy.dtr &&
!op->data.dtr;

/* Mixed DTR modes not supported. */
if (!(all_true || all_false))
if (all_true) {
/* Right now we only support 8-8-8 DTR mode. */
if (op->cmd.nbytes && op->cmd.buswidth != 8)
return false;
if (op->addr.nbytes && op->addr.buswidth != 8)
return false;
if (op->data.nbytes && op->data.buswidth != 8)
return false;
} else if (all_false) {
/* Only 1-1-X ops are supported without DTR */
if (op->cmd.nbytes && op->cmd.buswidth > 1)
return false;
if (op->addr.nbytes && op->addr.buswidth > 1)
return false;
} else {
/* Mixed DTR modes are not supported. */
return false;
}

return spi_mem_default_supports_op(mem, op);
}
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi-intel-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
{ PCI_VDEVICE(INTEL, 0x4da4), (unsigned long)&bxt_info },
{ PCI_VDEVICE(INTEL, 0x51a4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x54a4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0xa0a4), (unsigned long)&bxt_info },
{ PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)&bxt_info },
Expand Down
12 changes: 11 additions & 1 deletion drivers/spi/spi-mtk-nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,17 @@ static int __maybe_unused mtk_nor_suspend(struct device *dev)

static int __maybe_unused mtk_nor_resume(struct device *dev)
{
return pm_runtime_force_resume(dev);
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
int ret;

ret = pm_runtime_force_resume(dev);
if (ret)
return ret;

mtk_nor_init(sp);

return 0;
}

static const struct dev_pm_ops mtk_nor_pm_ops = {
Expand Down

0 comments on commit b7f7340

Please sign in to comment.