Commit graph

15409 commits

Author SHA1 Message Date
Sachin D Kulkarni
a6dfdb9b8c drivers: nrf_wifi: Use mode specific APIs
Update the nrf70 Wi-Fi driver to use the mode specific
APIs (as a precursor to enable combining modes as required).

Signed-off-by: Sachin D Kulkarni <Sachin.Kulkarni@nordicsemi.no>
2025-02-10 09:02:55 +01:00
Johann Fischer
c8f3a2eb2d usb: host: allow dynamic allocation of USB devices
Allow dynamic allocation of USB devices on connected event.
Add very basic USB device validation and configuration.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
fa7752494d usb: host: rework usbh_xfer_alloc() parameters
The transfers require enpoint MPS for proper transaction handling,
assign it in the common place during transfer allsocation so that it can
be reused.
Some users, such as USBIP, may need to keep a reference to private data,
add a parameter for completion callback data.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
63bd9ac1d0 drivers: uhc: add opaque pointer to store upper layer private data
Add an opaque pointer to store upper layer private data and initialize
it with the USB host context during controller initialization. Use the
pointer in event processing to get the correct context.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
5d5de63d67 drivers: uhc: interrupt transaction handling
Add interrupt and start frame parameters and schedule transaction at
specific frame. Implement for virtual driver only.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
a7c8a8d46d drivers: uhc: remove UHC transfer parameter addr and attrib
Address parameter/argument is no longer needed because we have a pointer
to the USB device. The Attrib parameter has never been used and will be
replaced by the interval and start-frame parameters in the future.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
60884cc326 usb: host: move representation of a USB device to UHC header
This will allow the controller driver to access information about the
device in the future.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Johann Fischer
a91740e1cf drivers: uhc: implement the dequeue function
Implement the dequeue function and remove the timeout parameter as it is
no longer necessary and can be handled in the upper layer. The dequeue
function is required for the USBIP implementation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Flavio Ceolin
5e3f3ce3f5 pm: Remove deprecated function
z_pm_save_idle_exit was deprecated before 3.7, it is time to remove it.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-02-10 03:41:06 +01:00
Reto Schneider
97ddfbc962 kernel: Fix typo
The 'd' in dstate is probably there by accident.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2025-02-10 03:40:56 +01:00
Thomas Deppe
f3bdd2bc8c Bluetooth: Host: Add support for Advertising Coding Selection
Adds API for Advertising Coding Selection.

Introduces two new advertising options to configure the advertiser's
requirement concerning coding scheme when LE Coded PHY is configured.
While the Bluetooth v6.0 specification makes a distinction betweeen
preferred and required advertising PHY options, a simplification is
made to only expose the required PHY options. Inline with how LE Coded
PHY is implemented; this API will set both the primary and secondary
advertising PHY's to the same coding scheme.

The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION, and requires
a controller that selects CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.

Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
2025-02-08 10:09:41 +01:00
Daniel Baluta
da2f5a8b34 drivers: dai: Add new enum for PDM MICFIL type
Add new DAI type enum for PDM MICFIL.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-02-08 00:32:26 +01:00
Aurelie Fontaine
5213c2cba3 drivers: sensor: icm42670: add icm42370-P support
To support icm42370-p sensor, we renamed icm42670 to icm42x70
 as the driver is similar to ICM-42670-P/S in hal_tdk module.
