Skip to content

Commit

Permalink
drivers/usbdev_synopsys_dwc2: add ESP32x power management
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Mar 16, 2023
1 parent 6894ee4 commit d388055
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usbdev_synopsys_dwc2/usbdev_synopsys_dwc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ static void _sleep_periph(const dwc2_usb_otg_fshs_config_t *conf)
/* switch USB core clock source either to LFXO or LFRCO */
CMU_ClockSelectSet(cmuClock_USB, CLOCK_LFA);
pm_unblock(EFM32_PM_MODE_EM2);
#elif defined(MCU_ESP32)
pm_unblock(ESP_PM_LIGHT_SLEEP);
#endif
}

Expand All @@ -613,6 +615,8 @@ static void _wake_periph(const dwc2_usb_otg_fshs_config_t *conf)
#else
#error "EFM32 family not yet supported"
#endif
#elif defined(MCU_ESP32)
pm_block(ESP_PM_LIGHT_SLEEP);
#endif
*_pcgcctl_reg(conf) &= ~USB_OTG_PCGCCTL_STOPCLK;
_flush_rx_fifo(conf);
Expand Down Expand Up @@ -692,6 +696,9 @@ static void _usbdev_init(usbdev_t *dev)

#elif defined(MCU_ESP32)

pm_block(ESP_PM_DEEP_SLEEP);
pm_block(ESP_PM_LIGHT_SLEEP);

usb_phy_handle_t phy_hdl; /* only needed temporarily */

usb_phy_config_t phy_conf = {
Expand Down

0 comments on commit d388055

Please sign in to comment.