Commit graph

67169 commits

Author SHA1 Message Date
Kumar Gala 6f5e75ba31 samples: usb: dfu: Fix building of sample on a few platforms
Fix building this sample on bl5340_dvk_cpuapp_ns and
pinnacle_100_dvk.  On these boards the NORDIC_QSPI_NOR
driver needs to be enabled for the sample to build.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 15:29:41 +00:00
Kumar Gala 4a64af0e9d dts: bindings: arm: device labels are now optional
All in tree device drivers use some form of DEVICE_DT_GET
so we no longer need to require label properties.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:22:59 -05:00
Benjamin Björnsson 1f630f838a samples: drivers: watchdog: Update sample to use alias
Simplify sample by using DT_ALIAS to make the sample more generic.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson f047816f0f samples: drivers: watchdog: Add alias to overlays
Add alias to overlays for boards that switch the watchdog to be
used while running this sample.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson ab4a926c27 boards: Add alias to boards with watchdog enabled
Add alias to boards with watchdog enabled to facilitate the
move of samples/drivers/watchdog to use DT_ALIAS.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson 42154a9dbd boards: arm: efm32pg_stk340xa: Move watchdog from chosen to alias
Move watchdog0 and watchdog1 nodes from choosen to aliases for
consistency with other boards.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson 55d47d341a samples: drivers: watchdog: Remove uneccesary overlays
These watchdogs are already enabled in device tree.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson 4b2af3480d boards: arm: cc32xxsf_launchxl: Enable watchdog in devicetree.
Enable watchdog in device tree in order to remove overlays
from samples/drivers/watchdog.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Kumar Gala d77389464b drivers: sensor: shell_battery: Convert to DEVICE_DT_GET
Move to using DEVICE_DT_GET so we can phase out DT_LABEL.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 08:45:13 -05:00
Kumar Gala 88021ecd47 samples: sensors: Remove label property from devicetree overlays
Label properties are not required

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 08:23:35 -05:00
Kumar Gala a97765706a samples: boards: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 12:32:14 +00:00
Kumar Gala 7bc6bc8681 dts: bindings: test: device labels are now optional
All in tree device drivers use some form of DEVICE_DT_GET
so we no longer need to require label properties.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 12:31:53 +00:00
Kumar Gala 3a349368e4 dts: bindings: {gpio,pwm}-leds: device labels are now optional
All in tree device drivers use some form of DEVICE_DT_GET
so we no longer need to require label properties.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 12:31:30 +00:00
Benjamin Björnsson 4e841aea8d drivers: regulator: regulator_pmic: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 12:28:55 +00:00
Benjamin Björnsson 6098e1894b drivers: sensor: ms5607: Update driver to use spi_dt_spec
Simplify driver by using spi_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 12:28:29 +00:00
Benjamin Björnsson e6f9ef4cc7 drivers: sensor: ms5607: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 12:28:29 +00:00
Emil Gydesen df75bfd8f6 Bluetooth: Audio: Add PACS location read for unicast client
The unicast client will now read the PACS location value
during the discovery procedure, as well as subscribing to
it.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-19 12:27:00 +00:00
Emil Gydesen 5aa1ab9c1a Bluetooth: Audio: Remove redundant unicast client guard
The code in unicast_client.c was guarded by
CONFIG_BT_AUDIO_UNICAST_CLIENT but the file is only
compiled if CONFIG_BT_AUDIO_UNICAST_CLIENT is enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-19 12:27:00 +00:00
Emil Gydesen dab588a23a Bluetooth: Audio: Rename unicast client PAC cache
Rename the cache from "cache" to "pac_cache" to avoid
name clashes with local cache variables.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-19 12:27:00 +00:00
Gerard Marull-Paretas cad6865aaa drivers: i2c: nrfx_twim: constify twim_config
The twim_config structure is no longer modified at runtime, so it can be
placed in driver's config (const).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 9974bb043f drivers: i2c: nrfx_twim: disable and restore state for bus recovery
TWIM peripheral needs to be disabled for bus recovery, otherwise SCL/SDA
lines will not be released. This patch makes sure to disable peripheral
if active, and, restore its state afterwards (including pin
configuration).

