Commit graph

15409 commits

Author SHA1 Message Date
Jakub Michalski
191d38dee8 posix: define POLLPRI in posix/poll.h
Add the POLLPRI constant defined by POSIX and test for it.

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2024-12-07 14:17:11 +01:00
Jakub Michalski
f4cb7e35ec posix: define nfds_t in posix/poll.h
Add the nfds_t type defined by POSIX and test for it.

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2024-12-07 14:17:11 +01:00
Phi Bang Nguyen
0a9016731f include: devicetree: Add port and endpoint macro header
Add port and endpoint DT macros to retrieve the node id of the interested
port/endpoint from its id. Also, add helpers to retrieve the peer remote
device node from its local endpoint interface.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Co-developed-by: Josuah Demangeon <me@josuah.net>
2024-12-06 22:23:31 +01:00
Dane Wagner
c4e840af56 drivers: spi: Call correct SPI device definition macros
If CONFIG_SPI_STATS is enabled, the device state for all SPI controller
drivers must contain the SPI stats. This space is allocated by calling
Z_SPI_INIT_FN as part of the device definition; this is done automatically
when using SPI_DEVICE_DT_DEFINE instead of DEVICE_DT_DEFINE. If space for
statistics is not properly allocated but CONFIG_SPI_STATS is enabled, an
unexpected write to memory outside of the stats region may occur on a SPI
transfer. This commit uses SPI_DEVICE_DT_DEFINE or
SPI_DEVICE_DT_INST_DEFINE for all in-tree SPI controller drivers.

Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
2024-12-06 22:23:20 +01:00
Manuel Argüelles
87798f9e16 arch: arm: rename CPU_HAS_NXP_MPU to align with binding
Following the binding rename to "nxp,sysmpu", update the Kconfig
option to align with the binding name and to better reflect the
option's purpose.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-12-06 22:23:06 +01:00
Jilay Pandya
030444822e drivers: stepper: api: rename stepper_set_target_pos to stepper_move_to
rename stepper_set_target_position to stepper_move_to in following files:
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- tests/drivers/stepper/shell/src/main.c
- tests/drivers/stepper/stepper_api/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-06 22:21:44 +01:00
Jilay Pandya
05e94ed234 drivers: stepper: api: rename stepper_move to stepper_move_by
rename stepper_move to stepper_move_by in following files:
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- tests/drivers/stepper/shell/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-06 22:21:44 +01:00
Emil Gydesen
829519dd6f Bluetooth: BAP: Add broadcast sink callback structs
These callbacks are trigger for changes that affect the entire
broadcast sink, such as the BIG synced and terminated events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Emil Gydesen
0ae976166f Bluetooth: CAP: Add broadcast source callback structs
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Emil Gydesen
ab9ee0817d Bluetooth: BAP: Add broadcast source callback structs
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Emil Gydesen
e8bcb29f3f Bluetooth: ISO: Add BIG callbacks
Add callbacks that is called for the entire BIG.
The BIG state is from an HCI perspective a single state change
that we previously only propagated as a state change for each
channel.

However it may be simpler for applications and higher layers
to use BIG changes to trigger their behavior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Lyle Zhu
a047113556 Bluetooth: Classic: SDP: Improve SDP discover
Extend the function `bt_sdp_discover` to support service search
transaction and service attribute transaction.

Improve the `session->rec_buf`. If the net buffer cannot be allocated
from the channel, disconnect the SDP session.

Set the `MaximumAttributeByteCount` of the request
`SDP_SERVICE_SEARCH_ATTR_REQ` with the tail room of `session->rec_buf`.

Set the `MaximumAttributeByteCount` of the request `SDP_SERVICE_ATTR_REQ`
with the tail room of `session->rec_buf`.

Set the `MaximumServiceRecordCount` of the request
`SDP_SERVICE_SEARCH_REQ` according to the tail room of
`session->rec_buf`.

Handle the response code `SDP_SERVICE_SEARCH_RSP`, and
`SDP_SERVICE_ATTR_RSP`.

Handle the error `SDP_ERROR_RSP`. Start the next SDP discovery if the
error received.

