drivers: pwm: nrfx: Convert to use DTS NODELABEL for instance detection

Move to using NODELABEL references to enable driver instances for
PWM0..3.  This will allow us to remove per-instance PWM Kconfig symbols.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-05-05 05:46:57 -05:00 committed by Kumar Gala
commit b04b399d63
2 changed files with 8 additions and 8 deletions

View file

@ -6,9 +6,9 @@ config PWM_NRFX
default y
depends on HAS_HW_NRF_PWM0 || HAS_HW_NRF_PWM1 || \
HAS_HW_NRF_PWM2 || HAS_HW_NRF_PWM3
select NRFX_PWM0 if PWM_0
select NRFX_PWM1 if PWM_1
select NRFX_PWM2 if PWM_2
select NRFX_PWM3 if PWM_3
select NRFX_PWM0 if "$(dt_nodelabel_enabled,pwm0)"
select NRFX_PWM1 if "$(dt_nodelabel_enabled,pwm1)"
select NRFX_PWM2 if "$(dt_nodelabel_enabled,pwm2)"
select NRFX_PWM3 if "$(dt_nodelabel_enabled,pwm3)"
help
Enable support for nrfx Hardware PWM driver for nRF52 MCU series.

View file

@ -422,18 +422,18 @@ static int pwm_nrfx_pm_control(struct device *dev,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&pwm_nrfx_drv_api_funcs)
#ifdef CONFIG_PWM_0
#if DT_HAS_NODE(DT_NODELABEL(pwm0))
PWM_NRFX_DEVICE(0);
#endif
#ifdef CONFIG_PWM_1
#if DT_HAS_NODE(DT_NODELABEL(pwm1))
PWM_NRFX_DEVICE(1);
#endif
#ifdef CONFIG_PWM_2
#if DT_HAS_NODE(DT_NODELABEL(pwm2))
PWM_NRFX_DEVICE(2);
#endif
#ifdef CONFIG_PWM_3
#if DT_HAS_NODE(DT_NODELABEL(pwm3))
PWM_NRFX_DEVICE(3);
#endif