soc_nrf_common: Extend and rename the NRF_DT_ENSURE_PINS_ASSIGNED macro

Extend the macro with checks for DT properties related to pin
assignments that are defined but would be ignored, depending on
whether PINCTRL is enabled or not, what presumably indicates
a resulting configuration different from what the user expects.

Add also a possibility to indicate that the pinctrl-1 property
should not be checked because the caller does not support the
sleep state.

Rename the macro so that its name better reflects its function.
Update accordingly all drivers that use it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2022-03-17 15:15:09 +01:00 committed by Carles Cufí
commit a5234f3647
14 changed files with 55 additions and 24 deletions

View file

@ -284,7 +284,7 @@ static int twi_nrfx_pm_action(const struct device *dev,
.sda = DT_PROP(I2C(idx), sda_pin),))
#define I2C_NRFX_TWI_DEVICE(idx) \
NRF_DT_ENSURE_PINS_ASSIGNED(I2C(idx), scl_pin); \
NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin); \
BUILD_ASSERT(I2C_FREQUENCY(idx) != \
I2C_NRFX_TWI_INVALID_FREQUENCY, \
"Wrong I2C " #idx " frequency setting in dts"); \

View file

@ -393,7 +393,7 @@ static int twim_nrfx_pm_action(const struct device *dev,
.sda = DT_PROP(I2C(idx), sda_pin),))
#define I2C_NRFX_TWIM_DEVICE(idx) \
NRF_DT_ENSURE_PINS_ASSIGNED(I2C(idx), scl_pin); \
NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin); \
BUILD_ASSERT(I2C_FREQUENCY(idx) != \
I2C_NRFX_TWIM_INVALID_FREQUENCY, \
"Wrong I2C " #idx " frequency setting in dts"); \