File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed
TARGET_RENESAS/TARGET_RZ_A1XX Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ USBPhy *get_usb_phy()
106106 return &usbphy;
107107}
108108
109- USBPhyHw::USBPhyHw ()
109+ USBPhyHw::USBPhyHw (): events( NULL )
110110{
111111
112112}
@@ -117,6 +117,9 @@ USBPhyHw::~USBPhyHw()
117117
118118void USBPhyHw::init (USBPhyEvents *events)
119119{
120+ if (this ->events == NULL ) {
121+ sleep_manager_lock_deep_sleep ();
122+ }
120123 this ->events = events;
121124
122125 // Disable IRQ
@@ -183,6 +186,11 @@ void USBPhyHw::deinit()
183186 disconnect ();
184187 NVIC_DisableIRQ (USB0_IRQn);
185188 USB0->INTEN = 0 ;
189+
190+ if (events != NULL ) {
191+ sleep_manager_unlock_deep_sleep ();
192+ }
193+ events = NULL ;
186194}
187195
188196bool USBPhyHw::powered ()
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ USBPhy *get_usb_phy()
369369 return &usbphy;
370370}
371371
372- USBPhyHw::USBPhyHw (void )
372+ USBPhyHw::USBPhyHw (void ): events( NULL )
373373{
374374
375375}
@@ -381,6 +381,9 @@ USBPhyHw::~USBPhyHw(void)
381381
382382void USBPhyHw::init (USBPhyEvents *events)
383383{
384+ if (this ->events == NULL ) {
385+ sleep_manager_lock_deep_sleep ();
386+ }
384387 this ->events = events;
385388
386389 // Disable IRQ
@@ -440,6 +443,11 @@ void USBPhyHw::deinit()
440443 NVIC_DisableIRQ (USB_IRQn);
441444 events = NULL ;
442445 opStarted = 0 ;
446+
447+ if (events != NULL ) {
448+ sleep_manager_unlock_deep_sleep ();
449+ }
450+ events = NULL ;
443451}
444452
445453bool USBPhyHw::powered ()
Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ void USBPhyHw::init(USBPhyEvents *events)
128128{
129129 volatile uint8_t dummy_read;
130130
131+ if (this ->events == NULL ) {
132+ sleep_manager_lock_deep_sleep ();
133+ }
131134 this ->events = events;
132135
133136 /* registers me */
@@ -174,6 +177,11 @@ void USBPhyHw::deinit()
174177#endif
175178 dummy_read = CPG.STBCR7 ;
176179 (void )dummy_read;
180+
181+ if (events != NULL ) {
182+ sleep_manager_unlock_deep_sleep ();
183+ }
184+ events = NULL ;
177185}
178186
179187bool USBPhyHw::powered ()
Original file line number Diff line number Diff line change @@ -168,6 +168,9 @@ void USBPhyHw::init(USBPhyEvents *events)
168168{
169169 NVIC_DisableIRQ (USBHAL_IRQn);
170170
171+ if (this ->events == NULL ) {
172+ sleep_manager_lock_deep_sleep ();
173+ }
171174 this ->events = events;
172175 sof_enabled = false ;
173176 memset (epComplete, 0 , sizeof (epComplete));
@@ -333,6 +336,11 @@ void USBPhyHw::deinit()
333336{
334337 HAL_PCD_DeInit (&hpcd);
335338 NVIC_DisableIRQ (USBHAL_IRQn);
339+
340+ if (events != NULL ) {
341+ sleep_manager_unlock_deep_sleep ();
342+ }
343+ events = NULL ;
336344}
337345
338346bool USBPhyHw::powered ()
You can’t perform that action at this time.
0 commit comments