diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-11 23:19:47 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-11 23:19:47 +0300 |
commit | 282aa44c21708835517ffaa31c63ab651248cf5e (patch) | |
tree | 43b9b3a257da33031144d1481afdedf1ba00d20a /drivers/spi/spi-hisi-kunpeng.c | |
parent | fef8dfaea9d6c444b6c2174b3a2b0fca4d226c5e (diff) | |
parent | 19629ae482f1800b50a5bdf2504ac57171d2bb82 (diff) | |
download | linux-282aa44c21708835517ffaa31c63ab651248cf5e.tar.xz |
Merge tag 'spi-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown:
"This has mostly been a quiet release for the SPI subsystem, almost all
cleanups and fixes to existing drivers.
A couple of changes that stand out:
- Cleanups and support for version specific features in the
DesignWare controller.
- Removal of support for Netlogic devices from the XLP driver, the
platform had previously been removed by MIPS so the support
couldn't be used.
- Conversion of several DT bindings to YAML format"
* tag 'spi-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (53 commits)
spi: don't include ptp_clock_kernel.h in spi.h
spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe
spi: atmel: Fix typo
spi: dt-bindings: mediatek,spi-mtk-nor: Fix example 'interrupts' property
spi: qcom: geni: handle timeout for gpi mode
spi: qcom: geni: set the error code for gpi transfer
spi: spi-mux: Add reference to spi-peripheral-props.yaml schema
spi: ar934x: fix transfer size
spi: pxa2xx: Propagate firmware node
spi: dw: Propagate firmware node
spi: dln2: Propagate firmware node
spi: ar934x: fix transfer and word delays
spi: uniphier: Fix a bug that doesn't point to private data correctly
spi: spi-mtk-nor: add new clock name 'axi' for spi nor
spi: atmel,quadspi: Define sama7g5 QSPI
spi: atmel,quadspi: Convert to json-schema
spi: Fix incorrect cs_setup delay handling
dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml
spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out
spi: dt-bindings: add schema listing peripheral-specific properties
...
Diffstat (limited to 'drivers/spi/spi-hisi-kunpeng.c')
-rw-r--r-- | drivers/spi/spi-hisi-kunpeng.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index 58b823a16fc4..525cc0143a30 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -127,7 +127,6 @@ struct hisi_spi { void __iomem *regs; int irq; u32 fifo_len; /* depth of the FIFO buffer */ - u16 bus_num; /* Current message transfer state info */ const void *tx; @@ -165,7 +164,10 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs) { char name[32]; - snprintf(name, 32, "hisi_spi%d", hs->bus_num); + struct spi_controller *master; + + master = container_of(hs->dev, struct spi_controller, dev); + snprintf(name, 32, "hisi_spi%d", master->bus_num); hs->debugfs = debugfs_create_dir(name, NULL); if (!hs->debugfs) return -ENOMEM; @@ -467,7 +469,6 @@ static int hisi_spi_probe(struct platform_device *pdev) hs = spi_controller_get_devdata(master); hs->dev = dev; hs->irq = irq; - hs->bus_num = pdev->id; hs->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hs->regs)) @@ -490,7 +491,7 @@ static int hisi_spi_probe(struct platform_device *pdev) master->use_gpio_descriptors = true; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); - master->bus_num = hs->bus_num; + master->bus_num = pdev->id; master->setup = hisi_spi_setup; master->cleanup = hisi_spi_cleanup; master->transfer_one = hisi_spi_transfer_one; @@ -506,15 +507,15 @@ static int hisi_spi_probe(struct platform_device *pdev) return ret; } - if (hisi_spi_debugfs_init(hs)) - dev_info(dev, "failed to create debugfs dir\n"); - ret = spi_register_controller(master); if (ret) { dev_err(dev, "failed to register spi master, ret=%d\n", ret); return ret; } + if (hisi_spi_debugfs_init(hs)) + dev_info(dev, "failed to create debugfs dir\n"); + dev_info(dev, "hw version:0x%x max-freq:%u kHz\n", readl(hs->regs + HISI_SPI_VERSION), master->max_speed_hz / 1000); |