Some of the sensore channels (e.g. SENSOR_CHAN_GRAVITY_VECTOR and/or
SENSOR_CHAN_GBIAS_XYZ) are returning three axis values. The current
code was passing a single value and was actually crashing.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Add SENSOR_ATTR_CHIP_ID entry (last one) in sensor_attribute_name
declaration/initialization. This is fixing a sensor_shell crash.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Replace direct flag checks in i2c_dump_msgs_rw() with helper
functions to improve readability and consistency.
Use i2c_is_read_op() instead of checking I2C_MSG_READ directly.
Introduce i2c_is_reset_op() to handle restart conditions and
use i2c_is_stop_op() for stop detection. Also change the loop
index type from unsigned int to uint8_t.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Add CONFIG_INPUT_FT5336_PM_MODE_MONITOR to select monitor mode
(0x01) for PM suspend. Monitor mode reduces the scan rate and
auto-wakes on touch detection, allowing touch events to resume
without a hardware reset. When disabled, hibernate mode is used
which requires reset-gpios to be defined.
Reconfigure interrupt GPIO on PM resume for SoCs that lose
peripheral state in deep sleep.
Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
Guard TARGET_BOOT_STS and TARGET_BOOT_DONE vwire signaling with
CONFIG_ESPI_AUTOMATIC_BOOT_DONE_ACKNOWLEDGE.
This allows boot status acknowledgment timing to be configurable
based on different eSPI boot flows.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Fixed CTRLA register write bugs in spi g1 driver
Updated the transfer function for handling dma mode
Fixes#106580
Signed-off-by: Mohamed Azhar <mohamed.azhar@microchip.com>
Add support for the base DT property "supply-gpios" and related
"t-reset-recovery", as in the flash_mspi_nor driver.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Realtek Bee series GPIO does not support configuring a pin as both
input and output simultaneously. Return -ENOTSUP to skip related
test cases.
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Add support for retrieving the direction of selected GPIO
pins. The it51xxx SoC does not support a combined
input-output mode, so return -ENOTSUP when such that mode
is requested.
Tested with:
- tests/drivers/gpio/gpio_hogs
- tests/drivers/gpio/gpio_get_direction
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Removed hard-coded QSPI transfer mode definitions and replaced them
with MSPI-specific constants which is part of the new MDK.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
nRF7120's QSPI peripheral has been renamed to MSPI.
To align with this change, the driver has been updated to
use MSPI semantics instead of QSPI.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
QSPI peripheral is now called MSPI in the MDK. To align
with this change, peripheral has been renamed in the
devicetree to MSPI.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
The emulator would not work when the write block size of the flash is
greater than 255 and have an erase value other than 0xff. This commit
fixes those problems by retrieving the flash erase value from the
flash device and by changing the flash_cbs variable type to support
larger write block sizes. Also fixed some typos
Signed-off-by: Jip Anema <janema@highvolteng.com>
The driver provides basic RTC functionality including time read and
write, alarm configuration(alarm1 and alarm2), and daylight saving
time (DST) support.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Implement ibi_crr_response for the DW driver by setting/clearing the
MR_REJECT bit (bit 14) in the target's DAT entry. The DW IP
automatically NACKs MR requests from targets with this bit set and
issues a directed DISEC CCC.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
When an unknown PID is discovered during ENTDAA, allocate a device
descriptor from the mem slab via i3c_device_desc_alloc(), populate it
with the PID, dynamic address, BCR, and DCR, assign controller
private data, and attach it to the bus device list. This matches the
Cadence I3C driver behavior and ensures dynamically discovered
devices are tracked.
Also set controller_priv for known PIDs in the same path, which was
previously missing.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Replace 12 open-coded PRESENT_STATE_CURRENT_MASTER register checks
with a dw_i3c_is_current_controller() inline helper that takes the
device pointer, improving readability and reducing duplication.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
When a secondary controller receives a DEFSLVS/DEFTGTS CCC, the DW
IP writes SDCT (Secondary Device Characteristic Table) entries to the
DCT region and generates a response with TID=0xf and DATA_LENGTH set
to the device count.
Read the SDCT entries and populate data->common.deftgts with the
active controller and target device information, matching the pattern
used by the Cadence I3C driver. This is done via a k_work item to
avoid allocating memory in ISR context.
On bus owner update, when gaining controllership, enqueue
i3c_sec_handoffed() to consume the deftgts data and attach all
devices from the previous controller's bus state. Also invoke the
controller_handoff_cb if registered.
Guarded by both CONFIG_I3C_CONTROLLER and CONFIG_I3C_TARGET since
DEFTGTS is used for controller role handoff which requires both roles.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Add support for controller role (mastership) handoff using standard
DW I3C registers:
- Implement I3C_IBI_CONTROLLER_ROLE_REQUEST in target ibi_raise using
SLV_INTR_REQ (0x8C, bit 3) with HW capability, DA validity, and
DISEC checks before issuing the request.
- Handle mastership request IBIs on the controller side via
i3c_ibi_work_enqueue_controller_request() instead of dropping them.
- Handle INTR_BUSOWNER_UPDATE_STAT in the ISR to flush FIFOs, resume
the controller, and reconfigure interrupt masks for the new role.
Guarded by both CONFIG_I3C_CONTROLLER and CONFIG_I3C_TARGET since
role switching requires both roles compiled in.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Add an ARM SCMI option to force polling based communication flow.
This may be needed if SCMI platform does not support interrupt-driven
communication flow.
Signed-off-by: Julien Panis <jpanis@baylibre.com>
syscon_sanitize_reg() was silently rounding down misaligned offsets to
the nearest aligned address via ROUND_DOWN(). This masks caller bugs:
an offset of 0x03 with reg_width=4 would silently become 0x00, reading
the wrong register with no error reported.
Change to reject misaligned accesses with -EINVAL instead.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add a spinlock to the generic syscon driver data so that concurrent
register accesses from multiple consumers are serialized per-device.
Also introduce syscon_update_bits() which performs an atomic
read-modify-write under a single lock hold.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
When analog_axis_calibration_get and similar are called in
analog_axis_set_raw_data_cb installed callback, analog_axis_loop
can self-deadlock. Loop takes cal_lock before invoking callback
and analog_axis_calibration_get (ex.) tries to aquire cal_lock again
at K_FOREVER in same context. Fixed by reducing cal_lock scope
and taking copy of callback ptr while under cal_lock, so cal_lock is
released before running raw callback in analog_axis_loop.
Signed-off-by: David Chalco <david@chalco.io>
Used Zephyr inline register access functions (sys_read/write)
instead of CMSIS register structure.
Used soc helper api to access/configure girq registers.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
When ESP32_WIFI_STA_AUTO_DHCPV4 is
enabled functions from the dhcpv4 clients are
used, therefore we need to depend on it, otherwise
a user could activate that Kconfig without the dhcpv4
client being enabled, which would lead to a build error.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Same issue as the GPIO driver: esp32_pin_is_valid() and
esp32_pin_is_output_capable() use BIT() which overflows on 32-bit
Xtensa for pin numbers >= 32.
Fix by using BIT64() to match the 64-bit SOC_GPIO_VALID_GPIO_MASK.
Signed-off-by: Matin Lotfaliei <matinlotfali@gmail.com>
gpio_pin_is_valid() and gpio_pin_is_output_capable() use BIT() which
expands to (1UL << n). On 32-bit Xtensa targets, unsigned long is
32 bits, so BIT(n) for n >= 32 is undefined behavior.
This causes gpio1 pins (GPIO32+) to always fail validation with
-EINVAL, breaking any peripheral connected to GPIO32-GPIO48 on
ESP32-S3 (and similar ESP32 variants with gpio1).
Fix by using BIT64() which correctly handles pin numbers >= 32
since SOC_GPIO_VALID_GPIO_MASK is already a 64-bit value.
Signed-off-by: Matin Lotfaliei <matinlotfali@gmail.com>
Use the WFET (Wait For Event with Timeout) instruction, introduced in
Armv8.8-A (FEAT_WFxT), to let the CPU enter a low-power state during
arch_busy_wait() instead of spinning on the counter.
The availability of WFxT is detected at runtime by reading
ID_AA64ISAR2_EL1. When the feature is absent, the existing polling
loop is used as before.
Also fix the cycles_to_wait computation to use 64-bit multiplication
to avoid truncation with large usec_to_wait values.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add I3C_CONTROLLER_FLAG_DISABLE_HJ_AT_INIT as BIT(1) in the
controller config flags. When set via the devicetree boolean property
"disable-hj-at-init" on the I3C controller node, Hot-Join ACKs will
not be enabled at the end of bus initialization. Hot-Join events will
be NACKed until the application explicitly enables them.
Guard the ENEC HJ broadcast in i3c_bus_init() (i3c_common.c), the
cdns-specific HJ ACK register write, the dw HJ NACK clear, and the
stm32 LL_I3C_EnableHJAck() call with this flag.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Add a flags field (uint8_t) to struct i3c_driver_config and define
I3C_CONTROLLER_FLAG_DISABLE_BUS_INIT as BIT(0). When set via the
devicetree boolean property "disable-bus-init" on the I3C controller
node, i3c_bus_init() will not be called during driver initialization,
allowing the application to perform bus initialization at a later time.
Add I3C_CONTROLLER_CONFIG_FLAGS_DT_INST() macro in devicetree.h to
read the flag from the devicetree, following the same FIELD_PREP
pattern used for per-device flags in I3C_DEVICE_DESC_DT.
Update cdns, dw, max32, it51xxx, mcux, npcx, renesas_ra, and stm32
drivers to populate the new flags field and check it before calling
i3c_bus_init().
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
The `NET_IF_LOWER_UP` (carrier on/off) state is not intended to signify
network registration state, that is the job of `NET_IF_DORMANT`. The
example from the documentation is:
> An example of an event that changes the carrier state is Ethernet
cable being plugged in or out.
In the context of an LTE network, I am interpretting the equivalent of
the "cable" to be the modem ready to start searching for networks to
join. The state combinations end up being:
* `!LOWER_UP && DORMANT`: Modem off or booting
* `LOWER_UP && DORMANT`: Modem searching for network
* `LOWER_UP && !DORMANT`: Modem registered to network
Signed-off-by: Jordan Yates <jordan@embeint.com>
According to the networking documentation:
> The network association status is represented with NET_IF_DORMANT flag
Therefore, the flag should be set at any time that the network is not
associated with. This is achieved by setting the flag at boot, and only
controlling the dormant state at entry/exit from the `REGISTERED` state.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The name of this state is misleading as it is the same as the internal
Zephyr networking interface state of dormant. Rename the state to match
what it is doing, in the same way other states are named.
The misapplication of the interface `dormant` state by `AWAIT_PPP_DEAD`
is fixed later.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The driver transitions to this state upon registering to the LTE
network, not upon the internal Zephyr concept of `carrier_on`.
`carrier_on` is an internal (and incorrect) consequence of transitioning
to the registered state, and should not be the basis of the name.
Signed-off-by: Jordan Yates <jordan@embeint.com>
net_if_carrier_off() should be called before
phy_link_callback_set(), as itside it, the carrier could be
already changed.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
In `ep_check_config()`, capabilities of the endpoint provided by the driver
are logged, but not the requested endpoint configuration. As a result, when
the function fails, it is not possible to determine why using only logs.
Add logging of the requested configuration in addition to the driver caps
to allow easily determining the cause of the failure (when logging is on).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
- PNG is treated similarly to JPEG with a rough worst-case estimate.
- Treat NV12/NV21 formats specially rather than fall into the default
condition. These 2-planar YUV formats have a pitch equal to width and
a total size of pitch * height * 2 (Y plane + interleaved UV plane).
Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
The need to monitor battery voltage on nordic devices and nRF7120
in particular is required among other metrics such as die temperature.
Creating a sensor to measure battery voltage allows to easily monitoring
of all required metrics in a consistent way.
This commit adds a new sensor driver to monitor battery.
Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
Implement post-merge review remarks:
- check return values correctly
- fix bad function naming
- fix binding no title
- use function instead of macro as is possible
Signed-off-by: Camille BAUD <mail@massdriver.space>
STM32 HAL2 brings many changes regarding structure, macro and function
names, so add a compatibility layer to keep the driver working for both
versions.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
During RX duty cycle mode the SX126x keeps BUSY asserted even in
the sleep phase. The standby command cannot be sent because the HAL
waits for BUSY LOW first.
Fix by calling sx126x_hal_wakeup() before set_standby when
cancelling duty cycle reception. The wakeup function drives NSS low
directly (bypassing the BUSY check), which forces the radio out of
duty cycle and into STDBY_RC.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>