fix(esp_hw_support): fix P4 v3.0 USB leakage on PU_CNNT lightsleep

This commit is contained in:
wuzhenghui
2025-11-04 16:03:29 +08:00
parent df78f0a5f0
commit 1956ea5ac2
2 changed files with 27 additions and 1 deletions
@@ -1011,6 +1011,28 @@ static inline void usb_dwc_ll_qtd_get_status(usb_dwc_ll_dma_qtd_t *qtd, int *rem
qtd->buffer_status_val = 0;
}
/**
* @brief Get the current BVALID override configuration.
*
* @param[out] Get the current BVALID override configuration.
*/
FORCE_INLINE_ATTR bool usb_dwc_ll_get_bvalid_override(usb_dwc_dev_t *hw)
{
return hw->gotgctl_reg.bvalidoven;
}
/**
* @brief Enable BVALID override in USB OTG controller.
*
* When enabled, the controller ignores the hardware-detected VBUS BVALID signal
* and uses the software-defined override value instead. This is typically used
* to reduce USB leakage current during sleep by forcing BVALID low.
*/
FORCE_INLINE_ATTR void usb_dwc_ll_enable_bvalid_override(usb_dwc_dev_t *hw, bool override)
{
hw->gotgctl_reg.bvalidoven = override;
}
// ---------------------------- Power and Clock Gating Register --------------------------------
FORCE_INLINE_ATTR void usb_dwc_ll_set_stoppclk(usb_dwc_dev_t *hw, bool stop)
{