It is worth to note that a better solution would be to:

1. Define scl/sda pins as `-gpios` in DT
2. Use GPIO API in the driver to perform recovery (as some other drivers
   do)
3. Potentially use a "gpio" pinctrl state for this case

Unfortunately HAL is doing everything under the hood, so we have little
options to improve this unless we don't use it for such case. GPIO based
recovery should likely be generalized as many drivers seem to replicate
such _algorithm_.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 2828578c25 pm: device: provide dummy pm_device_state_get if CONFIG_PM_DEVICE=n
When CONFIG_PM_DEVICE=n a device will always be in active state. Provide
a dummy implementation of pm_device_state_get that always returns
PM_DEVICE_STATE_ACTIVE.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 6f26fa2912 drivers: i2c: nrfx_twim: enable device runtime PM
Enable device runtime PM on the I2C driver. Note that this mechanism
replaces the old nrfx_twim_enable/disable calls with
pm_device_runtime_get/put, which means that driver will not save power
unless CONFIG_PM_DEVICE_RUNTIME=y.

Some quick measurements on thingy_52 running the samples/sensor/hts221
show a decrease of ~2-3uA in average when enabling device runtime PM.
Note that the driver already had implicit PM before, so the change for
users will be ~none, except that they now must enable the PM subsystem
features. While this case is not the best example, the PM subsystem will
turn to be beneficial as a whole when all devices in the board implement
it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 81f1bbacf4 drivers: i2c: nrfx_twim: drop init_twim shim
The function was just a shim to nrfx_twim_init, call it directly
instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas a1f6163a58 drivers: i2c: nrfx_twim: create common init function
The device definition macro defined per-device init function, resulting
in a cluttered and hard to extend init function. Create a per-instance
IRQ connect function instead, which is called at init time by a common
function.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 00ecc66677 drivers: i2c: nrfx_twim: enable/disable when resuming/suspending
The driver already implemented some sort of runtime PM by
unconditionally calling nrfx_twim_disable/enable. Perform the same
operations in the PM callback instead of doing a full init/deinit every
time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas d3251c28aa drivers: i2c: nrfx_twim: remove redundant deinit_twim shim
The shim had no value, just call nrfx_twim_uninit directly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 9d649a5a74 drivers: i2c: nrfx_twim: drop twim_initialized usage
The driver re-initialized itself on the twim_transfer call if it wasn't.
This condition was likely added because of some manual/custom PM
schemes. Drop it in preparation for runtime PM.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Gerard Marull-Paretas 7fad89f020 drivers: i2c: nrfx_twim: avoid init/deinit to update frequency
nrfx HAL does not support updating frequency at runtime, which means we
need to do a full init/deinit to update it when it is a matter of a
simple register write. Fix this by using the lower level HAL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 12:25:13 +00:00
Alex Kolosov f59e9dd857 scripts: runners: improvements for spi_burn west runner
Following changes has been made by this commit:
    - fix issue when a binary is not able to be found by relative path
    - implement "west debug" command
    - implement --dt-flash option

Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2022-07-19 12:23:47 +00:00
Andrei Emeltchenko 04552eb9c1 MAINTAINERS: Add Drivers: EDAC entry
Add myself as Drivers: EDAC maintainer.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-07-19 08:04:22 -04:00
Mr. Green's Workshop 5772af2eb4 doc: commit description line limit added.
There wasn't any description for line length limit per line.
Description added.

Signed-off-by: Mr. Green's Workshop <info@mrgreensworkshop.com>
2022-07-19 07:36:20 -04:00
Fredrik Danebjer c0ab35a997 Bluetooth: GATT: Add LE Secure Connections Permission Check
Added possibility to enforce that a LE Secure Connection is required
for reading and writing characteristics, i.e. providing a more fine
grained check that allows services that requires secure connection
to co-exists with those that doesn't.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-07-19 10:32:56 +02:00
Kumar Gala e99652b67d drivers: ieee802154: cc2520: Convert to DEVICE_DT_INST_DEFINE
Move driver to use {NET_}DEVICE_DT_INST_DEFINE.  This lets us
remove the IEEE802154_CC2520_DRV_NAME Kconfig symobl.

