drivers: pwm_nrfx: Use Device Tree label as instance name

This commit replaces Kconfig options defining PWM instance
names by device tree labels.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
Piotr Zięcik 2019-02-26 16:29:21 +01:00 committed by Carles Cufí
commit ddf744deee
2 changed files with 2 additions and 41 deletions

View file

@ -12,43 +12,3 @@ menuconfig PWM_NRFX
help help
Enable support for nrfx Hardware PWM driver for nRF52 MCU series. Enable support for nrfx Hardware PWM driver for nRF52 MCU series.
if PWM_NRFX
if PWM_0
config PWM_0_NAME
string "PWM module 0 device name"
default "PWM_0"
help
Specify the device name for the Nordic Semiconductor nRF52 series HW
PWM module 0.
endif # PWM_0
if PWM_1
config PWM_1_NAME
string "PWM module 1 device name"
default "PWM_1"
help
Specify the device name for the Nordic Semiconductor nRF52 series HW
PWM module 1.
endif # PWM_1
if PWM_2
config PWM_2_NAME
string "PWM module 2 device name"
default "PWM_2"
help
Specify the device name for the Nordic Semiconductor nRF52 series HW
PWM module 2.
endif # PWM_2
if PWM_3
config PWM_3_NAME
string "PWM module 3 device name"
default "PWM_3"
help
Specify the device name for the Nordic Semiconductor nRF52 series HW
PWM module 3.
endif # PWM_3
endif # PWM_NRFX

View file

@ -372,7 +372,8 @@ static int pwm_nrfx_pm_control(struct device *dev,
.seq.length = NRF_PWM_CHANNEL_COUNT \ .seq.length = NRF_PWM_CHANNEL_COUNT \
}; \ }; \
PWM_NRFX_PM_CONTROL(idx) \ PWM_NRFX_PM_CONTROL(idx) \
DEVICE_DEFINE(pwm_nrfx_##idx, CONFIG_PWM_##idx##_NAME, \ DEVICE_DEFINE(pwm_nrfx_##idx, \
DT_NORDIC_NRF_PWM_PWM_##idx##_LABEL, \
pwm_nrfx_init, pwm_##idx##_nrfx_pm_control, \ pwm_nrfx_init, pwm_##idx##_nrfx_pm_control, \
&pwm_nrfx_##idx##_data, \ &pwm_nrfx_##idx##_data, \
&pwm_nrfx_##idx##_config, \ &pwm_nrfx_##idx##_config, \