Commit Graph

67260 Commits

Author SHA1 Message Date
Aleksander Wasaznik 2b68a7d391 Bluetooth: Host: Make function static
`bt_le_create_conn_legacy` is not used outside its file.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-07-20 10:48:09 +02:00
Stephanos Ioannidis 8ca122a572 MAINTAINERS: Add stephanosio as MAINTAINERS file collaborator
This commit adds @stephanosio as a collaborator for the MAINTAINERS
file area so that he is automatically notified of any changes to the
maintainer and collaborator list and can update the GitHub permissions
accordingly.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-07-20 01:15:17 -05:00
Kumar Gala dcfcd05ed3 tracing: Move to DTS for uart device
Move from using Kconfig TRACING_BACKEND_UART_NAME to a devicetree
chosen property ("zephyr,tracing-uart").  This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 16:00:47 -07:00
Benjamin Björnsson 93f71d6a8a samples: boards: nrf: battery: Remove uneccesary if-def
Remove if-def since io-channels is a required property of
the voltage-devider compatible so the else case won't happen.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 22:54:50 +00:00
Benjamin Björnsson f195b910b2 drivers: gpio: gpio_pcal6408a: move 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 22:53:37 +00:00
Kumar Gala 8fb2210cfb emul: remove name param from bus register APIs
Rework the <BUS>_emul_register calls to not pass the name param.  The
name param is only used for logging and we can get it from the
struct <BUS>_emul instead.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 15:52:36 -05:00
Gerard Marull-Paretas 20177daa0f drivers: spi: nrfx_spi(m|s): add common init function
Having a per-instance init function makes code cluttered and hard to
read. Just create a per-instance IRQ connect function (required to
resolve IRQ_CONNECT parameters at compile time).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas a8b444f956 drivers: spi: nrfx_spi(m|s): s/_DEVICE/_DEFINE
Use SPI_NRFX_SPI(M|S)_DEFINE, since the macro _defines_ a device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas 7d42a8ff18 drivers: spi: nrfx_spim: remove unused definitions
SPIM_NRFX_MISO_PULL_DOWN and SPIM_NRFX_MISO_PULL_UP were not used,
delete them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas e5ba80733a drivers: spi: nrfx_spi(m|s): drop NRFX_SPI(S|M)_INSTANCE usage
Stop using NRFX_SPI(S|M)_INSTANCE helper so that peripheral address from
Devicetree is used. We should not rely on HAL for hardware description
but Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas 2cfb5012db drivers: spi: nrfx_spim: move rx delay to DT
Move the RX (MISO) delaying capability information to Devicetree. It is
done using 2 properties:

- rx-delay-supported: enabled on SPI nodes that support delaying RX.
  This property can be used by the driver to determine if this
  capability is supported or not on a given instance.
- rx-delay: the actual RX delay value

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas ee8d8b3c6e drivers: spi: nrfx_spis: max buffer length is SoC specific
The maximum transfer buffer length is SoC specific, not instance
specific. This patch defines MAX_BUF_LEN at driver level in a SoC
specific manner instead of using HAL values that are instance specific
but that always take the same value depending on the SoC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas 72cc583dc9 drivers: spi: nrfx_spim: max chunk length is SoC specific
The maximum transfer chunk length is SoC specific, not instance
specific. This patch defines MAX_CHUNK_LEN at driver level in a SoC
specific manner instead of using HAL values that are instance specific
but that always take the same value depending on the SoC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas 3c6649f631 drivers: spi: spi_nrfx_spi(m|s): move ORC to DT
Specify the overrun character in Devicetree. Since 0xFF is the most
common value, DT property contains such default.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas 4ad3a96059 drivers: spi: nrfx_spim: move maximum frequency parameter to DT
Devicetree is the natural place to describe hardware, so move the
maximum frequency the SPI can work with to Devicetree instead of relying
on values from HAL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Gerard Marull-Paretas 717f81795b drivers: spi: nrfx_spim: use DT_IRQN
Driver was not using Devicetree to obtain the SPIM IRQ number.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-19 13:20:00 -07:00
Tom Burdick ac84039060 tests: intel_adsp: Silence the hda tests
Uses a macro with a define flag to enable register dumps on the DSP
side. On the python side a simple booling flag.

