Prevent the driver from perfroming transfer when SPI_LINES_OCTAL flag
is specified, as this driver supports only SPI_LINES_DUAL for now.
Signed-off-by: Michal Morsisko <morsisko@gmail.com>
Add support for sending and receiving the least significant bit first
for the spi_bitbang driver. This driver can now be used with
SPI_TRANFER_LSB flag.
Signed-off-by: Michal Morsisko <morsisko@gmail.com>
Enable the device runtime power management on the SPIM shim.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
To facilitate changing this driver, decouple rtio from functions not
specific to RTIO. This also requires moving the sdk driver handle
creation outside of the configure call. An effect of this is we can
stop initializing an unused sdk driver handle for the dma path.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
These changes:
* Fix the check of the word size to be more useful
- check min frame size instead of max
- check for min word size requirement
- add a clarifying comment about what the word size represents in
hardware since the nomenclature from zephyr does not match the nxp
references
* Add a clarifying comment about half duplex being supported by hardware
* Add LPSPI_ namespace to defines
* Change chip select error message to be more clear about the problem
* Move the check of the clock device being ready to the lpspi init,
instead of checking it every time on configure. It probably also makes
more sense to not ready the lpspi device if the clock is not ready.
* Move the bare-metal configuration of bit fields AFTER the SDK Init
call.
* Return the proper error code if clock control call errors.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
If CONFIG_SPI_STATS is enabled, the device state for all SPI controller
drivers must contain the SPI stats. This space is allocated by calling
Z_SPI_INIT_FN as part of the device definition; this is done automatically
when using SPI_DEVICE_DT_DEFINE instead of DEVICE_DT_DEFINE. If space for
statistics is not properly allocated but CONFIG_SPI_STATS is enabled, an
unexpected write to memory outside of the stats region may occur on a SPI
transfer. This commit uses SPI_DEVICE_DT_DEFINE or
SPI_DEVICE_DT_INST_DEFINE for all in-tree SPI controller drivers.
Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
Rename "nxp,kinetis-dspi" compatible to "nxp,dspi" to remove the
device family from its name.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
The Smartbond SPI driver enables DMA acceleration by default. However
no DMA configuration is provided in the SPI node, resulting in run
time errors when the SPI interface is used. Instead, the application
should explicitly enable DMA acceleration and select the DMA channels
and priorities.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
- Move selection of CONFIG_PINCTRL from soc to individual
drivers
- in accordance with issue #78619
Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
Do all input validation etc BEFORE setting up configuration,
instead of mixing these things everywhere. Also condense the formatting
of the code.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove unneeded prepare_start function since all uses of it are paired
with the start function. Also, probably should not mess with chip select
before deciding to do the transfer. And just return on some error like
the rest of the driver does instead of assert.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Next packet function is way more complicated than it needs to be. Clean
it up by simplifying the code and making readable helper functions.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Move transceive funtions next to each other and clean up the wrapping of
functions to eliminate the ifdefs.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Small change to consolidate the amount of lines of code in
the spi_mcux_isr by making a macro for the argument and removing
a line of code that was commented out.
Also move the ISR to be the first function in the file which is
common in many other drivers, instead of randomly in the middle of the
file. And move the isr callback to be next to the isr.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add closing comment for #ifdef and remove unnecessary
indentation of an else block. Also move the transcieve_rtio
function to be near the other rtio functions. And move function
prototypes to top of file.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Create helper functions for duplicated code related to
checking for DMA devices, with readable names.
Also remove unneeded function prototype.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Do initializations in a more logical order,
remove unnecessarily duplicated code,
reorder stack variables to be in reverse christmas tree order.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove parent_dev from config struct, and simplify code for the
definition and use of the irq config function.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Organize #includes and #defines for less redundancy
and more readability.
Shorten some macros to avoid multi line statements.
Add some comments.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The `Kconfig.defconfig` is not good place for put `select PINCTRL`.
Drop `select PINCTL` from `Kconfig.defconfig` and add it at each
driver's Kconfig.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
- Add SPI driver support for RA
- RA2A1 not support slave select keeping level so disable it
in Kconfig
Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
To remove CONFIG_PINCTRL from board side for numaker boards.
The Drivers using Pinctrl should be turning Pinctrl on
instead of the responsibility of the board.
Fixes#78619
Signed-off-by: cyliang tw <cyliang@nuvoton.com>
Use minimized PIO code for 3-wire operation.
Input and output buffers are conventionally stored in bus byte order.
For 16 and 32 bit transfers, this is effectively big-endian, so
txbuf and rxbuf need to be read as such. Those pointers also need
to be declared uint8_t * instead of void *.
In addition, tx_count and rx_count are based on dts, and refer to
whole transfers (8, 16, or 32 bits), not bytes.
Added rpi_pico.overlay to samples/sensor/magn_polling to demonstrate
32-bit word size, and updated the README.rst to make it independent
of the specific sensor.
Clean up compliance check failures.
Fix typos.
Synchronize 3-wire TX and RX cycles.
Simplify state machine synchronization
Minimize SPI bus delay time in 3-wire mode
Move clock delay to PIO code and remove k_sleep
Signed-off-by: Steve Boylan <stephen.boylan@beechwoods.com>
-Update formatting and contents of index.rst for cy8ckit_062s4
-Update formatting and contents of index.rst for cy8ckit_064s0s2_4343w
-Update formatting and contents of index.rst for cy8cproto_062_4343w
-Update formatting and contents of index.rst for cy8cproto_063_ble
-Update formatting and contents of index.rst for xmc45_relax_kit
-Update formatting and contents of index.rst for xmc47_relax_kit
-Change all instances of "PSoC" to "PSOC" for infineon platforms
Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
Remove CONFIG_GPIO from defconfigs for Infineon boards.
Applications, drivers will enable GPIO if need.
Added 'select GPIO' from spi/Kconfig.ifx_cat1
Added 'select GPIO' from wifi/infineon/Kconfig.airoc
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
Apparently, the previous change to fix the chip select only works on
some newer revisions of the LPSPI, and the behavior is different on
older parts like RT. For now put some #ifdef to keep the fixed CS on
MCXN but have the old behavior on RT and other platforms.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The CONFIG_PINCTRL is removed from the board's defconfig files.
Drivers which use pin control function should add "select PINCTRL"
in their Kconfig files.
Fixes#78619
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.sam*.
Fixes#78619
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.gd32.
Fixes#78619
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>