Keep icm42670 source and header for dedicated code.

Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
2025-02-08 00:31:43 +01:00
Jukka Rissanen
e98bf3e6d7 net: dns: Use dispatcher context in callbacks
Feed the dispatcher context to dispatcher callbacks instead of
resolver or responder context. The callback can then use the
proper context because the dispatcher context contains those
two context. This allows dispatcher callback to utilize all the
information (like interface etc) stored in dispatcher context.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-02-07 17:47:12 +01:00
Jamie McCrae
d4b2b749a8 mgmt: mcumgr: grp: img_mgmt: Limit scope of includes
Limits the scope of includes to only include some files if they
are needed, which is when a Kconfig is set

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-07 14:32:36 +01:00
Grant Ramsay
f9d69fc583 arch: arm: cortex_m: Consolidate bss/noinit sections for kernel/user mode
Userspace originally required bss to precede kobject_data, as
kobject_data size was not known until the final linking stage (#21747).

#33687 reserved space for kobject_data, allowing bss to now be after
kobject_data.

Placing bss/noinit at the end of the linker script reduces the size
of a "zephyr.bin" file, as the NOLOAD sections can be excluded. It
also keeps the code common between kernel/user mode

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2025-02-06 21:12:47 +01:00
Johann Fischer
2914174d27 doc: usb: minor fixes to improve consistency
Follow-up on newly introduced USB MIDI2 support.
Prefix with usbd_, use midi2 consistently.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-06 17:49:12 +01:00
Fabrice DJIATSA
a1bd7cf7b0 tests: drivers: adc: adc_api: update adc_api test
- add nucleo_c071rb overlay file to setup adc node

- The C0 serie has two HSI clock sources, HSI48 and HSI48USB.
To make it simpler and compatible with the existing clock driver,
HSI48 is renamed to HSI (node already present in the stm32c0.dtsi).
HSI48USB will correspond to HSI48.
With SYNC mode, we have an overrun on the ADC, so we configure it
in ASYNC mode.

- Update STM32 HSI macro according to changes

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Wajdi ELMuhtadi
03b075d35a drivers: sensor: wsen_pads_2511020213301: add sensor driver
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>
2025-02-06 07:45:13 +01:00
Hieu Nguyen
3a7ccecdcd drivers: pwm: Initial support for RZ/G3S
Add PWM driver support for Renesas RZ/G3S

Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Binh Nguyen <binh.nguyen.xw@renesas.com>
2025-02-05 17:49:00 +01:00
Jimmy Zheng
3804387350 arch: riscv: handle interrupt level for CLIC
CLIC supports mintstatus.MIL (RO) and mcause.MPIL (RW) for the current
interrupt level and the previous interrut level before a trap. Each ISR
must execute MRET to set mcause.MPIL back to mintstatus.MIL.

This commit introduces CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL to handle
mcause.MPIL for interrupt preemption in nested ISR, and uses
CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL to ensure ISR always switch out
with MRET.

e.g.
  With CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL=n, a context-switch in
  ISR may skip MRET in this flow:
  IRQ -> _isr_wrapper -> z_riscv_switch() -> retrun to arch_switch()

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-02-05 17:48:45 +01:00
Martin Hoff
6f1debe6e7 driver: dma: silabs: Add silabs_ldma_block_append function
This function allows to not restart DMA engine for driver that gives
new buffer to the DMA engine while a transfer is ongoing.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-05 15:02:35 +01:00
Martin Hoff
c901551825 driver: dma: silabs: Add signal binding to support P2M and M2P transfer
Improve the silabs ldma driver to support P2M and M2P transfer. It also
adds signal binding to support source request binding in the dts.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-05 15:02:35 +01:00
Emil Gydesen
28e188b56a Bluetooth: PACS: Add verification of bt_bap_pacs_register_param
Add verification of the parameter struct, so that it returns
-EINVAL if the values are invalid.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-05 14:57:30 +01:00
Emil Gydesen
72b94f0d05 usb: device_next: Document if callbacks are mandatory
Adds additional documentation to the callbacks of uac2_ops
to describe if/when they are mandatory to register.

Additionally add asserts before calling them to help debugging
if the user did not register the required ones.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-05 14:56:47 +01:00
Robert Lubos
b7cfa54c18 net: tc: Deprecate CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO
Since a separate CONFIG_NET_TC_RX_SKIP_FOR_HIGH_PRIO was introduced for
RX TC queues, CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO became ambiguous,
rename it to CONFIG_NET_TC_TX_SKIP_FOR_HIGH_PRIO and deprecate the old
config.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-05 12:37:01 +01:00
Jilay Pandya
8272b36b5b drivers: stepper: tmc50xx: extend tmc5041 to tmc50xx
Extend tmc5041 to tmc50xx in order to accomodate tmc5072

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-02-05 01:14:47 +01:00
Yong Cong Sin
f840a35be3 logging: log_cmds: init uninitialized backend on log_go()
For backends that do not autostart themselves, initialize
& enable them on `log backend <log_backend_*> go`, so
that they function properly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-02-04 15:00:58 +01:00
Emil Gydesen
f460510df5 Bluetooth: Audio: Spring cleanup for audio header files
Add missing and remove unused includes. Fix spelling mistakes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-04 12:03:04 +01:00
Jamie McCrae
f3e2e7dc06 mgmt: mcumgr: grp: img_mgmt: Add image number to confirmed callback
Adds the image number to the confirmed callback

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-04 11:56:31 +01:00
Vebjorn Myklebust
9d81b74ff1 drivers: pinctrl: Add support for cc23x0 pinctrl
Add support for pinctrl to cc23x0 SoC. Like for other TI SoCs,
a node approach is implemented (no grouping approach).

Signed-off-by: Lars Thalian Morstad <l-morstad@ti.com>
Signed-off-by: Vebjorn Myklebust <v.myklebust@ti.com>
Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Signed-off-by: Julien Panis <jpanis@baylibre.com>
2025-02-04 11:56:05 +01:00
Johann Fischer
8b0bdb563f usb: device_next: implement USB DFU class for the new device support
This new implementation is written from scratch and is not tied to the
image manager and MCUboot. It allows the user to define their own
backend and use a simple macro to instantiate an image. On the USB side
this is represented by an interface. The number of possible images is
configurable using the Kconfig option, and is a fairly inexpensive
approach since it only changes the size of the pointer array. The number
of images is only limited by the number of possible interfaces in a
configuration. The class implementation does not support multiple
instances, as there is no real use for it. However, it does provide two
class instances, one for runtime mode and one for DFU mode. The switch
from runtime to DFU mode can only be performed by the user application,
i.e. the application receives a notification when the host wants to
switch to DFU mode, and then the application can disable the runtime
configuration and enable the DFU configuration. This implementation does
not support switching to the DFU mode by bus reset issued by the
host.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-04 11:55:25 +01:00
Johann Fischer
3bfe163811 usb: device_next: implement blocklist for classes
In the usbd_register_all_classes(), we may need to skip some instances
as they may have very specific function like USB DFU "DFU mode" which
should not be available by default.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-04 11:55:25 +01:00
Fabio Baltieri
e060e4cdd2 device: add a DEVICE_DT_GET_BY_IDX macro
Add a DEVICE_DT_GET_BY_IDX macro to get a struct device reference for a
phandles node. This can be used directly as an argument of macros such
as DT_INST_FOREACH_PROP_ELEM_SEP.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-02-04 09:18:55 +01:00
Aksel Skauge Mellbye
2fa5b00971 dt-bindings: adc: Add bindings for Silabs Series 2
Add macros for use in devicetree to configure IADC on Silabs
Series 2 devices.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-02-03 19:51:46 +01:00
Lyle Zhu
790006f875 Bluetooth: L2CAP_BR: Support dynamic PSM allocation
In the function `bt_l2cap_br_server_register()`, the PSM cannot be
dynamic allocated. And only pre-set PSM is supported.

Improve the function `bt_l2cap_br_server_register()` to support the
dynamic PSM allocation if the passed PSM is zero.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-02-03 19:50:56 +01:00
Audun Korneliussen
7fd3472231 drivers: mfd: npm2100: Add hibernate_pt mode support
Extend mfd_npm2100_hibernate function with pass_through argument,
which is used to differentiate between hibernate and hibernate_pt
modes.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2025-02-03 14:03:00 +01:00
Christian Galante
78163b9717 include: zephyr: dt-bindings: comparator: silabs: generate acmp
Generates bindings that define acmp inputs. These bindings can be
used in devicetree sources to configure the acmp's
input-positive and input-negative properties. Depending on the
part, some inputs may not be available as positive and/or
negative inputs to the ACMP, therefore always reference your
part's design book when selecting these inputs.

Signed-off-by: Christian Galante <christian.galante@silabs.com>
2025-02-03 11:16:57 +01:00
Chris Friedt
f4259c384f posix: options: add xsi realtime option group
Add a POSIX Option Group called XSI_REALTIME (with Kconfig
option CONFIG_XSI_REALTIME).

When XSI_REALTIME is selected (or when required POSIX Options
are enabled), define _XOPEN_REALTIME to be something other
than -1 (_XOPEN_VERSION seemed appropriate).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-02-03 09:05:09 +01:00
Martí Bolívar
73903389bf devicetree: document limitations related to for-each macros
Document a C preprocessor limitation that prevents "nested" use of
for-each style devicetree macros in the way users sometimes expect.

Put this in the devicetree.h header where it will show up in the
detailed doxygen description in our HTML documentation, in addition to
being in the sources themselves for people who prefer to look for
docstrings there.

Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
2025-02-01 00:26:38 +01:00
Titouan Christophe
c525e7a0a5 usb: device_next: add new MIDI 2.0 device class
This adds a new USB device class (based on usb/device_next) that implements
revision 2.0 of the MIDIStreaming interface, a sub-class of the USB audio
device class. In practice, the MIDI interface is much more simple and has
little in common with Audio, so it makes sense to have it as a separate
class driver.

MIDI inputs and outputs are configured through the device tree, under a
node `compatible = "zephyr,usb-midi"`. As per the USB-MIDI2.0 spec,
a single usb-midi interface can convey up to 16 Universal MIDI groups,
comprising 16 channels each. Data is carried from/to the host via
so-called Group Terminals, that are organized in Group Terminal Blocks.
They are represented as children of the usb-midi interface in the device
tree.

From the Zephyr application programmer perspective, MIDI data is exchanged
with the host through the device associated with the `zephyr,usb-midi`
interface, using the following API:

* Send a Universal MIDI Packet to the host: `usb_midi_send(device, pkt)`
* Universal MIDI Packets from the host are delivered to the function passed
  in `usb_midi_set_ops(device, &{.rx_packet_cb = handler})`

Compliant USB-MIDI 2.0 devices are required to expose a USB-MIDI1.0
interface as alt setting 0, and the 2.0 interface on alt setting 1.
To avoid the extra complexity of generating backward compatible USB
descriptors and translating Universal MIDI Packets from/to the old
USB-MIDI1.0 format, this driver generates an empty MIDI1.0 interface
(without any input/output); and therefore will only be able to exchange
MIDI data when the host has explicitely enabled MIDI2.0 (alt setting 1).

This implementation is based on the following documents, which are referred
to in the inline comments:

* `midi20`:
    Universal Serial Bus Device Class Definition for MIDI Devices
    Release 2.0
    https://www.usb.org/sites/default/files/USB%20MIDI%20v2_0.pdf
* `ump112`:
    Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol
      With MIDI 1.0 Protocol in UMP Format
    Document Version 1.1.2
    https://midi.org/universal-midi-packet-ump-and-midi-2-0-protocol-specification

Signed-off-by: Titouan Christophe <moiandme@gmail.com>
2025-01-31 19:50:26 +01:00
Jamie McCrae
f19e5bc577 mgmt: mcumgr: mgmt: callbacks: Align doxygen links
Aligns doxygen links to have the same style for all in the file.
Also adds some missed links

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-31 16:16:08 +01:00
Jukka Rissanen
9c24578cc4 net: vlan: Allow VLAN count to be set to 0
If VLAN count is set to 0, then only priority tagged VLAN frames
that have tag value 0 can be received. Also this means that VLAN
interfaces are not created which can save memory if you do not need
to receive any other VLAN frames than those tagged with value 0.

Fixes #84023

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-01-31 16:12:50 +01:00
Francois Ramu
e9cd558dbf include: clock control fix pll i2s for stm32f411 serie
The compatible st_stm32f412_plli2s_clock has been replaced
by the st_stm32f411_plli2s_clock

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2025-01-31 16:12:03 +01:00
Cla Mattia Galliard
034ec2405d net: core: document the return value of the l3-handler
Give a more detailed explanation of the expectations towards a handler
registered with the NET_L3_REGISTER-facilities.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-01-31 16:09:47 +01:00
Cla Mattia Galliard
bb3ac84bce net: tc: Add a skip for rx-queues
Add a configuration option to skip the rx-queues for high priority packets
analogously to the tx-side.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-01-31 11:49:50 +01:00
Terry Geng
cbcb2d8f12 drivers: adc: ads1x4s0x: Rename files, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Terry Geng
43079c8086 drivers: adc: ads114s0x: Rename variables, preparing for adding new devices
Renamed ads114s0x/8 to ads1x4s0x.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-01-31 09:39:07 +01:00
Yasin Ustuner
a4b5635930 include: dt-bindings: Add AD7124 analog inputs
This commit adds analog inputs for AD7124 ADC.

Signed-off-by: Yasin Ustuner <Yasin.Ustuner@analog.com>
2025-01-30 20:33:10 +01:00
Cla Mattia Galliard
ed1ebb337d net: tc: Add statistics about dropped packets
Add statistics about packets dropped in net_tc.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-01-30 20:27:33 +01:00