The default disabled both debug flags and makes the tests
considerably quieter.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-07-19 16:10:47 -04:00
Andreas Sandberg fa6fe0274c drivers: gd7965: Use packed structs where appropriate
There are a few registers that map nicely onto structs. Switch from
using index constants and byte arrays in those cases.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2022-07-19 13:06:47 -07:00
Andreas Sandberg 544c0b22dd drivers: gd7965: Make tcon/cdi/pwr/softstart optional
Some panels using this driver don't provide tcon/cdi/pwr/softstart
values in their reference code. It is normally expected that the right
values will be loaded from OTP in such cases. Make these values
optional to support such panels.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2022-07-19 13:06:47 -07:00
Andreas Sandberg dc860cd6aa drivers: gd7965: Make it possible to use multiple instances
Add instance-specific data and config structs, and remove all other
global variables.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2022-07-19 13:06:47 -07:00
Andreas Sandberg 376973423f drivers: gd7965: Remove the need to use heap memory
The GD7965 driver uses malloc to allocate a single line buffer when
clearing the display. This buffer is used to clear the display line by
line. This as two problems. First, it means that the driver introduces
an unnecessary requirement to support heap allocations. Second, it
causes a lot of weird and unnecessary SPI transactions that look like
partial updates without the actual refresh. This is very inefficient
since the same action can be performed in a single SPI transaction.

Add a gd7965_write_cmd_pattern() helper function that writes a pattern
of a specified length to a register in the device.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2022-07-19 13:06:47 -07:00
Andreas Sandberg 589b83a745 drivers: gd7965: Lock the SPI bus
The protocol used by the GD7965 driver requires that SPI transactions
are split into two phases, a command phase and a data phase, to change
the state of a GPIO signaling commands/data.

We currently don't lock the bus which means that other drivers could
potentially take over the bus and introduce unpredictable delays
between the command and data phase.

Add the necessary locking.

Signed-off-by: Andreas Sandberg <andreas@sandberg.uk>
2022-07-19 13:06:47 -07:00
li biao 3e87adc8bc tests: lib: devicetree: move api_ext to new ztest API
Move test lib/devicetree/api_ext to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-07-19 13:00:37 -07:00
li biao dea133ac26 tests: lib: devicetree: move api to new ztest API
Move test lib/devicetree/api to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-07-19 13:00:37 -07:00
li biao a5129e62b3 tests: lib: devicetree: move devices to new ztest API
Move test lib/devicetree/devices to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-07-19 13:00:37 -07:00
Kumar Gala 7d95eb0ac9 drivers: espi_emul: Fix formatting
Fix formatting of emul_espi_driver_api initializer

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 13:21:45 -05:00
Kumar Gala b8c276a363 emul: emul_bmi160: Remove unused bus_label
The bus_label is not used and is using DT_INST_BUS_LABEL which is
now deprecated and thus causes an error when running CI.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 13:21:03 -05:00
Kumar Gala c77035c61e samples: module: 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:00:36 -07:00
Aaron Massey fc98549952 emul: Use DEVICE_DT_GET instead of DT_LABEL
DT nodes aren't guaranteed to define a label property. But emulated bus
controllers currently make use of this property to dispatch to the
associated emulator.

Have emulated bus controllers use DEVICE_DT_GET(node_id) to dispatch to
right target peripheral emulator. This also change makes emul_get_binding
and device_get_binding synonymous in behavior with respect to their
parameters.

This also strictly enforces a 1:1 correspondence between invocations of
DEVICE_DT_DEFINE and EMUL_DEFINE.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-19 11:43:30 -05:00
Aaron Massey 5e2678135d emul: Make emulator parameters consistently named
Some paramaters in prior emulators have historically referred to instances
of struct emul as "emulator" or "emul". The proper parameter name for this
type is "target" as it designates the struct emul instance is the emul
bus (e.g. emul_i2c) controller's target peripheral for dispatch.

