Commit graph

15409 commits

Author SHA1 Message Date
Jilay Pandya
6d87bd65ae drivers: stepper: fix fake stepper controller cid issues
Fix: Write to const-qualified field. (WRITE_CONST_FIELD)
- #81915, #81920, #81922, #81924, #81932, #81940, #81941
- #81946, #81947, #81959, #81961, #81970, #81973, #81977

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-26 10:37:35 +00:00
Ivan Iushkov
75fc0a0776 Bluetooth: Host: deprecate bt_le_set_auto_conn()
bt_le_set_auto_conn() function is not working as
expected. Also, it doesn't have any test coverage
and any usage in sample applications.
The function is deprecated
Fixes #81597

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-11-26 10:37:12 +00:00
Andries Kruithof
bb3bab7a34 Bluetooth: Audio: implement the distribute broadcast code procedure
Implemenation of the distribute broadcast code CAP procedure, as well
as unittesting

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-11-25 21:52:53 +01:00
Alvis Sun
f517929a11 include: i3c: npcx: remove unnecessary soc functions.
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-11-25 17:43:41 +01:00
Alvis Sun
bb03d1a472 include: i3c: target_device: add target driver buffer mode
As title.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-11-25 17:43:41 +01:00
Chaitanya Tata
139ce48c8b nrf_wifi: Fix the directory name
Following the naming convention add an underscore and update path in the
maintainers file too.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-25 17:43:34 +01:00
Ryan McClelland
1e47b6a2b9 kernel: fix K_SEM_DEFINE type-limits warning
A warning could be generated when compiling with -Wtype-limits. This
works around the warning which could happen if initial_count is 0 and
count_limit is K_SEM_MAX_LIMIT.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-25 14:41:51 +01:00
Emil Gydesen
b535f18240 Bluetooth: Audio: Fix incorrect ret doc for cfg_meta_get_lang
The function does not return the language, but rather stores
the lang in the provided lang param.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-25 14:41:21 +01:00
Jeppe Odgaard
c9dc58178a drivers: adc: adc_ad559x: implement double range option
Optionally write to ad559x register bit which increases ADC input range
from 0V to 2 x Vref.

Create an ADC API per instance since the double range option and thus
`ref_internal` is instance specific.

The functionality has been tested via double range DAC and wiring IO1 and
IO3:
```
$ dac setup ad5593dac 1 12
$ adc ad5593adc resolution 12
$ adc ad5593adc channel id 3
$ dac write_value ad5593dac 1 0
$ adc ad5593adc read 3
read: 1
$ dac write_value ad5593dac 1 1024
$ adc ad5593adc read 3
read: 1021
$ dac write_value ad5593dac 1 2048
$ adc ad5593adc read 3
read: 2044
$ dac write_value ad5593dac 1 3072
$ adc ad5593adc read 3
read: 3069
$ dac write_value ad5593dac 1 4095
$ adc ad5593adc read 3
read: 4091
```

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Jeppe Odgaard
c6aafd7eb5 drivers: dac: ad559x: implement double range option
Optionally write to ad559x register bit which increases DAC output range
from 0V to 2 x Vref.

The functionality has been tested on AD5593r.
The voltage at 4095 has been measured to 5.01 volts.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Jeppe Odgaard
8933e6cefa drivers: ad559x: fix mfd_ad559x_i2c_read_reg
Reading a register requires 0x70 to be ORed with the register address.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-11-25 12:17:00 +01:00
Yong Cong Sin
b1def7145f arch: deprecate _current
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Yong Cong Sin
1a752e8a35 arch: riscv: implement ARCH_HAS_CUSTOM_CURRENT_IMPL with GP
Implement `arch_curr_thread()` & `arch_set_curr_thread()`
with the global pointer (GP) register.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Yong Cong Sin
d26c712258 arch: add new interfaces to set/get the current thread of current CPU
Add the following arch-specific APIs:
- arch_curr_thread()
- arch_set_curr_thread()

