Commit graph

15409 commits

Author SHA1 Message Date
Benjamin Cabé
7e2005b861 usb: audio: doc: Cleanup Doxygen documentation
Cleaned up various improperly documented elements in the
usb_audio.h file.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-11 19:54:41 +02:00
Keith Short
c9f822df27 gpio: nct38xx: Remove reg access wrappers
Remove the register access wrappers used to read/write the NCT38xx
register space.

Signed-off-by: Keith Short <keithshort@google.com>
2023-09-11 11:00:47 +02:00
Keith Short
ea40f3af24 mfd: Add NCT38xx multi-function driver
The Nuvoton NCT38xx is a multi-function device providing a TCPC
controller and a I/O expander (GPIO driver).  Add a multi-function
driver to manage exclusive access to the device.

Tested with "twister -T tests/drivers/build_all/gpio".

Signed-off-by: Keith Short <keithshort@google.com>
2023-09-11 11:00:47 +02:00
Florian Grandel
69e459ffb4 doc: drivers: ieee802154: updated nomenclature
Introduces new rules for IEEE 802.15.4 driver nomenclature, see #61227.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-09 05:18:41 -04:00
Anders Storrø
6b627771c8 Bluetooth: Mesh: Shell support for comp data page2
Adds shell support for composition data page 2 and 130

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-08 14:44:25 +02:00
Anders Storrø
9d849736ef Bluetooth: Mesh: Support for comp data page 2
Adds support for composition data page 2 & 130.

In this implementation the responsibillity for filling the page 2
buffer is left to the application through the new comp page 2 cb API.
Only the application can know/decide if the device is NLC compliant,
and must thus be given the responsibillity for cheking the NLC profile
requirements, defined in the NLC specs, and filling the response buffer
for comp data page 2.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-08 14:44:25 +02:00
Mulin Chao
d2892c1123 driver: sensor: npcx: add 'thr-sel' prop. for adc comparator
Add `thr-sel` prop. to select the relevant threshold register for adc
comparator since there're two adc modules in npcx4 series.

Signed-off-by: Kate Yen <htyen@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-09-08 14:43:37 +02:00
Mulin Chao
72ee4f75ef driver: adc: npcx: add multi-device support in npcx adc driver
Add multi-device support in npcx adc driver since there is more than one
adc module in npcx4 series. And each adc's reference voltage might be
different, this CL introduces the `vref-mv` prop. to select its own
reference voltage.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Signed-off-by: Kate Yen <htyen@nuvoton.com>
2023-09-08 14:43:37 +02:00
Emil Gydesen
7e66bb1e09 Bluetooth: ISO: Reject disconnecting pending CIS as peripheral
As per the core spec, the CIS is not allowed to disconnect
a CIS if it is pending (i.e. in the connecting state).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-08 14:43:23 +02:00
Florian Grandel
d218b20643 tracing: make API tracing configurable
So far only object tracing/tracking could be individually disabled (e.g.
CONFIG_TRACING_SEMAPHORE=n). Now tracing of any API may be disabled
(e.g. CONFIG_TRACING_PM=n).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-08 06:10:14 -04:00
Florian Grandel
c9c6676bdd doc: sys: atomic: improve bitset accessor doc
Removes an ambivalence in return value description.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-08 09:26:28 +02:00
Gerard Marull-Paretas
35500e4d15 drivers: gpio: gpio_get_pending_int: s/ENOTSUP/ENOSYS
Because -ENOSYS is the right error code to be used if op is not
implemented.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-07 20:18:33 +02:00
Gerard Marull-Paretas
b03ef6c8ba drivers: gpio: gpio_add|remove_callback: s/ENOTSUP/ENOSYS
-ENOSYS is the right error code to be returned if an op is not
implemented by a driver. Also clarify the documentation.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-07 20:18:33 +02:00
Gerard Marull-Paretas
603b49b70a drivers: gpio: pin_interrupt_configure is optional
Some GPIO controllers do not support interrupts, so allow drivers to not
provide this operation.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-07 20:18:33 +02:00
Fabio Baltieri
9c5dafed95 util: add type checking to CONTAINER_OF
Add a SAME_TYPE checking macro and use it to add type validation to
CONTAINER_OF. This is inspired by the Linux container_of implementation.

