Skip to content

Commit 42d75b0

Browse files
committed
[nrf fromtree] drivers: udc_dwc2: Control D+ pull-up on nRF54H20
Disable D+ pull-up on core disable to make sure that device does not indicate its presence to host before the stack is ready (software initializes controller and clears SftDiscon bit). Signed-off-by: Tomasz Moń <[email protected]> (cherry picked from commit 0748b4e)
1 parent 9a699b5 commit 42d75b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/usb/udc/udc_dwc2_vendor_quirks.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,21 @@ static inline int usbhs_enable_core(const struct device *dev)
213213
return 0;
214214
}
215215

216+
static inline int usbhs_enable_pullup(const struct device *dev)
217+
{
218+
/* Core is ready to handle connection, enable D+ pull-up */
219+
nrfs_usb_dplus_pullup_enable((void *)dev);
220+
221+
return 0;
222+
}
223+
216224
static inline int usbhs_disable_core(const struct device *dev)
217225
{
218226
NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0);
219227

228+
/* Disable D+ pull-up until next post enable quirk */
229+
nrfs_usb_dplus_pullup_disable((void *)dev);
230+
220231
/* Disable interrupts */
221232
wrapper->INTENCLR = 1UL;
222233

@@ -299,6 +310,7 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev)
299310
const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \
300311
.init = usbhs_enable_nrfs_service, \
301312
.pre_enable = usbhs_enable_core, \
313+
.post_enable = usbhs_enable_pullup, \
302314
.disable = usbhs_disable_core, \
303315
.shutdown = usbhs_disable_nrfs_service, \
304316
.irq_clear = usbhs_irq_clear, \

0 commit comments

Comments
 (0)