which allow SMP architectures to implement a faster "get current
thread pointer" than the default provided by the kernel. The 'set'
function is required for the 'get' to work, more on that later.

When `CONFIG_ARCH_HAS_CUSTOM_CURRENT_IMPL` is selected, calls to
`_current` & `k_sched_current_thread_query()` will be redirected to
`arch_curr_thread()`, which ideally should translate into a single
instruction read, avoiding the current
"lock > read CPU > read current thread > unlock" path in SMP
architectures and thus greatly improves the read performance.

However, since the kernel relies on a copy of the "current thread"s on
every CPU for certain operations (i.e. to compare the priority of the
currently scheduled thread on another CPU to determine if IPI should be
sent), we can't eliminate the copy of "current thread" (`current`) from
the `struct _cpu` and therefore the kernel now has to invoke
`arch_set_curr_thread()` in addition to what it has been doing. This
means that it will take slightly longer (most likely one instruction
write) to change the current thread pointer on the current
CPU.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Ilya Tagunov
80a9b12a50 include: posix: remove an unreachable clockid_t definition
The clockid_t definition in question is not reachable anymore
because at least one of _CLOCKID_T_DECLARED and __clockid_t_defined
macros is already defined by that point, always making the check fail.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Ilya Tagunov
390a7f8950 lib: libc: arcmwdt: move ssize_t definition from the toolchain header
Until POSIX layer decoupling is done, we still need the size_t type
definition across the codebase, but it should come through sys/types.h
and not through toolchain-specific headers.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-23 20:12:02 -05:00
Dominik Ermel
13fa2331da drivers/flash: Flash API: device size getter
The commit adds flash_get_size  API functions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-23 15:30:10 +01:00
Daniel DeGrasse
c565c2c6f6 drivers: mipi-dbi: use string for mipi-mode property
Use a string for the mipi-mode property over an integer value, as this
significantly improves the readability of the MIPI DBI device binding.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-23 02:01:47 +01:00
TOKITA Hiroshi
2e66ce193c include: dt-bindings: misc: nordic: Fix include-guard
The implementation of include-guard is incomplete, so I fixed it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-22 22:47:30 +00:00
Joakim Andersson
2fe54b4476 include: gpio: Add isr_ok to interrupt configure API
Add isr_ok property to the interrupt configure API.
For level-triggered interrupt the interrupt may have to be disabled
until a thread context can process it and clear the interrupt trigger.

The function is documented as returning an error if it would block.
Drivers in zephyr already do this, so if this is not ISR safe function
then they need to be fixed.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-11-22 22:47:07 +00:00
Rex Chen
b4035e83d4 net: wifi: shell: add enterprise support for sap
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb
support for sap.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-11-22 13:03:53 -06:00
Daniel DeGrasse
42cc35f941 soc: nxp: consolidate nxp port pinctrl headers
NXP PORT IP instantiations often have different features absent, IE
input buffer, open drain, or slew rate support. Check if the relevant
PCR register bitmasks are defined in the common pin control file, and
define the bitmasks to 0x0 (no effect) if they are not. This allows us
to further consolidate the pinctrl_soc.h headers for SOCs using the PORT
IP.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-22 13:01:02 -06:00
Maochen Wang
13f473d7eb hostap: add WPS PBC and PIN for AP mode
add WPS PBC and PIN for AP mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-22 17:44:08 +01:00
Jukka Rissanen
b0b20229b0 net: sockets: Add support for IP_LOCAL_PORT_RANGE socket option.
Add support for IP_LOCAL_PORT_RANGE socket option. The option
supports both IPv4 and IPv6 sockets although the type is IPPROTO_IP.