The check is inhibited when using C++ as __builtin_types_compatible_p is
not available there.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-07 20:17:48 +02:00
Ricardo Rivera-Matos
a7adb06ff4 charger: Initial charger dedicated API
Add initial charger driver API with the most basic of native_posix
driver tests.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2023-09-07 13:03:13 -04:00
Alexander Razinkov
9ae9df8b6f kernel: spinlock: k_spin_is_locked introduction
Currently spinlock internals are directly accessed from the tests.
This way the test becomes bound to the particular spinlock implementation.
To remove this unnecessary dependency the distinct API to check if spinlock
is locked is introduced.

k_spin_is_locked should be used for the spinlock testing only,
so the scope of this API is intentionally restricted.

Signed-off-by: Alexander Razinkov <alexander.razinkov@syntacore.com>
2023-09-07 14:26:55 +02:00
Martin Jäger
f13791d5ba canbus: isotp: use flags for configuration in isotp_msg_id
The previous design with dedicated bits in the structure required a
user to explicitly set each bit.

Using one flags variable allows to extend the features more easily
in the future and avoids breaking existing code.

This change is particularly useful for the FDF and BRS flags required
for CAN-FD support.

See also previous similar change for the CAN driver in
f8a88cdb27

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-09-07 09:43:56 +02:00
Paweł Anikiel
43668c6416 drivers: sensor: Add F75303 driver
Add driver for F75303 temperature sensor IC.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
2023-09-07 09:42:59 +02:00
Najumon B.A
a68204d8b8 arch: x86: update with new acpica lib interface
The old acpi implimentation is replaced with acpica interface
and updated x86 arch porting with the new interface.

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-09-07 09:42:38 +02:00
Najumon B.A
e5ec893c00 lib: acpi: add support for MAD table and DMAR table
add support for retrieve MAD and DMAR table information. Provided
two new interface namely acpi_dmar_entry_get() and acpi_drhd_get()
for retrieve DMA Remapping Reporting and DMA-remapping hardware
unit definition (DRDH).

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-09-07 09:42:38 +02:00
Florian Grandel
718fe844c2 net: l2: ieee802154: pkt: fix cpp build failure
CPP needs an additional cast.

Fixes: #62282

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-06 17:55:17 +02:00
Michał Barnaś
4aac1756a9 i2c: use device instead of name for i2c dump messages
This commit changes the parameter of i2c_dump_msgs function from
string name to pointer to the device structure.
It allows for comparison of device pointers and allow to use
the printed device name in i2c shell commands.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2023-09-06 17:54:53 +02:00
Armin Brauns
d7846de548 assert: check format arguments for correctness
This instructs the compiler to check that arguments to
__ASSERT/__ASSERT_NO_MSG are valid for printf.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-09-06 15:25:21 +02:00
Nicolas VINCENT
b01739da6f doc: shell: Update docstring regarding dictionnary
The dictionary is a triplet, update generated documentation accordingly.

Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
2023-09-06 15:23:37 +02:00
Benjamin Cabé
f9192a2e4a drivers: dmic: doc: Cleanup Doxygen documentation
Fixed several comments that were not proper Doxygen ones, causing
documentation for this file to be incomplete.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-06 15:12:14 +02:00
Benjamin Cabé
105a254f4d drivers: codec: doc: Fix Doxygen comments
Added a few missing brief descriptions + fixed existing ones
to use proper Javadoc-style comments.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-06 15:11:56 +02:00
Anders Storrø
01a6ecb6bf Bluetooth: Mesh: Send od priv proxy with devkey
According to the mesh 1.1 spec, section  4.4.14.1: “. The access layer
security on the On-Demand Private Proxy Client model shall use the
device key of the node supporting the On-Demand Private Proxy
Server model.“