Do a small refactor renaming some of these parameters to "target".

TEST=twister on accel, espi, and eeprom drivers tests

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-19 11:43:30 -05:00
Aaron Massey 76ae0ba270 emul: Remove or declare unused args
In several locations of the emulator code there are unused function
arguments that were never caught.

Declare these as unused or remove the unused function parameters entirely.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-19 11:43:30 -05:00
Aaron Massey 9d7b9dc807 emul: Simplify emulator bus initialization and API
Allow emulator creators to write an init function that can be used
across multiple busses so as to reduce the boilerplate and cognitive
load in creating an emulator.

Part of this change includes allowing access to the emul struct from a
field in a {bus}_struct api (e.g. i2c_struct), which removes the need for
sporadic usages of CONTAINER_OF to access the emul struct.

Overall, this change simplifies and reduces the amount of boilerplate
code to get a device emulator up and running, thus reducing excise work
to writing tests.

TEST=twister on accel,espi, and eeprom drivers tests

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-19 11:43:30 -05:00
Aaron Massey 1028459afd emul: Run clang-format
Run clang-format on all files touched by improved emulator API pull-request
that allowed access to the target device emulator from its bus api without
CONTAINER_OF usage.

drivers/i2c/i2c_emul.c
drivers/spi/spi_emul.c
include/zephyr/drivers/emul.h
include/zephyr/drivers/espi_emul.h
include/zephyr/drivers/i2c_emul.h
include/zephyr/drivers/spi_emul.h
subsys/emul/emul.c
subsys/emul/emul_bmi160.c
subsys/emul/espi/emul_espi_host.c
subsys/emul/i2c/emul_atmel_at24.c

TEST=twister on accel,espi, and eeprom drivers tests

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-19 11:43:30 -05:00
Kumar Gala 9cb707b814 tests: build_all: video: remove unnecessary Kconfig symbols
Kconfig will default to enable the drivers based on devicetree so
we don't need to explicitly set the Kconfig symbols.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:39:49 -07:00
Kumar Gala f6013818ec drivers: video: Update drivers to use devicetree Kconfig symbol
Update video drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:39:49 -07:00
Kumar Gala ccb9b6b5ba scripts: check_compliance: generate Kconfig.dts
Generate a Kconfig.dts to allow check_compliance to run.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:39:49 -07:00
Kumar Gala 412d835448 doc: generate dummy Kconfig.dts
Generate a dummy Kconfig.dts to allow docs to build

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:39:49 -07:00
Kumar Gala c9aa63c0dc dts: Introduce Kconfig.dts
Introduce a generated Kconfig.dts that sets a Kconfig symbol for
every compatible.

* We set DT_HAS_<compat>_ENABLED if the devicetree has a node with
  <compat> enabled. (status is okay...)

We can then use the Kconfig symbol in driver Kconfig to determine
if the driver should be available, and thus enabled by default.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:39:49 -07:00
Kumar Gala b109a0a9f7 dts: Add simple script to generate Kconfig.dts based on bindings
Given binding dirs the script will generate a Kconfig.dts of the
form:

    DT_COMPAT_ADI_ADT7420 := adi,adt7420

    config DT_HAS_ADI_ADT7420_ENABLED
            depends on DTS_HAS_ADI_ADT7420
            def_bool $(dt_compat_enabled,$(DT_COMPAT_ADI_ADT7420))

Than a driver Kconfig can use these Kconfig symbols as follows:

    menuconfig ADT7420
            bool "ADT7420 Temperature Sensor"
            default y
            depends on DT_HAS_ADI_ADT7420_ENABLED
            ...

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:39:49 -07:00
Kumar Gala 357c70cfdc tests: devicetree: api: reduce DT_LABEL usage
A lot of places that DT_LABEL is used we can replace with DT_SAME_NODE
as we are just checking that the node we got from the macro is the
same as what we expect.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 09:09:13 -07:00
Bartosz Bilas 3322aad03b scripts: pylib: twister: twisterlib: fix typo
s/enviornment/environment

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-07-19 11:41:54 -04:00
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