The option can be used to enforce the ephemeral port number selection
to be in certain range.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-22 17:42:08 +01:00
Johan Hedberg
30d1d0e526 Bluetooth: Host: Remove deprecated HCI driver API
Remove the deprecated HCI driver API which was provided by the hci_driver.h
header file. The deprecation happened in Zephyr 3.7, so the API can now be
removed for Zephyr 4.1.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-22 11:37:12 +01:00
Yong Cong Sin
45ebd390cf arch: riscv: reg: include required header
Include `zephyr/sys/util.h` for the `STRINGIFY()` macro.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-22 11:32:22 +01:00
Seppo Takalo
bc4f026ea9 net: lib: coap_client: Const pointers in request
CoAP client does not modify any of the members, so
change all pointers to const.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-21 14:47:38 +01:00
Pierrick Guillaume
f716973785 init: fix soc and board hooks doxygen comments
Documentation for *init_hooks were not generated on doc website.
This was due to ill-formed doc-strings for those hooks.

Signed-off-by: Pierrick Guillaume <pierguill@gmail.com>
2024-11-21 11:02:07 +00:00
Tarang Raval
31eee15fcd dts: arm: rpi_pico: remove #define from dts
Removing direct #define usage in the DTSI file and converting these
definitions to use a dt-bindings header instead.

Relocates the RPI_PICO_DEFAULT_IRQ_PRIORITY definition to a DTSI file and
introduces an override.dtsi file. The override file is used when no other
override file is present, allowing for better flexibility and compliance
with Zephyr’s DTS structure.

Fixes: #79719

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-20 15:59:03 -05:00
James Roy
aeaf32aada stm32: Fix wrong binding target for RTC_SEL in stm32u0
Change the stm32u0 clock from CSR_REG to BDCR_REG.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-20 15:57:52 -05:00
Chaitanya Tata
c5585af4c4 wifi: Add units to listen interval
Listen interval as per 802.11 has units as "beacon intervals" i.e., 1
means 1 beacon interval duration (or short beacon interval duration if
short beacon is enabled).

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-20 15:57:06 -05:00
Noemie Gillet
2253a26c10 drivers: nsos: support for AF_PACKET
Handle AF_PACKET family.

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-20 08:24:08 -05:00
Noemie Gillet
10bb61ee7d drivers: nsos: support for AF_UNIX
Handle AF_UNIX family sockets for NSOS offloaded driver
Note that the size of struct sockaddr_un is done conditionnaly based on
CONFIG_NET_NATIVE_OFFLOADED_SOCKETS
Also, NET_SOCKADDR_PTR_MAX_SIZE needs to be updated only if
CONFIG_NET_SOCKETS_PACKET is not set. Otherwise, for a AF_PACKET socket,
a struct net_context variable can be corrupted, as local would have be on
16 bytes instead of 20 bytes.

Signed-off-by: Noemie Gillet <ngillet@sequans.com>
2024-11-20 08:24:08 -05:00
Andi Gerl
9c2421444b net: lwm2m: add set_socketoptions cb to pull context LwM2M context
The pull context LwM2M client's set_socketoptions callback is currently
unused and can't be set by a user. Add a public API to set the
pull context's client's set_socketoptions callback.

Signed-off-by: Andi Gerl <andi.gerl@exacttechnology.com>
2024-11-20 08:23:44 -05:00
TOKITA Hiroshi
43db55a79b drivers: clock_contrl: Remove renesas,ra-clock-generation-circuit driver
Remove the renesas,ra-clock-generation-circuit driver, which is no longer
needed after migrating to the FSP-based implementation.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
TOKITA Hiroshi
f0219c35da drivers: pinctrl: Remove renesas,ra-pinctrl driver
Remove the renesas,ra-pinctrl driver, which is no longer
needed after migrating to the FSP-based implementation.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-20 10:14:41 +00:00
Anas Nashif
3364a35f05 Revert "irq: multilevel: compile 3rd level IRQ APIs only when enabled"
This reverts commit 2152b8e414.

This commit is breaking CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-19 22:40:13 -05:00
Jordan Yates
b8360ad5ee sys_clock: extra time defines
Add additional time defines to round out the `SEC_PER_*` family.
These are easier to type than `SEC_PER_MIN * MIN_PER_HOUR` and
`SEC_PER_MIN * MIN_PER_HOUR * HOUR_PER_DAY`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-19 20:05:08 -05:00
Yong Cong Sin
2152b8e414 irq: multilevel: compile 3rd level IRQ APIs only when enabled
This revert the idea of 3fa7d78 from #78845.