If there no more request, disconnect the session.

If the request cannot be sent, start the next SDP discovery.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-12-06 12:14:29 +01:00
Nicolas Pitre
303c674b41 arch: riscv: restore previous arch_current_thread_set() code generation
Commit 132fa83ed4 ("arch: riscv: make arch_current_thread_set()
safer") created some unintended code generation changes. Reorder the
assignments to preserve original results.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-12-06 06:50:43 +01:00
Josuah Demangeon
46a262ffe6 drivers: video: common: Add utilities to seek frmival/caps structures
Introduce a video_get_format_index() utility to help finding a caps
entry out of a given format. Introduce several utilities to seek and
apply frame intervals.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-12-05 20:00:21 -05:00
Francois Ramu
a103d63b8f include: binding defines division factor for stm32 MCO prescaler
Depending on the stm32 serie the MCO1/2 prescaler is a value
set in the CFGR register to divide the MCO output clock.
Use the same model based on the RefMan for other stm32 series
than stm32C0/F4/F7/H5/H7, once the MCO is in the DTS.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-05 19:59:47 -05:00
Francois Ramu
8d6d7baf98 include: bindings: high speed clock for the stm32F1/F4 series
The stm32F4 serie has HSI and HSE clock possible clock sources
The stm32F1 also has an external HSE possible clock source

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-05 19:59:47 -05:00
Trung Hieu Le
64ce567f5d include: zephyr: sys: util: Add type check for macro DIV_ROUND_CLOSEST
Add type check to avoid comparing unsigned values with 0 which is always
true or false and can cause coverity issue.

Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
2024-12-05 19:59:07 -05:00
TOKITA Hiroshi
624e051372 linker: devicetree_regions: Add support memory region flag setting
Add `zephyr,memory-region-flags` for supporting memory region flags
setting.

For example, when the below node is in the devicetree,

```
    test_sram: sram@20010000 {
        compatible = "zephyr,memory-region", "mmio-sram";
        reg = < 0x20010000 0x1000 >;
        zephyr,memory-region = "FOOBAR";
        zephyr,memory-region-flags = "rw";
    };
```

We get the following line in MEMORY section of linker script.

```
FOOBAR (rw) : ORIGIN = (0x20010000), LENGTH = (0x1000)
```

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-05 06:39:46 -05:00
Olivier Lesage
3feb1378d6 bluetooth: host: simplify enums for SNR control
It works the same on both sides, so there's no point having two of
these.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-12-05 12:30:09 +01:00
Andrew Featherstone
36613aa359 dts: arm: rp2040: Improve naming of included files
Rename rpi_pico_common.dtsi to rp2040_reset.h . This is more consistent
with the wider Zephyr source tree, and is foundation work ahead of
introducing the RP2350 SoC.

Add missing include guard. This shouldn't be required, but it is
consistent with other header files in the same directory.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2024-12-05 12:29:33 +01:00
Ilya Tagunov
97095c6fc4 linker: arc: add ARC-specific debug sections
ARC architecture has some additional .arcextmap debug sections used by
debuggers to understand extension-specific instructions. These sections
could safely be ignored, but doing this causes warnings at least with
ARC MWDT toolchain.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-12-05 09:41:40 +01:00
TOKITA Hiroshi
0161dd0938 drivers: gpio: Add support for Awinic AW9523B GPIO controller
Add support for GPIO controller feature of AW9523B.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Benjamin Cabé <kartben@gmail.com>
2024-12-05 07:44:58 +01:00
Audun Korneliussen
439d3b2973 drivers: sensor: npm2100: Add driver for npm2100 pmic
Add sensor driver for npm2100 pmic.

This pmic performs measurements of battery voltage, regulator voltage
and die temperature.

Configurable pmic attributes are also organized under this driver.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Audun Korneliussen
f4443617d8 drivers: regulator: npm2100: Add driver for npm2100 pmic
Add regulator driver for npm2100 pmic.
This pmic has one boost and one ldo regulator.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Audun Korneliussen
7fccb646cd drivers: gpio: npm2100: Add driver for npm2100 pmic
Add gpio driver for npm2100 pmic.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Audun Korneliussen
506dfc815a drivers: mfd: npm2100: Add npm2100 mfd driver
Add mfd driver for the npm2100 pmic device.
The driver contains basic initialization routines,
and functionality not covered by other device driver APIs.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Daniel Leung
42b209f816 xtensa: optimize syscall helper functions
The original idea of the syscall helpers is to workaround
an issue where the compiler could not correctly model register
usage with inline functions. It was supposed to be only used
when there are more then 3 arguments to syscalls. However,
during the original MMU code development, the helper got
expanded to cover "less then 2 arguments syscalls" as a way
for debugging syscall handling code and was never removed.
So fix that now by limiting the helper for syscalls with
more than 3 arguments.

Moreover, instead of using one helper with 6 arguments, now
we have separate implementations for both 4 and 5 arguments
syscall helpers. Now the compiler does not have to generate
code to always handle 6 arguments which saves a few code bytes
as there is no need to pass extra zeroes as arguments.

This has been verified to work with xt-clang RI-2022.10.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-12-04 14:16:15 -05:00
Bansidhar P.M
0aeb81d6b5 drivers: nrf_wifi: Restructure to carve out a new nrf70 bus lib
The nrf wifi drivers include code related to qspi/spi bus. This work
moves bus related files to a new nrf70 bus library which is now
independent of the core driver and facilitlates building applications
directly using the bus APIs, agnostic to enabling wifi configs.

Signed-off-by: Bansidhar P.M <bansidhar.mangalwedhekar@nordicsemi.no>
2024-12-04 14:15:13 -05:00
Matt Rodgers
ddaeb1379a net: http_server: fix header capture on concurrent http2 streams
Concurrent HTTP POST requests on different HTTP2 concurrent streams
require that the client's header_capture_context is re-used to capture
headers on a second stream before all of the body data has been received
(and sent to the application) on the first stream.

As a result, any captured headers must be sent to the application
callback before any headers can be received on a different stream. In
practice this means that for HTTP2 the application callback is called
for the first time on receiving a headers frame, before any data frames
are received. All subsequent application callbacks will not include the
request header data.

While this mechanism is not necessary for HTTP1, it is also updated to
only send headers in the first application callback for consistency.

Fixes #82273

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-12-04 14:13:24 -05:00
Matt Rodgers
f050e0bdb1 net: http_server: store current resource detail at an http2 stream level
To correctly handle concurrent HTTP POST requests via different http2
streams on the same client context, it is necessary to store the
resource detail at an HTTP2 stream level rather than at an HTTP client
level, otherwise only one resource detail can be stored.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-12-04 14:13:24 -05:00
Alexander Lay
8f2dd90088 tracing: add gpio tracing support
If GPIO tracing is enabled, then the system will track
various GPIO pin events.

Signed-off-by: Alexander Lay <alexanderlay@tenstorrent.com>
Signed-off-by: Yang Xu <yangxu@tenstorrent.com>
2024-12-04 14:12:58 -05:00
Alexander Lay
ec407506b9 drivers: gpio: fix comment typo
Add missing closing brace and semicolon to code comment

Signed-off-by: Alexander Lay <alexanderlay@tenstorrent.com>
Signed-off-by: Yang Xu <yangxu@tenstorrent.com>
2024-12-04 14:12:58 -05:00
Dawid Niedzwiecki
c270f8bd20 include/devicetree: dma: add DT_DMAS_CELL_BY_NAME_OR macro
Add the DT_DMAS_CELL_BY_NAME_OR macro. It is almost the same as
DT_DMAS_CELL_BY_NAME, but it uses DT_PHA_BY_NAME_OR instead of
DT_PHA_BY_NAME.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-12-04 16:11:54 +01:00
Kai Vehmanen
e60f04096c toolchain: xcc: fix build with non-clang xcc versions
toolchain/xcc.h includes toolchain/gcc.h in some configurations
and this will lead to build errors as __in_section_unique_named()
and friends are defined multiple times.

Add ifdef guards to main definitions in gcc.h.

Fixes: 7e32b2069d ("toolchain: xcc: Avoid undefs")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-12-04 06:30:48 -05:00
Stine Akredalen
6c0306622e Bluetooth: fix GATT service reregistering
* Fixed issue with reregistering of GATT services.
* Added unit tests covering the GATT reregistering scenario.

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2024-12-04 12:10:22 +01:00
Hui Bai
ae7613b2c9 wifi: add hidden SSID configuration support for SoftAP
Added hidden ssid support configuration for AP mode.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-12-04 12:09:59 +01:00
Jukka Rissanen
abad505bde net: sockets: Remove deperecated CONFIG_NET_SOCKETS_POSIX_NAMES
The deprecated CONFIG_NET_SOCKETS_POSIX_NAMES option is removed.
If one wishes to use POSIX API socket calls, then CONFIG_POSIX_API
option needs to be enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-04 12:09:51 +01:00
Jilay Pandya
af68d97507 drivers: stepper: api: rename enable_constant_velocity_mode to run
rename enable_constant_velocity_mode to run in following files:
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- tests/drivers/stepper/shell/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-04 09:24:05 +01:00
Henrik Brix Andersen
a619fe74a9 drivers: can: remove the deprecated can_calc_prescaler() API function
Remove the deprecated can_calc_prescaler() CAN API function.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-12-04 02:02:40 +01:00
Henrik Brix Andersen
424988b908 drivers: can: remove deprecated min/max bitrate functions
Remove the deprecated can_get_min_bitrate() (replaced by
can_get_bitrate_min()) and can_get_max_bitrate() (replaced by
can_get_bitrate_max()) CAN API functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-12-04 02:02:40 +01:00
Henrik Brix Andersen
f3772eb854 drivers: can: remove deprecated CAN_MAX_STD_ID and CAN_MAX_EXT_ID macros
Remove the deprecated CAN_MAX_STD_ID (replaced by CAN_STD_ID_MASK) and
CAN_MAX_EXT_ID (replaced by CAN_EXT_ID_MASK) macros.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-12-04 02:02:40 +01:00
Nicolas Pitre
132fa83ed4 arch: riscv: make arch_current_thread_set() safer
Use the "do { } while (0)" construct so the macro behaves like an actual
C statement in all cases. Also evaluate the macro argument only once.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-12-03 23:29:33 +00:00
Jeppe Odgaard
c41570871b drivers: sensor: tmp116: support set sample frequency
Add support for setting the sample frequency via `attr_set` and the
output data rate from device tree source.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-12-03 19:57:06 +01:00
Tim Lin
788bca2ea8 drivers: gpio: it8801: Add I2C-based GPIO device driver
Add I2C-based GPIO device driver. Supports 16-port GPIO divided
into 3 groups.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-12-03 19:56:50 +01:00
Tim Lin
70739a1e74 drivers: mfd: it8801_altctrl: Add alternate controller for MFD
IT8801 support GPIO alternate function switching.
Some GPIO pins can be switched as KSO or PWM function.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-12-03 19:56:50 +01:00
Tim Lin
3de8989852 drivers: mfd: it8801: Initialize IT8801 multi-function device drivers
The IT8801 is an I/O expander that provides GPIO, PWM, Keyboard
functions via the I2C bus.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-12-03 19:56:50 +01:00
ZhongYao Luo
b07f940ba5 input: Fix missing INPUT_ when aliasing buttons
The aliases defined by INPUT_BTN_A/B/X/Y are
missing the INPUT_ prefix.

Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
2024-12-03 13:06:10 +01:00
Bjarki Arge Andreasen
84532b24e5 drivers: RTC: update API to use DEVICE_API macros
Update RTC API and device drivers to use DEVICE_API macros.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-03 10:40:18 +01:00
Zihao Gao
17897071c1 Bluetooth: AVRCP: implementation for subunit info command.
This patch alllows to acquire the subunit info from the remote device.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-12-03 10:17:09 +01:00
Bjarki Arge Andreasen
957ece8bc2 drivers: comparator: update API to use DEIVCE_API macros
Update comparator API and device drivers to use DEVICE_API macros.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-02 22:06:32 +00:00