Commit graph

14 commits

Author SHA1 Message Date
Pisit Sawangvonganan 6a50bbdb3a drivers: spi: correct spelling
Employ a code spell checking tool to scan and correct spelling errors
in all files within the drivers/spi directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-13 00:24:19 +00:00
Manimaran A b328e920b6 drivers: spi: Microchip MEC172x SPI fix for Zephyr 3.4 breakage
Zephyr version 3.4 changed the SPI context structure and macros
which broke the logic in the MEC172x SPI driver configuration API.
This was not detected by CI due to no tests for this driver are in
the tree. The driver now behaves like most other SPI drivers requiring
a different configuration structure pointer to be passed if any item
in the configuration changes.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2023-09-13 12:01:18 +02:00
Tristan Honscheid 7803a3a5c5 xec: spi: Remove .cs = NULL in spi_config initializer
Following #56576, the `cs` field in `struct spi_config` is of type
`struct spi_cs_control` instead of a pointer to the same type.
`spi_xec_qmspi_ldma.c:qmspi_xec_init` tries assigning `NULL` to the
`.cs` field through a designated initializer, which causes a compilation
error.

This PR simply removes the `.cs = NULL` line. The designated initializer
will automatically zeroize the underlying GPIO pin info, which should
have the same effect that setting the pointer to NULL did previously.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-04-26 12:58:21 +02:00
Scott Worley 5c00a83b99 drivers: spi: Microchip XEC QMSPI-LDMA fix spi buffer usage
Zephyr SPI driver model for full-duplex operation assumes
data will be transmitted and received during each clock period.
The QMSPI driver for the XEC family also supported dual and
quad I/O use cases which are inherently half-duplex. To
support dual/quad the driver incorrectly processed spi buffers
as all transmit buffers first then all receive buffers. This
worked if only the SPI driver was used. It did not work with
the Zephyr flash SPI NOR driver which assumes SPI drivers
follow the SPI driver model. This commit implements a QMSPI
driver that follows the Zephyr SPI driver model resulting in
a slightly smaller driver. Dual/quad SPI transactions are
supported if the experimental SPI extended mode Zephyr
configuration flag is enabled. We also remove the QMSPI full duplex
driver added previously to support the flash SPI NOR driver.
Added board to spi loop-back test and spi_flash sample.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2023-04-11 16:57:56 +02:00
Jay Vasanth 37874f8f67 drivers: spi: fix formatting in mec172x ldma driver
fix leading white space and use tabs instead of space
in mec172x spi ldma driver.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-10-28 14:29:46 -05:00
Jay Vasanth 0976343513 drivers: SPI: MEC172x QMSPI clock fix
Microchip MEC172x QMSPI expanded its clock divider register
field from 8 to 16 bits. QMSPI source clock is on the fast
peripheral domain therefore get the frequency from the clock
control driver.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-10-28 14:29:46 -05:00
Gerard Marull-Paretas 178bdc4afc include: add missing zephyr/irq.h include
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-17 22:57:39 +09:00
Tom Burdick 4c20403629 spi: callback API for asynchronous transcieve
Adds a new spi_transcieve_cb API which enables asynchronous
SPI transactions with callback notification.

The exist spi_transcieve_async API remains and uses the new
spi_transcieve_cb API to provide a k_poll_signal notifier.

The driver API changes to provide a callback and userdata
parameter to async transcieve. All drivers in the tree
have been updated to the change.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-26 09:29:48 -04:00
Fabio Baltieri bf47c2a763 drivers: drop few unused pinmux.h include
Drop few unused include pinmux header from drivers that don't seem to be
using it anymore.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-18 12:13:14 +00:00
Jose Alberto Meza b4d82289e1 drivers: spi: xec: mec172x: Reflect update device tree properties
Propagate update device tree properties.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-07-04 16:18:42 +02:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Jay Vasanth 535c20e490 qmspi: MEC172x: fix unused variable warning
Fix unused variable warning when CONFIG_SPI_ASYNC
is not defined

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth 99c89ebb78 qmspi: update MEC172x qmspi module for pinctrl
Changes to qmspi module to support pinctrl

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth fd43c725d2 drivers: spi: Add MEC172x QMSPI-LDMA driver
Add driver for MEC172x QMSPI with local DMA(LDMA). The driver
support SPI asynchronous operation.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2021-12-08 08:43:05 -05:00