Use controller/peripheral and SDO/SDI terminology in sensor drivers,
following coding guideline rule A.2: switch the SPI configuration
constants to SPI_OP_MODE_CONTROLLER and update SPI wiring comments.
For the Broadcom AFBR-S50 sensor, the spi-sdi-gpios/spi-sdo-gpios
devicetree properties (named from the sensor's own perspective per
the OSHWA resolution) replace spi-mosi-gpios/spi-miso-gpios. The old
property names are still accepted, marked as deprecated in the
binding, and used as fallbacks; the Zephyr platform glue in
modules/hal_afbr is updated to the renamed fields. The Broadcom
Argus API names (s2pi_slave_t, S2PI_*) come from the vendor library
and keep their names.
Occurrences that concern I2C rather than SPI (I2C controller ACK
behavior comments in NXP drivers, the lsm6dso sensor-hub I2C master
code using ST HAL APIs and application note quotes) and vendor
register names (TDK MPUREG_MASTER_LOCK) are out of scope and keep
their wording.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The optional delay argument accepted by SPI_CONFIG_DT, SPI_CONFIG_DT_INST,
SPI_DT_SPEC_GET, SPI_DT_SPEC_INST_GET and SPI_CS_CONTROL_INIT was
deprecated in Zephyr 4.3 and is now removed as part of the 4.5 deprecation
removal cycle.
These macros now take a fixed argument list, and the chip select timing is
always derived from the spi-cs-setup-delay-ns and spi-cs-hold-delay-ns
devicetree properties of the SPI device node. The SPI_DEPRECATE_DELAY_WARN
helper and the COND_CODE_0()/IS_EMPTY(__VA_ARGS__) plumbing that only
existed to support the deprecated form are dropped as well.
SPI_DT_IODEV_DEFINE and SPI_DT_INST_IODEV_DEFINE lose their variadic
argument too, since they forwarded it into SPI_DT_SPEC_GET.
The four remaining in-tree callers that still passed the deprecated
argument all passed a delay of 0, so nothing needs to be described in
devicetree for them.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
The gyroscope full scale list uses 0 as padding for the gaps in the
ISDS_gyroFullScale_t encoding, so a requested scale of 0 dps matched a
reserved entry and programmed an invalid register code, silently zeroing
all further gyro readings. Reject a zero full scale with -EINVAL.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
SENSOR_CHAN_AMBIENT_TEMP shared a case block with SENSOR_CHAN_ALL that
required both the accelerometer and the gyroscope to be enabled, so
fetching the die temperature returned -ENOTSUP whenever either ODR was
set to the power-down entry. Give the temperature channel its own case
that derives the poll step from whichever engine is enabled.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The SENSOR_ATTR_FULL_SCALE getter for SENSOR_CHAN_GYRO_XYZ returned the
raw dps value from the full scale list, while the setter converts its
input with sensor_rad_to_degrees(), so a get-then-set round trip failed
with -EINVAL. Convert the reported range to rad/s to match the setter.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
The SENSOR_ATTR_FULL_SCALE getter for the accelerometer returned the
raw range from the full scale list, which is expressed in g, while the
setter expects m/s^2 as mandated by the sensor API. Convert the value
with sensor_g_to_ms2() so the getter is the exact inverse of the
setter.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
Add missing dependencies on the HAL module for sensors that use the HAL
headers. This fixes compile time errors for `build_all` tests downstream
that don't have the HAL checked out.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Unify all "device not ready" error messages across sensor drivers with
the LOG_ERR_DEVICE_NOT_READY macro, following the pattern established
for input drivers in commit 31b5866.
This improves consistency and makes device readiness errors easier to
grep across the codebase. Using the standardized macro ensures device
names are properly formatted with null-safety checks.
Image size impact (tests/drivers/build_all/sensor on native_sim,
building 211 sensor drivers):
- Before: 1,033 KB (text: 961 KB)
- After: 1,036 KB (text: 964 KB)
- Change: +2.5 KB (+0.25%), text: +2.5 KB
The small size increase is due to the macros adding null-safety checks
and dynamic device name formatting, which generates slightly more code
than some of the simpler static log strings used by drivers previously.
Assisted-by: Claude:claude-sonnet-4.5
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
This macro doesn't accept a delay parameter anymore (well, it does, but
it's deprecated and will trigger build warnings). Just remove it from the
places that were still passing it.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add wsen_isds_2536030320001 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>
The returned values from function calls should
be ignored since these function calls are dummy reads.
fixes#90480
Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
Add wsen_itds_2533020201601 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>
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>
Add wsen_tids_2521020222501 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>
Add wsen_pdus_25131308XXXXX 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>
Add wsen_hids_2525020210002 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>
During initialization, zero is returned if an unexpected device ID is
read because the returned variable is not written to after a previous
non-zero check. Return -EIO instead to indicate an error occurred.
Detected with the following Coccinelle script:
@@
identifier I;
@@
*if (I) {
...
return ...;
}
if (...) {
... when != I
when any
* return I;
}
Signed-off-by: Jared Kangas <kangas.jd@gmail.com>