Added a build assert to limit num_pins to a maximum allowable value to
prevent potential out-of-bounds access or infinite loops.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Introduce new DAI driver used for NXP's PDM MICFIL IP.
This block implements required digital interface to provide
a 24-bits audio signal from a PDM microphone bitstream in a configurable
output sampling rate.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
To support icm42370-p sensor, we renamed icm42670 to icm42x70
as the driver is similar to ICM-42670-P/S in hal_tdk module.
Keep icm42670 source and header for dedicated code.
Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
The PCA6416A is a 16-bit general purpose I/O expander that provides
remote I/O expansion for most microcontroller families via the I2C-bus
interface.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
1. The sys_clock_idle_exit function could be invoked multiple
times. Hence add code so that is counter is stopped and the
OS Timer is initialized once.
2. Reset the OS Timer when exiting low power modes where
the OS Timer loses its state
3. Improve the cycles conversion algorithm. Round to the nearest
microsecond when converting from ticks to microsecond rather
than always rounding up to the next highest value.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
In Completer mode SETUP data can always be received and therefore
endpoint 0 should only be enabled for OUT Data Stage and OUT Status
Stage.
In Buffer DMA mode, SETUP can only be received when endpoint is enabled
and therefore the software has to make sure that there is a buffer
available to receive SETUP data.
Rework the EP0 buffer feeding to adhere to DWC2 Programming Guide.
Synchronize the accesses with driver mutex to avoid interrupt related
race conditions.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The transfer is finished after ZLP is transmitted. Do not re-enable the
endpoint waiting for more data.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Control OUT buffers must be multiple of bMaxPacketSize0 in Buffer DMA
mode. While the transfer can be configured to smaller values, DMA will
write data past the buffer (and transfer size counter will underflow) if
the packet on the bus is larger or if there are multiple back-to-back
SETUP packets.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Use helper functions to check whether device is operating in Buffer DMA
or Completer mode. This allows compile time optimizations to remove DMA
handling code when DMA is disabled via KConfig symbol UDC_DWC2_DMA.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
clean up usage of usage "#ifdef STM32_SRC_SYSCLK"
and code under the "#else" from clock_stm32_ll_common.c.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
This fixes DNS resolve failure (CONFIG_DNS_RESOLVER) by enabling
CONFIG_WIFI_ESP_AT_CIPDINFO_USE (AT+CIPDINFO) automatically to get
peer ip-address and port, required by CONFIG_DNS_RESOLVER.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
Add properties to differentiate the timer counter operating modes. This
properties are necessary to spetialize the driver to be used as a normal
16/32-bit counter or to provide the clock/calendar functions.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Coverity identified out-of-bounds access. A uint8_t being cast to
an enum is undefined in that the enum can be allocated 4bytes.
Change the internal function to use the base type of the variable,
uint8_t to avoid potential compiler size alignement problems.
Fixes#81927
Signed-off-by: David Leach <david.leach@nxp.com>
When building with clang it warns:
drivers/mfd/mfd_adp5585.c:59:6: error: variable 'reg_int_status' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
if (ret == 0) {
^~~~~~~~
drivers/mfd/mfd_adp5585.c:70:7: note: uninitialized use occurs here
if ((reg_int_status & ADP5585_INT_GPI)
^~~~~~~~~~~~~~ && device_is_ready(data->child.gpio_dev)) {
drivers/mfd/mfd_adp5585.c:59:2: note: remove the 'if' if its condition
is always true
if (ret == 0) {
^~~~~~~~~~~~~~
drivers/mfd/mfd_adp5585.c:54:24: note: initialize the variable
'reg_int_status' to silence this warning
uint8_t reg_int_status;
^
= '\0'
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
If the to-host data stage length is less than that requested by the
host, but equal to or a multiple of MPS, the device should send a ZLP,
not receive it.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
XIP may indicate that the program is executed either in local memory
or flash. However, the SPI node is only used as a flash fetch device
when the program is executed in flash.
Therefore, optimize the related checks to ensure that when XIP is
enabled but the program is executed in local memory, the qspi flash
node can still be used.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
ATCSPI hardware limits single transfer to 512 bytes, so when reading
data over 512 bytes, it needs to be split into multiple transfers
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
Move the memory barrier to a function that commits option bytes.
This way the barrier doesn't have to be added before every call of the
commit_optb function.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Change the return value of the write_opt function. If returns 0 if a
change of option bytes was not needed.
It gives callers of the function an information a commit of the option
bytes is needed.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Some stm32f4, like the sm32f411 mcu have clk 48M on the main PLL output q
Some stm32f4, like the sm32f412 mcu have clk 48M on the PLL I2S output q
This PR is for selecting the right one
Signed-off-by: Francois Ramu <francois.ramu@st.com>
The erase time varies between different SPI NOR flash chips.
Some have typical erase times in the 20-25ms range, at which point the
default 50ms poll interval means we get half the possible erase speed.
With slower memory, or larger erases, 50ms might not be a lot, but for
block erases, if we are unlucky we may end up polling just as the it's
about to finish erasing, and have to wait another poll interval.
Signed-off-by: Kamil Krzyzanowski <kamnxt@kamnxt.com>
Add wsen_pads_2511020213301 driver with
the corrected name and compatibility with
the hal update as well as added new features.
Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
Previously, the Kconfig option CONFIG_STMEMSC_I3C_I2C_WRITE_BUFFER_SIZE
has been introduced to replace i2c_burst_write with i2c_write using a
buffer combining the address and data.
See commit 5f8da77ad3eaf0593107fd99253c1c13b3a98de0
Add missing buffer size config to stmemsc_i2c_write_incr to replace
fixed buffer size.
Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
Fix a runtime bug when both CONFIG_LIS3MDL_TRIGGER and CONFIG_ASSERT
are set. The correct assertion should verify that sensor channel is
either SENSOR_CHAN_ALL or SENSOR_CHAN_MAGN_XYZ.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The TSL2591 driver fails to initialize because the sensor responds with a
NACK on the initial RESET. Although the datasheet from Adafruit claims that
this is operation should be valid (RESET is part of the CONTROL register),
other sample non-Zephyr drivers provided by Arduino don't explicitly reset
the sensor on initialization (see
https://github.com/adafruit/Adafruit_TSL2591_Library/blob/master/Adafruit_TSL2591.cpp).
Thus, the assumption is that when the sensor is reset via software, it
doesn't respond to an ACK.
After removing the check for this initial RESET, the driver initializes
successfully.
Signed-off-by: Mohammed Billoo <mab@mab-labs.com>
Remove ESP heap from the sources. System heap is default heap.
Use heap adapter layer to configure used heap.
Use MEM_POOL memory request config to Wi-Fi and Bluetooth drivers.
Update the Wi-Fi and BLE memory needs.
Signed-off-by: Marek Matej <marek.matej@espressif.com>
This function allows to not restart DMA engine for driver that gives
new buffer to the DMA engine while a transfer is ongoing.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Improve the silabs ldma driver to support P2M and M2P transfer. It also
adds signal binding to support source request binding in the dts.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
The gecko_uart.c driver supports both `silabs,gecko_uart` and
`silabs,gecko_usart` compat strings, however `PM_DEVICE_DT_INST_DEFINE()`
was missing when defining `uart` type instances. The
efm32wg_stk3800/efm32wg990f256 platform enables by default one
`gecko_uart` DT node and no `gecko_usart` nodes. This results in the
following build warning/error:
uart_gecko.c:673:12: warning: 'uart_gecko_pm_action' defined but not used
Add the missing call to `PM_DEVICE_DT_INST_DEFINE()`.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
When the UDC buffer gets submitted it should no longer reside in the
endpoint queue. While this commit does not address the underlying issue
of not being able to start transfer for whatever reason, it prevents the
problem from cascading into buffer double completion (e.g. receive
buffer double free in UAC2).
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
DWC2 otg versions earlier than 5.00a are subject to randomly occurring
glitch on Hibernation Exit by Host Initiated Resume, Hibernation Exit by
Device Inititated Resume and Hibernation Exit by Host Initiated Reset.
When the glitch happens the device address is not correctly restored.
If the address is not correctly restored then the tokens addressed to
the device will timeout leading to host resetting the bus.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Programming Guide states that bit 17 on PCGCCTL writes should be set if
the controller was enumerated for High Speed operation. Add the missing
bit set to adhere to the Programming Guide.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Add additional property to allow a configurable delay to the display
initialization to allow the st7789v to be ready to receive commands.
Signed-off-by: Peter Johanson <peter@peterjohanson.com>
This commit fix the pin function configuration for mii and rmii
setting of Renesas RA8 ethernet driver
Correct pin function setting for mii is
PFENET = (uint8_t)(0x1 << R_PMISC_PFENET_PHYMODE0_Pos);
and rmii is:
R_PMISC->PFENET = (uint8_t)(0x0 << R_PMISC_PFENET_PHYMODE0_Pos);
Change code to intialize ping in driver init function, change
method of getting and checking via enum index of device tree.
Add build assert for invalid phy type.
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
As the C language treats 'cases' similar to 'labels' the following
error can also occur when using switch statements when it encounters
a declaration immediately after a label:
drivers/sensor/maxim/ds3231/ds3231.c:77:3: error: a label can only
be part of a statement and a declaration is not a statement
77 | const uint16_t raw_temp = data->raw_temp;
| ^~~~~
Signed-off-by: Stephan Linz <linz@li-pro.net>
Because of wrong integer type syntax following error occurred:
drivers/rtc/rtc_ds3231.c:361:76: error: unknown type name 'u'
361 | static int rtc_ds3231_alarm_get_supported_fields(
| const struct device *dev, u int16_t id,
| ^
Signed-off-by: Stephan Linz <linz@li-pro.net>
Compile warnings occurred in common standard use case
w/o RTC alarm and update.
Warning was:
drivers/rtc/rtc_ds3231.c: In function 'rtc_ds3231_init':
drivers/rtc/rtc_ds3231.c:808:33: warning: unused variable 'data'
[-Wunused-variable]
808 | struct rtc_ds3231_data *data = dev->data;
| ^~~~
drivers/rtc/rtc_ds3231.c: At top level:
drivers/rtc/rtc_ds3231.c:195:12:
warning: 'rtc_ds3231_get_ctrl_sts' defined but not used
[-Wunused-function]
195 | static int rtc_ds3231_get_ctrl_sts(const struct device *dev,
| uint8_t *buf)
| ^~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Stephan Linz <linz@li-pro.net>