aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)AuthorFilesLines
2024-06-18spi: Fix OCTAL mode supportPatrice Chotard1-2/+4
Add OCTAL mode support. Issue detected using "--octal" spidev_test's option. Signed-off-by: Patrice Chotard <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-18spi: stm32: qspi: Clamp stm32_qspi_get_mode() output to CCR_BUSWIDTH_4Patrice Chotard1-1/+1
In case usage of OCTAL mode, buswidth parameter can take the value 8. As return value of stm32_qspi_get_mode() is used to configure fields of CCR registers that are 2 bits only (fields IMODE, ADMODE, ADSIZE, DMODE), clamp return value of stm32_qspi_get_mode() to 4. Fixes: a557fca630cc ("spi: stm32_qspi: Add transfer_one_message() spi callback") Cc: [email protected] Signed-off-by: Patrice Chotard <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-18spi: stm32: qspi: Fix dual flash mode sanity test in stm32_qspi_setup()Patrice Chotard1-6/+4
Misplaced parenthesis make test of mode wrong in case mode is equal to SPI_TX_OCTAL or SPI_RX_OCTAL. Simplify this sanity test, if one of this bit is set, property cs-gpio must be present in DT. Fixes: a557fca630cc ("spi: stm32_qspi: Add transfer_one_message() spi callback") Cc: [email protected] Signed-off-by: Patrice Chotard <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-12spi: meson-spicc: add spicc loopback modeXianwei Zhao1-2/+4
Add spicc loopback mode for debugging convenience. Signed-off-by: Sunny Luo <[email protected]> Signed-off-by: Xianwei Zhao <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-11spi: Rework DMA mapped flagMark Brown8-65/+52
Merge series from Andy Shevchenko <[email protected]>: The first part of the series (patches 1 to 7) is an introduction of a new helper followed by the user conversion. This consolidates the same code and also makes patch 8 (last one) be localised to the SPI core part. The last patch is the main rework to get rid of a recently introduced hack with a dummy SG list and move to the transfer-based DMA mapped flag. That said, the patches 1 to 7 may be applied right away since they have no functional change intended, while the last one needs more testing and reviewing.
2024-06-10spi: add missing MODULE_DESCRIPTION() macrosJeff Johnson6-0/+6
make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-altera-core.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-fsl-lib.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-omap2-mcspi.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-qup.o Add the missing invocations of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: meson-spicc: set SPI clock flag CLK_SET_RATE_PARENTXianwei Zhao1-6/+10
Add SPI clock flag CLK_SET_RATE_PARENT for using pclk as parent clock. This gives SPI more flexibility in frequency selection. Signed-off-by: Xianwei Zhao <[email protected]> Signed-off-by: Sunny Luo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: Rework per message DMA mapped flag to be per transferAndy Shevchenko2-47/+28
The granularity of DMA mappings is transfer and moreover, the direction is also important as it can be unidirect. The current cur_msg_mapped flag doesn't fit well the DMA mapping and syncing calls and we have tons of checks around on top of it. So, instead of doing that rework the code to use per transfer per direction flag to show if it's DMA mapped or not. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: qup: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko1-5/+4
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: pci1xxxx: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko1-2/+3
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: pxa2xx: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko1-4/+2
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: omap2-mcspi: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko1-4/+4
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: ingenic: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko1-2/+2
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: dw: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko1-2/+2
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Serge Semin <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-10spi: Introduce internal spi_xfer_is_dma_mapped() helperAndy Shevchenko1-0/+8
There are few drivers that use the same pattern to check if the transfer is DMA mapped or not. Provide a helper. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Serge Semin <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-06-07spi: cs42l43: Drop cs35l56 SPI speed down to 11MHzCharles Keepax1-2/+2
Some internals of the cs35l56 can only support SPI speeds of up to 11MHz. Whilst some use-cases could support higher rates, keep things simple by dropping the SPI speed down to this avoid any potential issues. Signed-off-by: Charles Keepax <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-04spi: cs42l43: Correct SPI root clock speedCharles Keepax1-1/+1
The root clock is actually 49.152MHz not 40MHz, as it is derived from the primary audio clock, update the driver to match. This error can cause the actual clock rate to be higher than the requested clock rate on the SPI bus. Fixes: ef75e767167a ("spi: cs42l43: Add SPI controller support") Signed-off-by: Charles Keepax <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Convert PCI driver to use spi-pxa2xx code directlyAndy Shevchenko1-26/+13
PCI driver has an additional device layer for enumeration. Remove that layer and use spi-pxa2xx code directly. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Move platform driver to a separate fileAndy Shevchenko4-208/+230
The spi-pxa2xx.c is bloated with a platform driver code while pretending to provide a core functionality. Make it real core library by splitting out the platform driver to a separate file. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Extract pxa2xx_spi_platform_*() callbacksAndy Shevchenko1-19/+33
In preparation of the extracting platform driver from spi-pxa2xx.c split the probe and remove functions so we have bus independent and platform device ones. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Remove superflous check for Intel Atom SoCsAndy Shevchenko1-15/+11
pxa2xx_spi_fw_translate_cs() checks for the ACPI companion device presence along with the SSP type. But the SSP type is uniquely determines the case. Hence remove the superflous check. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Remove duplicate checkAndy Shevchenko1-3/+0
The mmio_base can't be NULL at this point. It's either checked in both pxa_ssp_probe() and pxa2xx_spi_init_ssp() or correctly provided by PCI core. Hence, remove duplicate check which is a dead code. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Print DMA burst size only when DMA is enabledAndy Shevchenko1-1/+2
Print DMA burst size only when DMA is enabled to avoid making a false impression that DMA is enabled when it may be not. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Utilise temporary variable for struct deviceAndy Shevchenko1-10/+11
We have a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Remove hard coded number of chip select pinsAndy Shevchenko1-4/+0
Remove hard coded number of chip select pins for Intel Braswell. This comes via property. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Remove no more needed driver dataAndy Shevchenko1-6/+6
Since the ACPI enumerated devices provide a property with SSP type, there is no more necessity to bear the copy of them in the ID table. Drop the driver data in ACPI ID table. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Reorganize the SSP type retrievalAndy Shevchenko1-14/+11
The old Intel platforms, such as Intel Braswell, also provide the property of SSP type. Reorganize the pxa2xx_spi_init_pdata() to take that into account. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: pxa2xx: Wrap pxa_ssp_request() to be device managed resourceAndy Shevchenko1-18/+32
In the error path or remove path the reference counter in PXA SSP driver may be dropped before the other resources, that were allocated after bumbing the reference counter. This breaks reversed order of freeing and might have an undesired side effects. Prevent this from happening by wrapping pxa_ssp_request() to be device managed resource. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-06-03spi: Merge up fixesMark Brown3-6/+25
We need these to get the i.MX8 boards working in CI again.
2024-05-29spi: stm32: Don't warn about spurious interruptsUwe Kleine-König1-1/+1
The dev_warn to notify about a spurious interrupt was introduced with the reasoning that these are unexpected. However spurious interrupts tend to trigger continously and the error message on the serial console prevents that the core's detection of spurious interrupts kicks in (which disables the irq) and just floods the console. Fixes: c64e7efe46b7 ("spi: stm32: make spurious and overrun interrupts visible") Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-29spi: Assign dummy scatterlist to unidirectional transfersAndy Shevchenko1-0/+9
Commit 8cc3bad9d9d6 ("spi: Remove unneded check for orig_nents") introduced a regression: unmapped data could now be passed to the DMA APIs, resulting in null pointer dereferences. Commit 9f788ba457b4 ("spi: Don't mark message DMA mapped when no transfer in it is") and commit da560097c056 ("spi: Check if transfer is mapped before calling DMA sync APIs") addressed the problem, but only partially. Unidirectional transactions will still result in null pointer dereference. To prevent that from happening, assign a dummy scatterlist when no data is mapped, so that the DMA API can be called and not result in a null pointer dereference. Signed-off-by: Andy Shevchenko <[email protected]> Reported-by: Neil Armstrong <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Reported-by: Nícolas F. R. A. Prado <[email protected]> Closes: https://lore.kernel.org/all/d3679496-2e4e-4a7c-97ed-f193bd53af1d@notapiano Closes: https://lore.kernel.org/all/4748499f-789c-45a8-b50a-2dd09f4bac8c@notapiano Fixes: 8cc3bad9d9d6 ("spi: Remove unneded check for orig_nents") Tested-by: Nícolas F. R. A. Prado <[email protected]> [nfraprado: wrote the commit message] Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-29spi: cadence: Ensure data lines set to low during dummy-cycle periodWitold Sadowski1-5/+15
During dummy-cycles xSPI will switch GPIO into Hi-Z mode. In that dummy period voltage on data lines will slowly drop, what can cause unintentional modebyte transmission. Value send to SPI memory chip will depend on last address, and clock frequency. To prevent unforeseen consequences of that behaviour, force send single modebyte(0x00). Modebyte will be send only if number of dummy-cycles is not equal to 0. Code must also reduce dummycycle byte count by one - as one byte is send as modebyte. Signed-off-by: Witold Sadowski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-29Add support for GPIO based CSMark Brown1-1/+5
Merge series from Prajna Rajendra Kumar <[email protected]>: The Microchip PolarFire SoC SPI "hard" controller supports eight chip selects. However, only one chip select is physically wired. Therefore, use GPIO descriptors to configure additional chip select lines.
2024-05-29spi: gpio: Convert to be used outside of OFMark Brown1-41/+25
Merge series from Andy Shevchenko <[email protected]>: Convert the driver to be used outside of OF and a couple of cleanups.
2024-05-29spi: bitbang: Clean up the driverMark Brown1-46/+27
Merge series from Andy Shevchenko <[email protected]>: A few cleanups to the driver. No functional change intended.
2024-05-29spi: differentiate between unsupported and invalidMark Brown4-14/+16
Merge series from Miquel Raynal <[email protected]>: I am working on spi-nand continuous read support, which lead me to check what spi controllers were capable of. >From a caller (and reviewer) point of view, distinguishing between error cases has been proven useful, especially between two conditions: - the request is totally unsupported and will never work - the request is typically out of range somehow but a subsequent call with corrected parameters might work So while I was statically reading the various drivers, I attempted to clarify these situations and thought it might be nice to have this upstream as well. As ENOTSUPP is not a SUSV4 code and previous series have already been merged to reduce its use, I also converted these few cases to EOPNOTSUP instead, but if anybody doesn't like these changes, it can be dropped.
2024-05-29Add optional reset control for Cadence SPIMark Brown1-0/+13
Merge series from Ji Sheng Teoh <[email protected]>: The first patch adds optional reset control to support assertion and deassertion of reset signal to properly bring the SPI device into an operating condition. The second patch documents the optional reset control into dt-bindings.
2024-05-27spi: Refactor spi_stop_queue()Andy Shevchenko1-15/+10
The refactoring makes code less verbose and easier to read. Besides that the binary size is also reduced, which sounds like a win-win case: add/remove: 0/1 grow/shrink: 2/2 up/down: 210/-226 (-16) Function old new delta spi_destroy_queue 42 156 +114 spi_controller_suspend 101 197 +96 spi_unregister_controller 346 319 -27 spi_register_controller 1834 1794 -40 spi_stop_queue 159 - -159 Total: Before=49230, After=49214, chg -0.03% Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: Replace custom code with device_match_acpi_handle()Andy Shevchenko1-2/+2
Since driver core provides a generic device_match_acpi_handle() we may replace the custom code with it. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: atmel-quadspi: Add missing check for clk_prepareChen Ni1-2/+9
Add check for the return value of clk_prepare() and return the error if it fails in order to catch the error. Fixes: 4a2f83b7f780 ("spi: atmel-quadspi: add runtime pm support") Signed-off-by: Chen Ni <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: imx: remove empty cleanup functionMartin Kaiser1-5/+0
Remove the empty spi_imx_cleanup function. It's ok if a driver does not set the controller->cleanup pointer, the caller does a NULL check. Signed-off-by: Martin Kaiser <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: axi-spi-engine: Add SPI_CS_HIGH supportDavid Lechner1-0/+34
The AXI SPI Engine IP core v1.2 added support for SPI_CS_HIGH. This provides the driver implementation to make use of this feature when supported hardware is detected. Signed-off-by: David Lechner <[email protected]> Link: https://msgid.link/r/20240508-spi-axi-spi-engine-add-spi_cs_high-support-v1-1-695dd8e45f00@baylibre.com Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: gpio: Use traditional pattern when checking error codesAndy Shevchenko1-8/+7
Instead of 'if (!ret)' switch to "check for the error first" rule. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: gpio: Make use of device propertiesAndy Shevchenko1-33/+18
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Include mod_devicetable.h explicitly to replace the dropped of.h which included mod_devicetable.h indirectly. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: bitbang: Convert unsigned to unsigned intAndy Shevchenko1-24/+18
Simple type conversion with no functional change implied. While at it, adjust indentation where it makes sense. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: bitbang: Use typedef for txrx_*() callbacksAndy Shevchenko1-22/+9
With a typedef for the txrx_*() callbacks the code looks neater. Note that typedef for a function is okay to have. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: spi-microchip-core: Add support for GPIO based CSPrajna Rajendra Kumar1-0/+4
The SPI "hard" controller within the PolarFire SoC is capable of handling eight CS lines, but only one CS line is wired. Therefore, use GPIO descriptors to configure additional CS lines. Signed-off-by: Prajna Rajendra Kumar <[email protected]> Link: https://msgid.link/r/[email protected] Acked-by: Conor Dooley <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: spi-microchip-core: Fix the number of chip selects supportedPrajna Rajendra Kumar1-1/+1
The SPI "hard" controller in PolarFire SoC has eight CS lines, but only one CS line is wired. When the 'num-cs' property is not specified in the device tree, the driver defaults to the MAX_CS value, which has been fixed to 1 to match the hardware configuration; however, when the 'num-cs' property is explicitly defined in the device tree, it overrides the default value. Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers") Signed-off-by: Prajna Rajendra Kumar <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: wpcm-fiu: differentiate between unsupported and invalid requestsMiquel Raynal1-3/+3
When the requested dirmap accesses are outside of the window, it is probably more sensible to return -EINVAL rather than an "unsupported" error code. If however the operation in itself is not supported, then -EOPNOTSUP is likely going to be preferred as it is a standard error code. >From a caller (and reviewer) point of view, distinguising between the two may be helpful because somehow one can be "fixed" while the other will always be refused no matter how hard we try. As part of a wider work to bring spi-nand continuous reads, it was useful to easily catch the upper limit direct mapping boundaries for each controller, with the idea of enlarging this area from a page to an eraseblock, without risking too many regressions. Signed-off-by: Miquel Raynal <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-27spi: rpc-if: differentiate between unsupported and invalid requestsMiquel Raynal1-6/+6
If the request is out of range, returning -EINVAL seems a better pick than -ENOTSUPP. >From a caller (and reviewer) point of view, distinguising between the two may be helpful because somehow one can be "fixed" while the other will always be refused no matter how hard we try. As part of a wider work to bring spi-nand continuous reads, it was useful to easily catch the upper limit direct mapping boundaries for each controller, with the idea of enlarging this area from a page to an eraseblock, without risking too many regressions. In all other cases, as part of a wider work towards using -EOPNOTSUP rather than -ENOTSUPP (which is not a SUSV4 code), let's change the error code to be uniform across spi-mem controller drivers. Finally, reword a little bit the conditions to clarify what is intended (ie. checking for the presence of a direct mapping, and also ensuring we create a dirmap only on DATA_IN flows). Signed-off-by: Miquel Raynal <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>