The 3rd level IRQ APIs won't compile when
CONFIG_3RD_LEVEL_INTERRUPT_BITS=0.

Updated testcase accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-19 20:04:32 -05:00
Sergei Ovchinnikov
55c6a0eaa5 drivers: sensor: npm1300_charger: expose VBUS status
Add possibility to retrieve VBUS status of the nPM1300 charger through
its sensor APIs. Updated shields/npm1300_ek sample to use the new API.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2024-11-19 17:51:13 -05:00
Johann Fischer
6ee1358519 usb: device_next: support BOS descriptor with vendor request code
Platform capability descriptors such as MSOSv2 or WebUSB BOS have a
vendor request code that is used by the host to perform vendor-specific
requests. Add a convenient way to define and register a platform
capability descriptor with a vendor request node.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-19 09:53:29 -05:00
Johann Fischer
34f42d6c71 usb: device_next: support vendor request with recipient device
Allow the user to register a vendor request node identified by the
vendor code (bRequest) and containing two callbacks to handle the vendor
request. The device stack uses the vendor request node to call the
vendor request callbacks when it receives a request of type Vendor,
recipient Device, and bRequest value equal to the vendor code.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-11-19 09:53:29 -05:00
Jilay Pandya
6098b2f673 drivers: stepper: tmc5041: use tmc5xxx generalized macros
This commit refactors tmc5041 driver to use tmc5xxx generalized macros

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-19 09:49:53 -05:00
Jan Faeh
2efc8598e3 drivers: sensor: SCD4x Add driver
This adds support for Sensirion's SCD4x co2 sensor.

Signed-off-by: Jan Faeh <jan.faeh@sensirion.com>
2024-11-18 19:38:10 -05:00
Jilay Pandya
195c2c1360 drivers: stepper: fix stepper_set_event_callback c prototype and definition
This commit fixes incorrect c prototype and defintion of
stepper_set_callback to stepper_set_event_callback

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-18 19:37:37 -05:00
TOKITA Hiroshi
2bb0a504a7 include: dt-bindings: gecko: Correct include-guard
Both `include/zephyr/dt-bindings/pinctrl/gecko-pinctrl.h` and
`include/zephyr/dt-bindings/pinctrl/gecko-pinctrl-s1.h` define
`ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_H_`
to prevent duplicate inclusion.

Changed it to `ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_GECKO_PINCTRL_S1_H_`
in `include/zephyr/dt-bindings/pinctrl/gecko-pinctrl-s1.h` side.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-18 19:30:41 -05:00
TOKITA Hiroshi
c144ebf723 include: intertupt_controller: esp32: Correct include-guard
Both `include/zephyr/drivers/interrupt_controller/intc_esp32.h` and
`include/zephyr/drivers/interrupt_controller/intc_esp32c3.h`
define `ZEPHYR_INCLUDE_DRIVERS_ESP_INTR_ALLOC_H__` to prevent
duplicate inclusion, so it cannot be properly prevented.

Change to a file path name-based definition.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-18 19:30:41 -05:00
TOKITA Hiroshi
3f870b316f include: dma: smartbond: Correct include-guard
Both `include/zephyr/drivers/dma/dma_smartbond.h` and
`include/zephyr/dt-bindings/dma/dma_smartbond.h` define `DMA_SMARTBOND_H_`
to prevent duplicate inclusion, so it cannot be properly prevented.

Change to a file path name-based definition.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-18 19:30:41 -05:00
Jukka Rissanen
d3bac7047d net: socket: Add support for IP_MULTICAST_IF option
Allow user to set the network interface for multicast sockets
of type SOCK_DGRAM.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00
Jukka Rissanen
96d4f84a52 net: socket: Add support for IPV6_MULTICAST_IF option
Allow user to set the network interface for multicast sockets
of type SOCK_DGRAM.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-18 19:29:58 -05:00