Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Realtek Ameba HAL
(e.g. I2CMaster, I2C_MASTER_MODE, I2C_SLAVE_MODE) are kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Implement the optional gpio_pin_get_config callback for the CAT1
(gpio_infineon) and PSoC 6 (gpio_psoc6) drivers. The PDL drive mode read
back with Cy_GPIO_GetDrivemode(), together with the HSIOM selection and
the output data register, is translated into the corresponding
gpio_flags_t so a configured pin round-trips through pin_get_config().
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
A single-ended output ignored GPIO_OUTPUT_INIT_HIGH/LOW and always came
up at the released level. Select the initial level from the requested
init flag and fall back to the released level only when neither is set.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
gpio_psoc6_config() formed BIT(pin) without validating pin, so an
out-of-range or absent pin could shift past the port-pin mask. Reject
pin >= the mask width and pins not present in port_pin_mask with
-EINVAL before the mask is used.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
Program the CY_GPIO_DM_*_IN_OFF drive-mode variants and enable the input
buffer only when GPIO_INPUT is requested. The input-buffer control bit
(bit 3) is set on CAT1 and cleared on CAT2/PSoC4, so a pure output now
reads back without GPIO_INPUT and configure() stays consistent with the
pin_get_config() readback.
Apply the same input-buffer-off single-ended drive modes in gpio_psoc6,
rejecting the pull-up/pull-down combinations the open-drain and
open-source modes cannot represent.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
The IRQSTEER driver defines the z_soc_irq_* SoC multi-level
interrupt hooks directly, claiming the SoC's contract from a driver:
z_soc_irq_enable(), z_soc_irq_disable(), z_soc_irq_is_enabled() and
z_soc_irq_priority_set(), plus an internal helper that also sat in
the global z_soc namespace. Interrupt controller drivers should only
expose their own namespaced API; providing the SoC hooks is platform
glue and does not belong in a driver.
Rename the control functions to nxp_irqstr_irq_* following the
driver's existing internal prefix, declare them in a driver header,
make the internal enable/disable helper static, and provide the
z_soc_irq_* mapping from one shared platform file wired at the i.MX
family level, covering every SoC with an IRQSTEER devicetree node
(i.MX8/8M/8X ADSP on Xtensa, i.MX93/94/95 M cores on ARM).
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move the interface carrier state out of `modem_cellular` into
`modem_ppp`, as the PPP module is the true "carrier" for the PPP
networking interface.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the ADI MAX32 SDK and datasheet
(e.g. MXC_I2C_SlaveTransactionAsync, mxc_i2c_slave_event_t,
MXC_I2C_EVT_MASTER_WR) are kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the SiFli datasheet
(e.g. I2C_SR_MSD/I2C_IER_MSDIE/I2C_CR_MSDE, I2C_SAR, I2C_TypeDef
register map) are kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Cypress/Infineon PDL and HAL
(e.g. CYHAL_I2C_MASTER_*/CYHAL_I2C_SLAVE_* event macros,
cyhal_i2c_master_transfer_async, cyhal_i2c_slave_config_write_buffer)
are kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Renesas FSP
(e.g. r_riic_master.h / r_iic_master.h, riic_master_extended_cfg_t /
iic_master_extended_cfg_t, i2c_master_* FSP types) are kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Renesas FSP
(e.g. i2c_master_cfg_t, i2c_master_event_t, i2c_master_addr_mode_t) are
kept unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Renesas FSP
(e.g. r_iic_master.h / r_iic_slave.h include paths, iic_master_* /
iic_slave_* FSP types, i2c_master_* / i2c_slave_* FSP types) are kept
unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Same as on XSPI and OSPI, address phase of transaction
on QSPI was only skipped on WREN command. This commit applies
the same fix as on XSPI and OSPI - removes address phase on
every transfer that has addr_lenght = 0.
Signed-off-by: Filip Stojanovic <filipembedded@gmail.com>
Same as on XSPI, address phase of transaction on OSPI
was only skipped on WREN command. This commit applies
the same fix as on XSPI - removes address phase on
every transfer that has addr_lenght = 0.
Signed-off-by: Filip Stojanovic <filipembedded@gmail.com>
The MSPI XSPI driver enabled the address phase for every command
except for Write Enable, which induced to fail on reading JEDEC
ID. mspi_stm32_xspi_hal_address_size maps an address length of 0
to 24-bit address instead of reporting there is no address at all.
Read JEDEC ID failed because the command went out as a 0x9F opcode
followed by three address bytes, while the memory starts shifting
its ID right after the opcode (By the time the controller reached
the data phase the answer had already passed).
This fix skips the address mode whenever the transfer requests
no address. Verified on nucleo_u3c5zi_q + b_m2mem_pack1
(mb1928-33lb Winbond W25Q16JVSNIQ).
Signed-off-by: Filip Stojanovic <filipembedded@gmail.com>
Add CONFIG_MODEM_CELLULAR_ON_DEMAND_CONNECT (default n). When enabled, the
driver no longer dials the PPP data call during power-up; instead it parks
in a new AWAIT_DIAL state and dials only when a consumer admits the PPP
interface (net_if_up()), hanging the call up again on net_if_down(). This
lets a connectivity layer map connect / disconnect onto a real dial /
hang-up, so a connect after a disconnect re-dials.
The admin state is observed with a dedicated net_mgmt callback that
delegates two new events, DIAL and HANGUP. AWAIT_DIAL re-derives the
admin level on entry and self-delivers DIAL, so an ADMIN_UP edge that
arrived early is not lost; HANGUP tears the call down and returns to
AWAIT_DIAL.
When disabled (the default) behavior is unchanged: the data call is dialled
unprompted as part of power-up.
Signed-off-by: Matheus T. dos Santos <matheuswhite1@protonmail.com>
MISRA C:2012 Rule 8.2 requires every parameter in a function type to be
named, including the parameters of function pointer parameters.
The LLCP remote request helper, the LLL test and scan helpers and the
PSoC 6 BLESS receive thread left parameters unnamed. The BLESS thread
gets ARG_UNUSED() for the arguments it deliberately ignores.
Name them after the arguments the documentation or the
definitions already use. No functional change.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The deep-sleep counter (1kHz RTC) used on platform RW61x stops at
zero and does not track PM3 exit recovery time. This causes two
issues:
1. After PM3 exit, the kernel sees unaccounted time remaining
and enters a parasitic PM2 to fill the gap. Fix by adding
the exit-latency back to the compensated sleep time in the
OS timer driver (mcux_os_timer.c).
2. On counter overflow re-entry into PM3, the PM policy
exit-latency subtraction is not applied since re-entry
bypasses the PM framework. Fix by adjusting the RTC wakeup
count in the SoC power re-arm loop (soc/nxp/rw/power.c).
Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.
Identifiers mirroring the Nuvoton NuMaker BSP
(e.g. I2C_SetSlaveAddr, M_* status macros, S_* status macros) are kept
unchanged.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Add a modem event that is output when the modem transitions back to the
idle state. This can be used by higher level application code to monitor
unexpected transitions from the `modem_cellular` state machine.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Reject attempts to suspend modem cellular drivers from the system
workqueue. Suspending from the system workqueue cannot work for several
reasons:
* `modem_cellular_delegate_event` handling runs on the workqueue
* `modem_chat` relies on workqueue for executing any shutdown commands
Output the error to make it clear to users what is happening, and how to
avoid it (don't call `pm_device_runtime_put` from the system workqueue).
Signed-off-by: Jordan Yates <jordan@embeint.com>
The `PM_DEVICE_ACTION_SUSPEND` implementation can block for excessive
durations, see:
```
ret = k_sem_take(&data->suspended_sem, K_SECONDS(30));
````
Blocking the system workqueue for this long is a very bad idea even if
it did work, and it doesn't, because the modem libraries also depend
on the system workqueue to operate correctly.
This is the exact situation the dedicated workqueue was added for, use
it.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Implements power management interface for MAX32 I3C driver.
To restore the peripheral after resuming from a suspend-to-ram state,
use the controller-mode enable bit to detect whether the I3C controller
has lost its state.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Previously, `max32_i3c_ibi_enable()` updated IBI data and programmed the
IBI rules before enabling target interrupts by sending CCC ENEC to the
target. If ENEC failed, the driver ended up with IBI rules configured
for a target that did not enable interrupts.
Reorder the operations so that IBI rules are setup only if ENEC
succeeds.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
i2c_baudrate_calc() clamps BAUD to its maximum when the requested bitrate
cannot be reached and reports success. On this board with a 72 MHz SERCOM
core clock, a node asking for 100 kHz got 137.1 kHz, measured with a logic
analyzer. The same branch catches the unsigned subtraction wrapping, which
it does for any reference clock below roughly 12 times the bitrate: a 1 MHz
reference asked for 400 kHz produces 1.9 kHz. Both directions are now an
error rather than a silent substitution. Clamping downwards is left alone -
a slower bus is always within spec.
The subtraction is guarded instead of being checked after the fact, so the
two directions are told apart before BAUD is computed. Every bitrate the
reference clock is too slow to reach now fails in one place, the clamped
ones included, and a bitrate too slow for the register keeps failing as
before. Both speed ranges run the same two tests with their own limits.
Reachable bitrates keep the BAUD values they had; the clamps are no loss
either, since each produced exactly the registers that the smallest valid
BAUD of its range produces.
The refusal reaches the caller as -EINVAL rather than -EIO: a configuration
that cannot be satisfied is not a transfer failure, and a caller that
retries on -EIO would otherwise retry forever. The other -EIO in the
function is left alone - a reference clock that reads back as zero really
is a failure to talk to the hardware.
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
This commit updates the usage of ring_buf to utilize the new
put_ptr/commit/get_ptr/consume pattern instead of the traditional
claim/finish approach. This change is part of a larger refactor aimed at
streamlining the ring_buf API and improving its efficiency.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
This commit updates the usage of ring_buf to utilize the new
put_ptr/commit/get_ptr/consume pattern instead of the traditional
claim/finish approach. This change is part of a larger refactor aimed at
streamlining the ring_buf API and improving its efficiency.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
This commit updates the usage of ring_buf to utilize the new
put_ptr/commit/get_ptr/consume pattern instead of the traditional
claim/finish approach. This change is part of a larger refactor aimed at
streamlining the ring_buf API and improving its efficiency.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
This commit updates the usage of ring_buf to utilize the new
put_ptr/commit/get_ptr/consume pattern instead of the traditional
claim/finish approach. This change is part of a larger refactor aimed at
streamlining the ring_buf API and improving its efficiency.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
The streaming path wrote full interrupt-route structs containing only
its own bit, so arming the DRDY stream trigger cleared the FIFO
watermark/full routing and vice versa, silently losing events when both
are requested. Read-modify-write the route as the trigger path already
does. Also honor the trigger disable flag in the DRDY path, which
unconditionally enabled the route even when asked to disable it.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
On sensor_clock_get_cycles() failure, the submit-sample path called
rtio_iodev_sqe_err() and then jumped to the shared err label, which
called rtio_iodev_sqe_err() again on the same (already freed) SQE.
Drop the first call so the err block performs the single completion.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The FIFO decoder mapped the SLAVEn tag index directly onto the
compile-time sensor hub list, ignoring the runtime detected-device
mapping (shub_ext), so frames were decoded as the wrong channel when
a compiled-in external sensor was not populated. Carry shub_ext and
num_ext_dev in the FIFO header and index through them, and fix the
off-by-one bounds check in lsm6dsv16x_shub_type().
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
lsm6dsv16x_hum_convert() stored the entire relative humidity value in
micro-percent in val2, so converting the sensor_value back to a float
roughly doubled the reading. Store only the fractional remainder in
val2, as required by the sensor_value contract.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
data->accel_freq and data->gyro_freq hold the full mode-encoded ODR
byte (mode in the upper nibble, e.g. 0x18 for HA01 500 Hz), so using
them directly as a column index into lsm6dsv16x_odr_map[3][13] reads
out of bounds for high-accuracy devicetree ODRs. Mask to the low
nibble, which is the actual CTRL ODR field; the mode nibble is already
handled via the row index.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The data-ready streaming path stored the raw full-scale register
index in accel_fs_idx, while the decoder tables are ordered by
g-value. On LSM6DSV32X this made decoded accel samples half their
true value. Convert with LSM6DSV16X_ACCEL_FS_VAL_TO_FS_IDX() as the
one-shot and FIFO paths already do.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The I3C instantiation macro used the non-existent UNTIL_AND instead of
UTIL_AND, making IF_ENABLED silently expand to nothing and dropping the
.rtio_ctx, .iodev and .bus_type initializers, so I3C streaming faulted
on the first interrupt via a NULL RTIO context.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
lsm6dsv16x_sample_fetch() accumulated the return value of the
accel/gyro/temp/shub fetch helpers in 'ret' but ended with 'return 0;',
so bus errors during a fetch were reported as success and stale data
could be served by channel_get. Return 'ret' instead, matching the
sibling lsm6dso driver.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
For the NXP MCXE31B mcu there is currently no
driver support for the ethernet controller, add it via
the generic dwc_mac driver.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Fin Maaß <info@finmaass.de>
Advertise support for callback events via capabilities->supported_events
returned by display_get_capabilities() API.
Add the new capas field to drivers using events callback.
Remove events mask validation from drivers, it is now handeled at API
level.
Consider a wrong events mask as an invalid argument and return -EINVAL.
Now -ENOTSUP is only returned upon unsupported cb invocation context.
Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
Remove local OPERATION() in STM32 I2C non-RTIO and RTIO drivers. Testing
I2C message flags explicitly is enough.
No functional changes.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Indent value of I2C_STM32_IRQ_HANDLER_DECL() and I2C_STM32_IRQ_HANDLER()
macros for consistency inside the Zepĥyr source tree.
Add __unused attribute to argument of the generated
i2c_stm32_irq_config_func_##index() functions.
While at it, replace tabulation with a space char after #endif closing
guard in i2c_stm32.h and split some helper macros definitions with empty
lines to ease readability.
No functional changes.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Reorder header files in STM32 I2C drivers to group Zephyr generic header
files together. For that purpose, remove definition of LOG_LEVEL macro
and provide the log level config as LOG_MODULE_REGISTER() argument
which use is moved after header files inclusions.
Remove #ifdef directives that are not really useful around #include
directives.
Remove several #include directives from local i2c_stm32.h file.
No functional changes.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Factorize i2c_stm32_runtime_configure() between STM32 I2C non-RTIO
and RTIO drivers that implements the same sequence but regarding
SMBus support that is not yet available in the RTIO driver.
No functional changes.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>