Commit Graph

17 Commits

Author SHA1 Message Date
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Enjia Mai 32b2d70875 tests: drivers: move the regulator pmic test to new ztest API
Migrate the testsuite tests/drivers/regulator/pmic to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-29 10:09:58 -04:00
Enjia Mai 69b740d61d tests: drivers: move the regulator test to new ztest API
Migrate the testsuite tests/drivers/regulator/fixed to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-29 10:09:58 -04:00
Gerard Marull-Paretas e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Kumar Gala 717be967ee tests: regulator: fixed: Remove devicetree label property
The label property isn't needed so remove it.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-10 14:37:38 -05:00
Fabio Baltieri def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Kumar Gala b50f071af6 tests: regulator_pmic: rework to use DEVICE_DT_GET
Move to using a devicetree nodelabel (test_regulator) to reference
the regulator device to test.  This lets us remove use of Kconfig
as well as device_get_binding().

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-23 09:23:37 -05:00
Kumar Gala 9d175ca5f1 tests: regulator: fixed: Convert test to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:54:48 +02:00
Kumar Gala c49e67cffd tests: regulator: fixed: Convert to use gpio_dt_spec
Move test to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:54:48 +02:00
Kumar Gala 8739899a02 tests: regulator: pmic: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:51:16 +02:00
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Daniel DeGrasse 81682a7c09 tests: regulator_pmic: Added PMIC regulator test
Test verifies that i2c pmic regulator can be disabled or enabled using
the regulator API. Verifies PMIC output voltage using ADC.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-08 08:27:44 -05:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Martí Bolívar 682aea8b3b dts: don't use 'test' vendor prefix
This is now failing an edtlib check for unknown vendor prefixes.

I can't find a reason to use a vendor prefix in application-local
bindings like this, so just remove it wherever it appears by
normalizing to test-foo-compat instead of test,foo_compat or
test,foo-compat.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 08:05:04 -05:00
Johann Fischer d8bbd2ad5c tests: regulator: add integration platform
Add nrf52840dk_nrf52840 as integration platform since
there is already devicetree overlay for that.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-16 09:45:35 +02:00
Johann Fischer 44c3053c4b drivers: regulator: do not explicitly enable fixed regulator driver
Do not explicitly enable fixed regulator driver for boards and tests
because it is automatically selected when corresponding node
is defined.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-16 09:45:35 +02:00
Peter A. Bigot 977ec16451 tests: drivers: regulator: add test for fixed regulator
Basic checks on core regulator functions.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-10-28 15:22:53 +01:00