The mux subsystem redefines the "nxp,inputmux" binding as a mux
controller (#mux-control-cells / #mux-state-cells), which collided with
the EQDC driver's use of the same compatible through a
"specifier-space: inputmux" phandle-array. Reconcile the two by moving
the EQDC PHASEA/PHASEB input routing onto the generic mux model:
- nxp,mcxa156 / nxp,mcxa344 / nxp,mcxaxx6: switch the inputmux node
from #inputmux-cells to #mux-control-cells / #mux-state-cells so it
validates against the new binding (nxp,mcxa153 was already done).
- nxp,mcux-eqdc.yaml: drop the local inputmux-connections property and
include mux-consumer.yaml; routing is now described with "mux-states".
- eqdc_mcux: drop the direct fsl_inputmux HAL calls and apply the
routing through mux_state_apply(), guarded by device_is_ready(). The
mux controllers init at priority 40, before the sensor at 90, so they
are ready at EQDC init time.
- Migrate the frdm_mcxa153/156/266/344/346/366 QDEC sample overlays to
the mux-states syntax.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Drop the direct MCUX_XBARA HAL coupling in the QDEC driver in
favour of the new generic mux subsystem: the driver now selects
CONFIG_MUX, defines mux states from a "mux-states" devicetree
property and applies them at init time via mux_state_apply(),
which makes it agnostic to the underlying mux hardware.
Update the nxp,mcux-qdec binding to include mux-consumer.yaml,
augment the i.MX RT10xx XBAR nodes with CCM clock phandles plus
the new #mux-control-cells / #mux-state-cells declarations, and
migrate the MIMXRT1050-EVK QDEC overlay to the mux-states syntax.
Add the matching XBAR clock support to the i.MX CCM clock driver
(IMX_CCM_XBAR1_CLK / IMX_CCM_XBAR2_CLK gate/ungate, guarded by
CONFIG_MUX_NXP_XBAR) so the XBAR controllers referenced by those
nodes can be clocked.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Drop the direct INPUTMUX_AttachSignal() coupling in the QDC driver
in favour of the new generic mux subsystem: the driver now selects
CONFIG_MUX, defines mux states from a "mux-states" devicetree
property, and applies them at init time via mux_state_apply().
This makes the driver mux-hardware-agnostic.
Update the nxp,mcux-qdc binding to use mux-consumer.yaml, expose
the inputmux0 node on the MCXNx4x family DTSI, and migrate the
FRDM-MCXN947 / MCXN5xx-EVK QDC overlays to the new mux-states
syntax.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
buffer_size was set to the size of the whole data struct instead of
the uint16_t buffer member. Use sizeof of the member.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The SPI read command buffer was 2 bytes but described with a length
of 3, reading past the stack array and clocking out an indeterminate
byte. Size the buffer to match.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The trigger setup wrote the FF_MT_THS register address (0x17) as the
threshold instead of the maximum. Write FXOS8700_FF_MT_THS_MASK as
the comment describes.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add a sensor driver for the NXP MCUX Enhanced Quadrature Decoder (EQDC)
using the fsl_eqdc HAL. The PHASEA/PHASEB decoder inputs are routed
through the on-chip INPUTMUX, described by an "inputmux-connections"
phandle-array following the nxp,inputmux convention.
The driver exposes SENSOR_CHAN_ROTATION, SENSOR_CHAN_RPM,
SENSOR_CHAN_ENCODER_COUNT and SENSOR_CHAN_ENCODER_REVOLUTIONS; the last
channel is added to the sensor API. Velocity uses the EQDC period
measurement (POSDH/POSDPERH), so a prescaler keeps the 16-bit period
counter from saturating at the sample rate.
A single-phase-mode property selects single-phase decode (one count per
PHASEA pulse, with the direction taken from PHASEB) instead of the
default quadrature X4 decoding, with the counts-per-revolution scaling
adjusted accordingly.
Co-authored-by: bnina-ayoub <ouba.bnina@gmail.com>
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Read the temperature sensor calibration value through the
NVMEM API instead of the legacy ROM OTP API. The calibration
data is exposed by the OCOTP node as an NVMEM cell, so the
driver no longer depends on fsl_romapi_otp.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
config->adc is of type 'const struct device *', assigned via
DEVICE_DT_GET(). It has no '.dev' member — that field exists only
in 'struct adc_dt_spec'.
The LOG_ERR_DEVICE_NOT_READY() call in lpadc_temp40_init() was
using config->adc.dev, causing a compile error on all platforms
that select NXP_PMC_TMPSNS:
error: 'config->adc' is a pointer; did you mean to use '->'?
Remove the spurious '.dev' dereference. LOG_ERR_DEVICE_NOT_READY()
accepts 'const struct device *' directly, so passing config->adc
is correct and consistent with the device_is_ready() call on the
line above.
Signed-off-by: Bartlomiej Fijal <StaryAnoda@Gmail.com>
config->adc is of type 'const struct device *', assigned via
DEVICE_DT_GET(). It has no '.dev' member — that field exists only
in 'struct adc_dt_spec'.
The LOG_ERR_DEVICE_NOT_READY() call in lpadc_temp40_init() was
using config->adc.dev, causing a compile error on all platforms
that select NXP_LPADC_TEMP40:
error: 'config->adc' is a pointer; did you mean to use '->'?
Remove the spurious '.dev' dereference. LOG_ERR_DEVICE_NOT_READY()
accepts 'const struct device *' directly, so passing config->adc
is correct and consistent with the device_is_ready() call on the
line above.
Signed-off-by: Bartlomiej Fijal <StaryAnoda@Gmail.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>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/rtc`
- `drivers/sdhc`
- `drivers/sensor`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add driver support for NXP MCUX Quadrature Decoder (QDC) sensor.
The driver provides:
- Position tracking via SENSOR_CHAN_ROTATION channel
- Configurable counts per revolution
- Single phase and normal decoder work modes
- Input filtering with configurable count and sample period
- INPUTMUX integration for flexible signal routing
- Modulo count mode support
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
1. Removed nxp,sensor-lpcmp.yaml and merged its
properties into nxp,lpcmp.yaml. Now a single
dt-binding (compatible: nxp,lpcmp) is shared
by two drivers: the sensor API-based LPCMP
driver and the comparator API-based LPCMP driver.
2. Updated the driver and samples accordingly.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Add a new driver for the NXP TempSense temperature
sensor found in various NXP MCUs, such as the MCX
family. The driver reads temperature data from the
TempSense peripheral and provides it via the Zephyr
sensor API.
The TempSense peripheral details can be found in the
NXP MCXE31x reference manual chapter 78.
reference manual can be found at:
https://www.nxp.com/webapp/Download?colCode=MCXE31XRM
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
We are planning to implement a new lpcmp driver based on the
comparator API and deprecate the current sensor-based driver.
We now mark the mcux_lpcmp as deprecated.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
We are planning to implement a new LPCMP driver based on the
comparator API and deprecate the current sensor-based driver.
We would like to use the nxp,lpcmp binding for the new
comparator-based driver implementation. To avoid naming conflicts,
we are renaming the current sensor binding to nxp,sensor-lpcmp.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.
Duplicates inside different #ifdef branches are preserved
as they may be intentional.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Reduce floating-point operations in the nxp_pmc_tmpsns.
Provide new calculation method without floating-point operations.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Remove the configs that are not actually used for anything anymore or
never were, or that are redundant with other configs, and don't have any
code changes outside of Kconfig to remove.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
1. Fixed the bug that DAC value was set incorrectly.
2. The MIMXRT700 does not have windowed mode and
'enableSample' controls, code added for compatibility
on this platform.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Coverity identified out-of-bounds access. A uint8_t being cast to
an enum is undefined in that the enum can be allocated 4bytes.
Change the internal function to use the base type of the variable,
uint8_t to avoid potential compiler size alignement problems.
Fixes#81927
Signed-off-by: David Leach <david.leach@nxp.com>
The function fxls8974_get_temp_data always returns zero, indicating
success.Therefore, the error checking if condition is unnecessary and
can be removed.
Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
find a sensor driver bug don't judge the data whether read back
correctly, deal with buffer data directly.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
Remove Kconfig dependency on SOC_FAMILY_KINETIS as the temperature
sensor is available also on MCX family.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Update the devicetree binding for the nxp,kinetis-acmp comparator and
move the binding to dts/bindings/comparator.
The update to the binding includes:
- Remove unused io-channel-cells property
- Remove unused sensor-device include
- Adding missing properties dac config, discrete mode config, and
input configs.
- Rename properties to exclude redundant vendor prefix since props in
this binding are not inhereted, and as such, don't need to be
namespaced.
- Deprecate the old names of the renamed properties
The sensor based device driver has been updated to support both the
deprecated and new property names. This allows it to use both
nxp,enable-sample and filter-enable-sample for example.
Additionally, remove the unused io-channel-cells properties from
in-tree nodes of compatible = "nxp,kinetis-acmp"
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The mcux_acmp will get support by the comparator subsystem. To avoid
namespace clashes, namespace the driver, kconfigs and use the
MCUX_ACMP config solely to select the MCUX SDK driver.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Remove the ‘HAS_MCUX_ACMP’ Kconfig, and also remove it from
driver and soc Kconfig files. It is not needed since we already
depend on 'ACMP' enabled in the dt file, the 'HAS_MCUX_ACMP'
kconfig is a relic of the past before devicetree was stable.
Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
The NXP Kinetis temperature sensor depends on CONFIG_ADC. Make the driver
Kconfig select CONFIG_ADC to get better CI coverage (enabling the driver
when CONFIG_SENSOR is enabled without depending on CONFIG_ADC=y).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>