Current code keeps polling the matrix and processing debouncing events
as long as keys are currently pressed, this works fine on an idle system
as long as the poll timeout is long enough to include few debouncing
cycles after the last key has been released, but if the system has been
busy enought that the keyboard task has not been scheduled for a while
and all keys have been released in the meantime, the system will do a
debouncing cycle and fall back into idle even if there are keys that are
waiting to be released.
Fix this by keep polling the matrix as long as any key is pressed
(current condition, bit set in matrix_new_state) OR any key was pressed
and is pending release (bit set in matrix_stable_state) or is currently
being debounced (just to play safe).
The check is implemented in a new function for clarity and efficiency
reasons, so it's not piggybacked into input_kbd_matrix_scan anymore.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add a driver for the TM6605 haptic motor driver IC from Titan Micro
Electronics, found on the DFRobot DRI0056 Gravity module. The device is
a write-only I2C peripheral exposing 44 pre-programmed effects selected
through an effect register and triggered via a control register.
The driver implements the haptics subsystem start_output/stop_output
callbacks and adds a tm6605_select_effect() extension API to choose the
active effect at runtime. A devicetree binding is included.
Tested on Seeed XIAO nRF54L15.
Signed-off-by: Anuj Deshpande <anuj@makerville.io>
Add `modem_cellular_emit_event` declaration to the driver header so that
vendor instances can use the function.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Fix a typo in mcux_igpio_configure() for CONFIG_SOC_MIMX8MQ6_M4
where `flag` was used instead of `flags` when checking
GPIO_PULL_DOWN.
Signed-off-by: Paolo Wattebled <paolo.wattebled@savoirfairelinux.com>
This commit fixes two boundary calculation bugs within read_non_aligned()
in the nrf_qspi_nor driver:
1. Prefix Alignment: Removed the `if (flash_prefix > size)` check. This
check artificially capped the prefix, resulting in unaligned addresses
being passed to the nrfx HAL.
2. Suffix Out-of-Bounds: Replaced the hardcoded WORD_SIZE * 2 suffix
read with a dynamic size check. Previously, if a read ended near the
physical boundary of the flash chip, the hardcoded 8-byte read would
request memory outside the chip's physical address space.
Fixes#109139Fixes#109140
Signed-off-by: T Madhusudhan Rao <tetakalam@aerlync.com>
Added the ability to capture a RAW8 capture by using the GREY FourCC format
through the dump pipe.
Without this patch you could get Grey RAW8 via the pipes 1 and 2 but
not through pipe 0 "dump" pipe. To use Pipe 0 you would have to pretend
the format is a bayer pattern with RAW_BAYER_UNPACKED(8).
Which would cause mismatches when you tried to actually use the buffer.
Signed-off-by: Brenden Adamczak <cerebralasylum1@gmail.com>
Add a guard for `eth_esp32_iomux_rmii_clk_input` function to fix the
following error:
error: 'eth_esp32_iomux_rmii_clk_input' defined but not used
[-Werror=unused-function] 245 | static void
eth_esp32_iomux_rmii_clk_input(void)
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Include zephyr/logging/log.h in the AIROC WHD HAL files that use
LOG_MODULE_DECLARE() and LOG_ERR().
This fixes builds of samples/net/wifi/shell for
cy8cproto_062_4343w/cy8c624abzi_s2d44.
Fixes#109151
Signed-off-by: Shan Pen <bricle031@gmail.com>
Add optional devicetree properties to configure SEDI I2C bus timing and
program those values during driver initialization.
Update the binding with standard, fast, fast-plus, and high-speed timing
properties so boards can provide bus-specific values from DTS instead of
relying only on built-in defaults.
Also update hal_intel revision in west.yml to get code for new changes in
the driver to work properly.
Signed-off-by: Dong Wang <dong.d.wang@intel.com>
Add a driver for the Diodes/Pericom PI4IOE5V6408 8-bit I2C-bus I/O
expander.
The chip provides eight independently configurable GPIO lines, each
with optional pull-up or pull-down resistor and an interrupt source
that fires on transitions away from a programmable default state.
Link: https://www.diodes.com/datasheet/download/PI4IOE5V6408.pdf
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Use dma-coherent dt prop to determine, if
cache operations are needed before and after
DMA operations.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Copy the information filled in the Tx packet by the link layer
during IEEE 802.15.4 transmission before exiting the
stm32wba_802154_tx() function.
Drop the packet from the Tx_done callback issued by the
link layer after a radio reset.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
memcpy is not optimized for the Cortex-M core due to this :
https://github.com/zephyrproject-rtos/zephyr/issues/95154
Modify this by writing each word individually only when source address
is aligned to 4 bytes boundary.
Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
When requesting/releasing the no_latency mode for the mram, verify that
the request/release is successful to avoid running into infinite loop if
the mram controller is in autopowerdown mode.
Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
Fix the case where the MRAM writes get corrupted in some conditions.
After each "MRAM_WORD_SIZE write", a read of the written/erased MRAM word
is performed while masking the bus faults to avoid halting the system.
If an error is detected in the BFSR status bits, retry the write for a
maximum of CONFIG_NRF_MRAM_MAX_RETRIES (default 20) times.
Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
When writes are issued to the mram controller without verifying that it
is ready, it can cause the reads to be stalled until all writes finish.
Fix this by adding a wait busy loop before each MRAM_WORD aligned write
and disable autopowerdown before starting the write.
Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
Add a BULID_ASSERT to make sure that the write_block_size defined in the
device tree is a multiple of the MRAM_WORD_SIZE which is 16B (128 bits)
Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
Determine the expiry status before the read to ensure that this function
only returns `-ETIMEDOUT`` if the flash still isn't ready *after* the
provided `timeout_us`. Checking after the read (in the while condition)
can result in the status being read once on function entry, then the
thread not resuming from the `k_sleep` until after the timeout expires.
The changes the timeout behaviour of `spi_nand_wait_until_ready` from
"Flash not ready at some point before expiry" to "Flash still not ready
after at least `timeout_us`".
Signed-off-by: Jordan Yates <jordan@embeint.com>
This reverts commit 67a29d7f98.
After this commit a BT testcase
tests/bsim/bluetooth/ll/throughput/tests_scripts/\
gatt_write_no_phy_update.sh
started failing, where the RTC1 interrupt fires
in an infinite loop after 4m:17s.
This is blocking all BT related PRs.
Let's revert this commit while the issue is debugged to unblock
development.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Refactors the adltc2990 sensor driver to extract sample fetching into
static functions, and uses the new functions to support fetching
individual channels or all channels at once.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
The MAX30102 is register-compatible with the MAX30101 but has only
Red and IR LED channels (no Green LED). Re-use the existing MAX30101
driver by switching DT_DRV_COMPAT to maxim_max30102 and guarding
Green LED operations with an is_max30102 flag in the config struct.
A shared MAX3010X_INIT macro with a chip argument avoids duplicating
the device instantiation code between the two variants.
Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
Implements the counter_api reset callback for the NXP LPTIMER
driver to reset the counter to the initial value.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
CS40L26/27 is a family of haptics drivers designed for mobile
applications.
This PR provides basic functionality for ROM features and serves
as a starting point for the upstream driver. Notably, RAM firmware,
SPI, and certain ROM features (e.g., GPIO triggers and custom PCM
and PWLE effects) are not supported.
Tested I2C and all included features with both device variants (A1
and B2), including ROM and buzz playback, calibration, and gain
configuration.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Set pmf_cfg.capable for WPA2-PSK so the station advertises PMF
capability, which transition-mode APs require to associate.
Add WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL handling. STA path uses
WPA2-PSK threshold with PMF capable so it can still associate to
WPA2-only and transition APs. AP path advertises WPA2/WPA3 mixed
mode, guarded by CONFIG_ESP32_WIFI_SOFTAP_SAE_SUPPORT.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Lift the unsol_matches table out of modem_cellular.c.
Each driver now declares its own match table via the new
MODEM_CELLULAR_UNSOL_DEFINE() helper, which generates the matches array
and a small modem_cellular_config_unsol descriptor in one go. Drivers
point at it through the new `unsol` field on modem_cellular_config.
Signed-off-by: Paulo Santos <paulo.santos-ext@hexagon.com>
Fixing a startup issue where the device would get into a bad state and
not respond to reads.
Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
move qemu network interface selection, because it fits better in
cmake/emu/qemu.cmake than in cmake/modules/kernel.cmake.
It is also put at the end because for usb network cards, the usb bus
must be created before the network interface can be added. Also true
for other network cards on buses. Currently we don't have usb network
cards in zephyr, but it is better to be prepared for that.
Also use the separate netdev and device option.
The combined command line option didn't work for "usb-net" for example.
For the riscv qemu the -nic option is broken acording to the qemu issue
(https://gitlab.com/qemu-project/qemu/-/work_items/691), so we need to
use the -netdev and -device options.
Because of the change to -netdev and -device options, we need a new
Kconfig option to specify the extra arguments for the network device,
so we add NET_QEMU_DEVICE_EXTRA_ARGS option.
this can be used to customise the network device, like the mac address,
or more device specific options like setting f.e. the addresss/slot of
a pci card.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Update the gnttab_[get|put]_pages and gnttab_[map|unmap]_refs functions
to add support for memory allocation and mapping using extended regions
if CONFIG_XEN_REGIONS is enabled. When the config is not set, the
original behavior is preserved.
To safely map extended memory areas it is required to do that after
stage 2 mapping, i.e., handled by the hypervisor, as accesses to memory
earlier will cause MMU translation errors.
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
Introduce a driver for the extended regions provided by Xen to Zephyr,
running as Xen Domain-0. Extended regions are the unmapped spaces in
Stage 2 address space, and can be used by Zephyr for foreign mapping,
i.e. mapping pages managed by Xen or belonging to other domains. The
regions are configured via the regs property in the hypervisor node,
compatible with xen,xen.
For example, the following device-tree overlay:
&hypervisor {
reg = < 0x0 0x40200000 0x0 0x1000000
0x0 0x40400000 0x0 0x1FC00000
0x0 0x80000000 0x1 0x40000000>;
};
will allocate two extended regions:
- 0x40400000 with size 0x1fc00000
- 0x80000000 with size 0x140000000
The first region, 0x40200000 (size 0x1000000), is used for grant_tables
and will be ignored.
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
- Fixes hwinfo_get_reset_cause() for mimxrt118x.
- On RT118x, SRSR register reads always as zero at application startup,
so use backup SRSR_BBSM register.
- Tested on frdm_mimxrt1186.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
This commit fixes#108916
It wraps assert variables in CONFIG_ASSERT to avoid
unused variable warnings when assertions are disabled.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Implements the counter_api reset callback for the NXP GPT
driver to reset the counter to the initial value.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Adds a color_palette member to the display capabilities struct,
to enable indexed color format displays to expose their color
selection.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Mask the per-endpoint done interrupt while a bulk OUT is left NAKed
(NAKed OUT tokens otherwise storm the ISR), bound the exrs/RDY busy-wait
(RM 18.3.4) so a stuck status bit can't hang the ISR, re-arm rather than
truncate a multi-packet OUT on a zero-count done, and skip the thread hop.
Signed-off-by: William Markezana <william.markezana@gmail.com>
sys_clock_set_timeout() computed the compare value as
cyc = ticks * CYC_PER_TICK + unannounced;
cyc = DIV_ROUND_UP(cyc, CYC_PER_TICK) * CYC_PER_TICK;
target = last_count + cyc;
The DIV_ROUND_UP forces the fire onto the next tick boundary *after*
the requested point, but the driver never subtracts the unannounced
sub-tick offset back out. When the caller arms partway through a tick
(the common case), the timer therefore fires one tick later than the
kernel asked for -- k_timer_start(K_TICKS(N), ...) ends up firing at
roughly N+2 ticks instead of N+1. This is what GoranWall observed on
nrf52840dk: the new tests/kernel/timer/timer_behavior ramp test fails
on specific delay values.
Compute the target directly as
target = last_count + (last_elapsed + ticks) * CYC_PER_TICK
where last_elapsed is the tick count the kernel last observed via
sys_clock_elapsed(), and last_count is tick-aligned by construction.
The fire lands at exactly (last_elapsed + ticks) ticks past the last
announce, regardless of when within a tick the caller armed.
Track last_elapsed in sys_clock_elapsed() and reset it in
sys_clock_timeout_handler() at announce. The COUNTER_HALF_SPAN
wrap-protection check is preserved. Clamp on ticks alone since the
24-bit compare register limit is relative to the current counter,
and target - now = ticks * CYC_PER_TICK - sub_tick.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Support setting desiered SPI communication frequency via configuring
the SCLK_DIV divisior in IFTIM register.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Replace per-instance switch/case in _on()/_off()/_get_rate() with two
static lookup tables built via LISTIFY over FSL_FEATURE_SOC_<IP>_COUNT.
_on() and _off() share the gate map through a common lookup helper.
FLEXIO, TEMPSENSE and SIRC remain as a switch fallback since they have
no indexed SDK enum. Driver shrinks from 499 to 363 lines.
Behavior changes:
* _off() now calls CLOCK_DisableClock() (was a no-op returning 0).
* PIT _on()/_off() use kCLOCK_Pit<i> instead of kCLOCK_Pit<i>Clk,
fixing a latent mismatch with the SDK's clock-gate API.
* LPCMP and FLEXIO no longer return -ENOTSUP on get_rate().
Verified on FRDM-MCXE31B (linkserver):
- samples/hello_world boots, prints over LPUART0.
- tests/drivers/counter/counter_basic_api: 9 PASS, 2 SKIP, 0 FAIL.
- tests/kernel/timer/timer_api: 15/15 PASS.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
Add realtek ameba dma driver.
Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
drivers: dma: ameba: use IF_ENABLED instead of COND_CODE_1 with empty else
Replace COND_CODE_1(CONFIG_DMA_AMEBA_LLI, (...), ()) with the cleaner
IF_ENABLED(CONFIG_DMA_AMEBA_LLI, (...)) idiom in the DMA_AMEBA_INIT
macro. The two forms are semantically identical; IF_ENABLED avoids the
superfluous empty else argument.
Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>