This commit alters the API and implementation to reflect this.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-06 13:05:14 +02:00
Jamie McCrae
a15752c79c mgmt: mcumgr: Split mgmt defines to new file
This splits defines to a separate file, which are commonly needed
by out-of-tree projects whereby the full MCUmgr include cannot be
used due to undefined types being used.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-06 13:03:42 +02:00
Mariusz Skamra
c585bf5b44 Bluetooth: audio: Fix BT_AUDIO_CODEC_CFG_LC3_DATA sampling frequency
The sampling frequency in codec configuration is 1 byte value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-05 10:06:09 +02:00
Prashanth S
05fe627d79 drivers: interrupt-controller: Add VIM Interrupt Controller support
Add TI VIM (Vectored Interrupt Manager) interrupt controller support.
VIM is a TI specific custom interrupt controller for ARM cores.
In J721E soc, VIM aggregates interrupts to Cortex R5 cores.

TRM for J721e https://www.ti.com/lit/zip/spruil1
File: spruil1c.pdf
VIM: section 6.3.3.6

Signed-off-by: Prashanth S <slpp95prashanth@yahoo.com>
2023-09-04 10:53:09 +02:00
Carles Cufi
8c748fd005 kernel: Modify the signature of k_mem_slab_free()
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.

The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);

has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);

The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.

All in-tree uses of the function have been adapted.

Fixes #61888.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-09-03 18:20:59 -04:00
Miika Karanki
39de786b08 zbus: Fix documentation of ZBUS_LISTENER_DEFINE
The macro is clearly creating the listener in the enabled
state since it is calling the ZBUS_LISTENER_DEFINE_WITH_ENABLE
with 2nd argument being true. Fix the documentation, and add
the same remark to ZBUS_SUBSCRIBER_DEFINE documentation as
well.

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2023-09-01 12:21:47 -05:00
Casper Jørgensen
2ad0c90e87 mgmt: mcumgr: smp_dummy: Add missing conditional end bracket
Compiling smp_dummy.h for C++ is currently
not possible due to a missing end curly bracket.

This commit add the missing end bracket on the same
condition as the start bracket is included.

Signed-off-by: Casper Jørgensen <casperej@gmail.com>
2023-09-01 17:44:49 +02:00
Mykola Kvach
26c9721b67 fs: littlefs: add alignment arg to FS_LITTLEFS_DECLARE_CUSTOM_CONFIG macro
Add alignment parameter to FS_LITTLEFS_DECLARE_CUSTOM_CONFIG macro, it
speeds up read/write operation for SDMMC devices in case when we align
buffers on CONFIG_SDHC_BUFFER_ALIGNMENT, because we can avoid extra copy
of data from card bffer to read/prog buffer. See, how 'card_read_blocks'
function works.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2023-09-01 17:44:15 +02:00
Umar Nisar
31a6594212 drivers: loapic: add device tree support for loapic
As per #26393, Local APIC is using Kconfig based option for
the base address. This patch adds DTS binding support in the driver,
just like its conunter part I/O APIC.

Signed-off-by: Umar Nisar <umar.nisar@intel.com>
2023-09-01 16:36:18 +02:00
Huifeng Zhang
4eee1e8172 arch: arm64: arm_mpu: optimize ram region attribute
Ram, ram_text and ram_ro regions will be accessed by all CPUs, so that
setting them to INNER_SHAREABLE is more reasonable.

'rbar' occupies 6 bits, correct it to 6.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-01 13:23:26 +02:00
Emil Gydesen
0617b2a5e5 Bluetooth: Audio: Add struct cast to BT_AUDIO_CODEC_QOS
Add a cast to struct bt_audio_codec_qos for the macro so
that the returned value can used for e.g. sizeof or
similar.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-01 13:23:09 +02:00
Mariusz Skamra
0197d1154a Bluetooth: audio: lc3: Fix build error
This fixes build error caused by redundant comma without expression
lc3.h:269:74: error: expected expression before ',' token
  269 |          (_max_frames_per_sdu)))),                         \
      |

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-01 13:22:36 +02:00
Alberto Escolar Piedras
cefe57f1e3 arch POSIX: Add two missing prototypes to header
The posix_soc_if.h header includes all functions
one can expect any native board will provide.
These two functions (to set and clear an interrupt
from SW) were missing, but they are also required.
Add them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-01 09:54:27 +02:00
Emil Gydesen
76e35635b6 Bluetooth: Audio: Rename codec qos framing
Rename BT_AUDIO_CODEC_QOS_[UN]FRAMED to
BT_AUDIO_CODEC_QOS_FRAMING_[UN]FRAMED and give a name
to the enum, which is then used by the
struct bt_audio_codec_qos.