We also update the ieee802154 build_all test to actually enable
the CC2520 driver.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:32:21 +02:00
Kumar Gala 5cca6ed087 drivers: ieee802154: b91: Convert to DEVICE_DT_INST_DEFINE
Move driver to use {NET_}DEVICE_DT_INST_DEFINE.  This lets us
remove the IEEE802154_B91_DRV_NAME Kconfig symobl.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:32:09 +02:00
Freddie Yang eca27824f3 drivers: fix race condition in SPI-based HCI driver
Give the semaphore after transceiving the message.

Signed-off-by: Freddie Yang <freddie.yang325@outlook.com>
2022-07-19 10:31:36 +02:00
Henrik Brix Andersen 7da63e1551 samples: net: sockets: can: add console harness configuration
Add a console harness for validating the output from the SocketCAN sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-19 10:31:10 +02:00
Henrik Brix Andersen dd96b86835 net: samples: sockets: can: add support for native_posix
Add support for running the SocketCAN sample on
native_posix/native_posix_64 using the CAN loopback interface.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-19 10:31:10 +02:00
Pavel Vasilyev b9078e98e6 tests: Bluetooth: Mesh: Add ability to abort bsim mesh tests by ctrl-c
Sometimes there is a need to interrupt mesh babblesim tests when
debugging or implementing new tests. Calling Ctrl-C doesn't work as it
only aborts the test script, but not the executables. This fix adds a
trap for Ctrl-C to kill all test instances run by the script.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-07-19 10:30:56 +02:00
Kumar Gala a8c400d1a5 samples: net: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:30:39 +02:00
Kumar Gala 28143b1cdc samples: subsys: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:30:20 +02:00
Kumar Gala d979995858 boards: arm64: imx8m{m,p}_evk: disable uart
Disable the uart device as the iuart driver is not supported on i.MX8

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:30:20 +02:00
Xiao Song 2218cb1094 tests: net: lib: move coap to new ztest API
Move tests/net/lib/coap/ to use new ztest API.

Signed-off-by: Xiao Song <songx.xiao@intel.com>
2022-07-19 10:30:06 +02:00
Yuval Peress 82caf98dde cbprintf: fix missing field initializer warning
When compiling with '-Werror=missing-field-initializers', the cbprintf
header causes an error since 'off' isn't initialized.

Signed-off-by: Yuval Peress <peress@google.com>
2022-07-19 10:29:53 +02:00
Anas Nashif 6027152408 scripts: set_assignee: handle exceptions
Deal with exceptions that happen when a user does not exist on GH.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-18 21:41:22 -04:00
Anas Nashif ffcedaa964 MAINTAINERS: remove lairdjm, account does not exist
This account does not exist anymore in GH, remove it from the
maintainers file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-18 21:41:22 -04:00
Martí Bolívar 7d7988d1a9 devicetree: clarify FOREACH_CHILD behavior
The children are iterated over in the same order they appear in
zephyr.dts, but this isn't documented. Clarify the order.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-07-18 17:50:44 -05:00
Martí Bolívar d6f68f0bbb scripts: gen_defines: fix tokenization of array elements
This fixes commit
3d5cc38cf6.

That commit only works if removing the quotes from e.g. a string in an
array actually results in a token. If the string's value is something
like

  "foo,bar"

though, it will result in the "token"

  foo,bar

in the generated output.

This is wrong; fix it using the new edtlib.str_as_token() API
introduced to allow callers to perform the same procedure as that
library for fixing up strings.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-07-18 17:50:44 -05:00
Martí Bolívar 7b2a728584 scripts: gen_defines: add a missing comment
Adding a comment at this point in the header file splits these macros
into their own section. They are presently grouped together with the
previous section, which is unrelated. This is confusing; fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-07-18 17:50:44 -05:00
Martí Bolívar 4ef8c8e447 edtlib: expose str_as_token() API
Some callers need to be able to convert strings to tokens in the same
way edtlib does. Make this possible by exposing the internal helper
function used to do that under a suitable name.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-07-18 17:50:44 -05:00