Skip to content

Commit

Permalink
[nrf fromlist] drivers: usb_dc_nrfx: Correct the nrfx_power [...]
Browse files Browse the repository at this point in the history
driver configuration

Upstream PR: #29409

The initial configuration provided for the nrfx_power driver cannot
contain just default values, as that mean that DC/DC converters are
to be disabled, while those converters may be (and they actually are
by default for many boards) enabled through Kconfig.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
  • Loading branch information
anangl authored and carlescufi committed Oct 26, 2020
1 parent d910949 commit 6761718
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/usb/device/usb_dc_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1950,8 +1950,13 @@ static int usb_init(const struct device *arg)
irq_enable(USBREGULATOR_IRQn);
#endif

/* Use default configuration of the nrfx_power driver. */
static const nrfx_power_config_t power_config = { 0 };
static const nrfx_power_config_t power_config = {
.dcdcen = IS_ENABLED(CONFIG_SOC_DCDC_NRF52X) ||
IS_ENABLED(CONFIG_SOC_DCDC_NRF53X_APP),
#if NRFX_POWER_SUPPORTS_DCDCEN_VDDH
.dcdcenhv = IS_ENABLED(CONFIG_SOC_DCDC_NRF53X_HV),
#endif
};

static const nrfx_power_usbevt_config_t usbevt_config = {
.handler = usb_dc_power_event_handler
Expand Down

0 comments on commit 6761718

Please sign in to comment.