Previously the logic was inverted for error_callback_en where 0 was
enablement and 1 was disable. This was likely done so that the default,
sensibly so, was to enable the error callback if possible. A variety of
in tree users had confused the enable/disable value.
Change the name of the flag to error_callback_dis where the default
remains 0 (do not disable the callback!) and correct in tree uses of the
flag where it seemed incorrect.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Guard use of I2S_EnableSecondaryChannel behind the SDK feature macro
that determines if this support is available, since when this macro is
not defined the SDK function is not implemented.
Fixes#68136
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add support for more than 2 I2S channels to the I2S Flexcomm driver.
Additionally, remove comment stating I2S PCM and Left justified formats
are not supported, as these formats are now validated to function
correctly.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The MCUX LPC DMA driver now recognizes the compelete_callback
flag. Set this flag so we receive an interrupt after completion
of every block.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.
The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);
has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);
The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.
All in-tree uses of the function have been adapted.
Fixes#61888.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Fix for bugs described in:
https://github.com/zephyrproject-rtos/zephyr/issues/59803
1. the size argument passed to i2s_write() was being ignored.
change the code so that the size is queued with the
tx mem_block and the dma transfer is configured with this
size.
2. change how CONFIG_I2S_MCUX_FLEXCOMM_RX_BLOCK_COUNT and
CONFIG_I2S_MCUX_FLEXCOMM_TX_BLOCK_COUNT are used so that
the queue buffers are allocated correctly when the two
config values are not the same
3. set source_data_size and dest_data_size to be the same
since the DMA controller can only set one size per
DMA transfer. the driver was already computing a dest_data_size
but always passing 1 for the source_data_size.
For I2S RX case, I think source_data_size should be
set to the expected FIFO read size instead of dest_data_size.
Also some smaller improvements like:
* don't allocate two dma_blocks for tx in the static dev_mem
when it only needs one
* memset both rx_dma_blocks together instead of separtely
* set dma_cfg block_count for tx and rx statically instead
of at runtime
Signed-off-by: Mike J. Chen <mjchen@google.com>
Use the DMA reload flag to indicate we wish to use
a circular chain of DMA descriptors to reload DMA
receive buffers.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Driver init should be using instance based macros,
not nodelabels numbering, there is no guarantee
about which nodes will be assigned which instance numbers.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Make use of positive status values in the DMA callback to pass
info to the DMA client after a successful DMA operation.
A completed DMA transfer uses the status 0 while a reached
water mark uses the status 1.
Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
The MCUX platform always uses pinctrl, there's no need to keep extra
macrology around pinctrl. Also updated driver's Kconfig options to
`select PINCTRL` (note that some already did).
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
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>
Refactors the remaining I2S drivers to use the shared driver class
initialization priority configuration, CONFIG_I2S_INIT_PRIORITY, to
allow configuring I2S drivers separately from other devices. This is
similar to other driver classes.
The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to be
consistent with other driver classes.
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
The i2s_config structure passed to the i2s_configure() function is
not supposed to be modified by the driver. Similarly, the structure
returned by the i2s_config_get() function is not supposed to be
modified outside the driver.
Decorate the pointers to those structures with the const qualifier
and correct one driver that actually modified the structure passed
to i2s_configure().
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Introduce a new enumeration value that allows setting configuration
and triggering commands for both I2S streams simultaneously.
Such possibility is especially important on hardware where the streams
can be only enabled/disabled (but not started/stopped) independently,
like it is in nRF SoCs.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The memory block passed by the user to the i2s_write function is
tightly packed next to each other.
However for 8-bit word_size the I2S hardware expects the data
to be in 2bytes which does not match what is passed by the user.
This will be addressed in a separate PR once the zephyr API committee
finalizes on an I2S API for the user to probe hardware variations.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>