Make use of rtio_read_regs_async() and rtio_flush_completion_queue()
helpers in lis2dux12 and lsm6dsv16x sensor drivers.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Disable RTC interrupts when cancelling alarm, and clear callback
data, to make sure no ISR/callback is serviced after alarm is
cancelled. Also, check programmed ticks in ISR to make sure
alarm triggered is not an outdated/cancelled event.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Fix alarm setting when timer has overflown beyond 32-bit boundary.
Timer is 48-bit, so it requires high word to be programmed along
the 32-bit word managed by the driver.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
MCUX defined RX fifo combine names and the
references need to be adjusted in the i2s driver.
Signed-off-by: Davi Herculano <davi.herculano@adam-audio.de>
NACK message now log with LOG_ERR_RATELIMIT
instead of LOG_ERR to reduce log noise.
When scanning I2C device,
receiving a NACK is expected behavior and not necessarily an error.
Logging it at LOG_ERR causes unnecessary clutter in the logs.
Therefore, the log level is change to LOG_ERR_RATELIMIT for NACK cases.
Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
Override any defaults for `UART_USE_RUNTIME_CONFIGURE` when using
`CONFIG_MODEM_CELLULAR`, as the baudrate update feature depends on it.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The code was writing to the dst without a verification check on
size which is not appropriate. The guard on the arguements should
be enforced and so just ensure the size is larger then the
definition of the strings from POSIX and return an error in those
cases.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
On i.MX 93 platform, no need to clear interrupt flags, otherwise it
will not trigger reset.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Joe Zhou <zhongcai.zhou@nxp.com>
Extend the LIS2DU12 accelerometer driver with SENSOR_TRIG_DELTA
support. The detection is based on the slope between successive
channel readings. Support for setting SENSOR_ATTR_SLOPE_TH and
SENSOR_ATTR_SLOPE_DUR is added as well. In line with other sensors,
SENSOR_ATTR_SLOPE_TH is configured in SI units (m/s^2) and
SENSOR_ATTR_SLOPE_DUR in samples relative to the ODR. The new trigger
can be mapped either to the same GPIO as the data-ready interrupt or
to a dedicated one.
Signed-off-by: Jan Kablitz <jan.kablitz@8tronix.de>
Add basic support for the Aesc Silicon GPIO controller.
This IP core has internal tri-states and therefore a read,
write and direction registers. Additionally, it has advanced
monitoring capabilities for interrupt generation; low or
high leve and rising or falling edge.
Interrupt support will be added later when ElemRV supports
interrupt in Zephyr.
Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
Change the ISR code to return once all pended interrupts
are handled instead of continuing to iterate over
all channels. Common occurence is just for one interrupt
bit to be set so no need to check all bits in all channels
if only one bit is pending.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Handle notification interrupt before data interrupt of
a channel. Notification interrupts are more commonly
used (e.g. for ipc) and clearing the interrupt ASAP
helps reduce the possiblility that the sender finds
the interrupt already pending if it tries to send multiple
ipc messages in quick succession.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Handle all interrupts for a channel before going to next
channel. Previous code did an if/else check, so if both
a data rx interrupt and a notification interrupt were pending
for a channel, only one would be handled in the ISR. The
ISR would have to fire again (probably would be still pending)
for the other interrupt to be processed. This could even
lead to starvation/delay if another data rx interrupt got
pended again.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Change to pass the device node to IRQ_CONNECT and remove
the intermediate interrupt handler that has to call
DEVICE_DT_INST_GET() to get the device pointer.
Signed-off-by: Mike J. Chen <mjchen@google.com>
The ipc backends, like icmsg.c, don't expect errors when
using mailbox send for notifications. In some places,
icmsg.c ignores the return value of the mailbox send,
in some places it propagates the error up, and in some
places it asserts.
icmsg only uses the mailbox send with NULL msg as a means
to interrupt the other processor, and all data is passed
via shared memory. So it is safe to ignore the case when
the interrupt is already pending, since the other
processor should handle the pending message when it gets
around the handling the interrupt. As long as the order
of clearing the interrupt is before the handling of the
data, there should be no case where not pending a new
interrupt when one is already pending would result in missing
any new message.
Signed-off-by: Mike J. Chen <mjchen@google.com>
GRTC is used by the logger, so it must be initialized
as early as possible. On the other hand, clock requests
are allowed once the clock control API has been initialized.
This PR introduces a two-stage GRTC initialization to meet
these requirements.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
net_tcp_accept_cb_t takes a socklen_t as 3rd argument,
which type was changed in
c546c1cad1
and is not anymore equivalent to size_t.
So let's correct it.
As a freebie, let's define that function as static as it is.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Automatically size the CMUX work buffers based on
`CONFIG_MODEM_CMUX_MTU`. This eliminates a Kconfig variable that would
otherwise need to manually be kept in sync. The option to extend the
size of these buffers is still provided through
`CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Update the defined access technologies to align with the 3GPP standard
TS 27.007. Definitions were copied from version v18.6.0.
Signed-off-by: Jordan Yates <jordan@embeint.com>
add is_moving check to already existing stepper_api move_by
and move_to tests.
delete corresponding redundant test cases from drv84xx
bugfixes in step_dir_stepper_common.c
- start_stepping shall return 0 instead of return ret since
timing_source_start can return 1 depending on which timing
source in selected
- stop timing source before triggering steps_completed event
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Setting 0 as microstep interval is invalid. If microstep_interval is
not set then the motion related functions should return -EINVAL.
drop test_run_zero_step_interval_correct_position
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Add PM support to the STM32WB0x Bluetooth HCI driver.
Implement PM event register to wake up the device for its BLE events.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Provide PM support, specifically suspend-to-ram, for STM32WB0x.
Enable STM32_RADIO_TIMER Kconfig parameter when PM is set.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Use radio timer as the system timer when Bluetooth is used.
Modify CMakeLists.txt to compile radio timer driver when
STM32WB0_RADIO_TIMER is enabled.
Remove the common parts from hci_stm32wb0.c that are present
in the radio timer driver.
Set and retrieve the appropriate value for SYS_CLOCK_TICKS_PER_SEC and
SYS_CLOCK_HW_CYCLES_PER_SEC respectively.
Define radio_timer node and its properties.
Enable radio_timer node in nucleo_wb0x boards.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for STM32WB0
drivers due to the misunderstanding of its definition.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Rename these three macros to an unprefixed lower-case variant. This is
normally not done for Zephyr macros (see container_of) but in this case
it seems like a good idea to adopt the lowercase names to:
1. have the same convention as the equivalent Linux macros, helping devs
working cross project recognizing (mis)use patterns.
2. make it somewhat intuitive that the lowercase ones are meant to be
used in functions while the uppercase ones are to be used for static
evaluation.
Add few c++ guards to avoid colliding with std::min and std::max.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Currently, EXTEN switch control (mapped to GPIO5) is always 0, due to a bug
in the shift value. This has been reported in Coverity CID 353647.
Following the AXP192-X Datasheet, the EXTEN switch control status is
given by bit 2 of the register 10h. If "GPIO5" corresponds to EXTEN
Switch control (AXP192_GPIO5_OUTPUT_MASK is 0x04U), then the shift
AXP192_GPIO5_OUTPUT_SHIFT should be 2, not 3.
Signed-off-by: Loic Domaigne <tech@domaigne.com>
After commit 524b72ce40 ("toolchain: llvm: Provide working
BUILD_ASSERT macro") when compiling with clang we have actual
checks and a real assert check using _Static_assert.
Now, when compiling with clang (used by Xtensa internal toolchain)
we get the following error.
$ zephyr/drivers/dai/nxp/sai/sai.c:968:29: error: static_assert expression
is not an integral constant expression
We get this in asserts like this:
BUILD_ASSERT(SAI_DLINE_COUNT(inst) != -1, "...").
This expands to (reduced the macro to easier understand the context):
_Static_assert(((((((I2S_Type *)(uintptr_t)(1493499904U))) ==
((I2S_Type *)(0x59040000u)))
... and clang complains that this is not a constant expression.
So, in order to fix the compile time error remove the compile time
asserts and replace them with runtime checks.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Fixes: commit 524b72ce40 ("toolchain: llvm: Provide working
BUILD_ASSERT macro")
The size of each spinlock register might vary depending on the SoC.
Make it configurable in the devicetree.
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
Using the mpidr of the core to lock the hwspinlock meant it acted as
a spinlock in the cluster itself, which is exactly the opposite of what we
tried to achieve.
Additionally, this tied the driver to the arm architecture, even though the
HW was not.
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
HWSPINLOCK drivers should be initialized very early in the kernel life, so
they can be used by other drivers without breaking their init dependencies.
Use the default init priority (40), instead of default device init
priority (50).
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
HWSPINLOCK are used to protect accesses to shared resources between
clusters. However, we don't want to sleep or be preempted while holding
a HWSPINLOCK. This means we need to lock IRQs while holding the
HWSPINLOCK.
Moreover, in an SMP context, we need to protect accesses to a HWSPINLOCK
between cores, so it is not possible to lock or release the same
HWSPINLOCK multiple times.
Introduce a zephyr spinlock per HWSPINLOCK to counter those issues. User
facing APIs have been udpated to take into account those changes, and a new
hwspinlock_dt_spec struct has been added to align with other subsystem on
the management of complex device's data.
Take the opportunity to rename public APIs to match the naming scheme of
normal zephyr spinlocks:
hwspinlock_lock -> hw_spin_lock
hwspinlock_trylock -> hw_spin_trylock
hwspinlock_unlock -> hw_spin_unlock
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
HW spinlocks are not supposed to be used by user application. They are used
to protect shared resources between clusters. Consumer of such spinlocks
should be other drivers in kernel space.
Moreover, syscalls were actually not generated properly because of
a missing call to zephyr_syscall_header() in CMakeLists.txt.
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
1. Introduced GDMA support for efficient data transfer in the
NPCX FIU QSPI driver.
2. Refactor flash driver mutex handling to enhance concurrency safety,
preventing other threads from preempting erase/write operations during
UMA until mutex release.
Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Add condition to check whether the pin is set as output before
reading the output high or low for gpio driver of Renesas RZ
Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
For compatibility, do not use spare registers to store mask data.
RTC mask data can be generated through the calendar and time mask
registers at runtime.
Signed-off-by: cyliang tw <cyliang@nuvoton.com>
Assert the reset pin for the duration specified by the modem
(`reset_pulse_duration_ms`) when booting, instead of immediately
de-asserting the pin.
Signed-off-by: Jordan Yates <jordan@embeint.com>