The rename was needed as we had a codec_qos initializer of the
same name, so the values were renamed to avoid duplicated
macro names.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-01 09:54:18 +02:00
Anas Nashif
6baa622958 arch: move exc_handle.h under zephyr/arch/common
This header is private and included only in architecture code, no need for
it to be in the top of the public include directory.

Note: This might move to a more private location later. For now just
cleaning up the obvious issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-31 09:19:19 -04:00
Jukka Rissanen
05b7eda618 net: Add name support to network interface
If CONFIG_NET_INTERFACE_NAME is enabled (default is y), then
system will automatically set a user friendly name to the network
interface like eth0, wlan0 etc.
Application can change the interface name if needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-08-31 14:43:36 +02:00
Krzysztof Chruściński
cebd140bee logging: log_output: Add optional tid formatting
Add option to prefix log message with thread ID or thread name.
Align tests and add test case to the log_output test.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-08-31 14:08:19 +02:00
Krzysztof Chruściński
70dce83f14 logging: Add option to store tid in the log message
Add Kconfig LOG_THREAD_ID_PREFIX option which allows storing
thread id in the log message and process it as message prefix
(as id or thread name).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-08-31 14:08:19 +02:00
Mariusz Skamra
b4af917ad0 Bluetooth: audio: Change bt_audio_codec_cfg_get_val return value
This changes bt_audio_codec_cfg_get_val function to return the data
length found. Otherwise, this function gives no information about the
returned data length.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-31 10:21:07 +02:00
Jukka Rissanen
7d3dabf07b net: wifi: Properly namespace public APIs
The twt and ps helper functions were not namespaced (were missing
wifi_ prefix).

Also change wifi_get_twt_... to more logical wifi_twt_get...
like the other twt prefixed functions and wifi_get_ps... to
wifi_ps_get... like the other ps prefixed functions.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-08-31 10:20:07 +02:00
Daniel DeGrasse
b2172a97d8 sd: clean up sizes of some SD data fields
Clean up sizes of some SD data fields, as the max value of these fields
is limited by the SD specification

Specifically, the limits are as follows:
num_io: 0-7, 3 bits (SDIO only)
relative_addr: 16 bits (SDMMC/MMC)
block_size: 12 bits (Max of 2KB, uint16_t used)
sd_version: 8 bits (currently at version 3)
card_speed: 8 bits (could potentially be reduced in size)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-31 10:19:37 +02:00
Dominik Ermel
5739f2c6da mgmt/MCUmgr/grp/img: Switch to using img_mgmt_get_next_boot_slot
The commit modifies image list command operations to use
img_mgmt_get_next_boot_slot instead of directly relying of
MCUboot flags.
The function is now used, also, by img_mgmt_slot_in_use to
figure out whether queried slot is in use.
The commit introduces two new Kconfig options
 MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_IMAGE_SECONDARY
 MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_IMAGE_ANY
that allow users to enable confirming non-active images slots.
The MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_IMAGE_SECONDARY is y
by default to keep original behavior of logic that accidentally
allowed confirming secondary slot.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-31 10:19:15 +02:00
Tom Finet
d09a1c39f9 posix: implement clock_nanosleep
Implements the posix clock_nanosleep function, where both relative
and absolute sleeps are made as absolute sleeps.
The nanosleep() function is a special case of clock_nanosleep(),
and so has been refactored to simply call it.

Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
2023-08-30 13:02:58 -07:00