Skip to content

Commit ddf744d

Browse files
pizi-nordiccarlescufi
authored andcommitted
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 <[email protected]>
1 parent aab77ea commit ddf744d

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

drivers/pwm/Kconfig.nrfx

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,3 @@ menuconfig PWM_NRFX
1212
help
1313
Enable support for nrfx Hardware PWM driver for nRF52 MCU series.
1414

15-
if PWM_NRFX
16-
17-
if PWM_0
18-
config PWM_0_NAME
19-
string "PWM module 0 device name"
20-
default "PWM_0"
21-
help
22-
Specify the device name for the Nordic Semiconductor nRF52 series HW
23-
PWM module 0.
24-
25-
endif # PWM_0
26-
27-
if PWM_1
28-
config PWM_1_NAME
29-
string "PWM module 1 device name"
30-
default "PWM_1"
31-
help
32-
Specify the device name for the Nordic Semiconductor nRF52 series HW
33-
PWM module 1.
34-
endif # PWM_1
35-
36-
if PWM_2
37-
config PWM_2_NAME
38-
string "PWM module 2 device name"
39-
default "PWM_2"
40-
help
41-
Specify the device name for the Nordic Semiconductor nRF52 series HW
42-
PWM module 2.
43-
endif # PWM_2
44-
45-
if PWM_3
46-
config PWM_3_NAME
47-
string "PWM module 3 device name"
48-
default "PWM_3"
49-
help
50-
Specify the device name for the Nordic Semiconductor nRF52 series HW
51-
PWM module 3.
52-
endif # PWM_3
53-
54-
endif # PWM_NRFX

drivers/pwm/pwm_nrfx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ static int pwm_nrfx_pm_control(struct device *dev,
372372
.seq.length = NRF_PWM_CHANNEL_COUNT \
373373
}; \
374374
PWM_NRFX_PM_CONTROL(idx) \
375-
DEVICE_DEFINE(pwm_nrfx_##idx, CONFIG_PWM_##idx##_NAME, \
375+
DEVICE_DEFINE(pwm_nrfx_##idx, \
376+
DT_NORDIC_NRF_PWM_PWM_##idx##_LABEL, \
376377
pwm_nrfx_init, pwm_##idx##_nrfx_pm_control, \
377378
&pwm_nrfx_##idx##_data, \
378379
&pwm_nrfx_##idx##_config, \

0 commit comments

Comments
 (0)