feat(usb_host): Add power and clock gating LL, HAL

- part of suspend/resume (remote wakeup) sequences
This commit is contained in:
peter.marcisovsky
2025-11-18 19:01:40 +08:00
committed by BOT
parent 4127eca058
commit e23ae40fde
5 changed files with 156 additions and 0 deletions
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "esp_attr.h"
#include "soc/usb_dwc_struct.h"
#include "soc/usb_dwc_cfg.h"
#include "hal/usb_dwc_types.h"
@@ -975,6 +976,32 @@ static inline void usb_dwc_ll_qtd_get_status(usb_dwc_ll_dma_qtd_t *qtd, int *rem
qtd->buffer_status_val = 0;
}
// ---------------------------- Power and Clock Gating Register --------------------------------
FORCE_INLINE_ATTR void usb_dwc_ll_set_stoppclk(usb_dwc_dev_t *hw, bool stop)
{
hw->pcgcctl_reg.stoppclk = stop;
}
FORCE_INLINE_ATTR bool usb_dwc_ll_get_stoppclk_st(usb_dwc_dev_t *hw)
{
return hw->pcgcctl_reg.stoppclk;
}
FORCE_INLINE_ATTR void usb_dwc_ll_set_gatehclk(usb_dwc_dev_t *hw, bool gate)
{
hw->pcgcctl_reg.gatehclk = gate;
}
FORCE_INLINE_ATTR bool usb_dwc_ll_get_gatehclk_st(usb_dwc_dev_t *hw)
{
return hw->pcgcctl_reg.gatehclk;
}
FORCE_INLINE_ATTR bool usb_dwc_ll_get_physleep_st(usb_dwc_dev_t *hw)
{
return hw->pcgcctl_reg.physleep;
}
#ifdef __cplusplus
}
#endif