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()
106
106
return &usbphy;
107
107
}
108
108
109
- USBPhyHw::USBPhyHw ()
109
+ USBPhyHw::USBPhyHw (): events( NULL )
110
110
{
111
111
112
112
}
@@ -117,6 +117,9 @@ USBPhyHw::~USBPhyHw()
117
117
118
118
void USBPhyHw::init (USBPhyEvents *events)
119
119
{
120
+ if (this ->events == NULL ) {
121
+ sleep_manager_lock_deep_sleep ();
122
+ }
120
123
this ->events = events;
121
124
122
125
// Disable IRQ
@@ -183,6 +186,11 @@ void USBPhyHw::deinit()
183
186
disconnect ();
184
187
NVIC_DisableIRQ (USB0_IRQn);
185
188
USB0->INTEN = 0 ;
189
+
190
+ if (events != NULL ) {
191
+ sleep_manager_unlock_deep_sleep ();
192
+ }
193
+ events = NULL ;
186
194
}
187
195
188
196
bool USBPhyHw::powered ()
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ USBPhy *get_usb_phy()
369
369
return &usbphy;
370
370
}
371
371
372
- USBPhyHw::USBPhyHw (void )
372
+ USBPhyHw::USBPhyHw (void ): events( NULL )
373
373
{
374
374
375
375
}
@@ -381,6 +381,9 @@ USBPhyHw::~USBPhyHw(void)
381
381
382
382
void USBPhyHw::init (USBPhyEvents *events)
383
383
{
384
+ if (this ->events == NULL ) {
385
+ sleep_manager_lock_deep_sleep ();
386
+ }
384
387
this ->events = events;
385
388
386
389
// Disable IRQ
@@ -440,6 +443,11 @@ void USBPhyHw::deinit()
440
443
NVIC_DisableIRQ (USB_IRQn);
441
444
events = NULL ;
442
445
opStarted = 0 ;
446
+
447
+ if (events != NULL ) {
448
+ sleep_manager_unlock_deep_sleep ();
449
+ }
450
+ events = NULL ;
443
451
}
444
452
445
453
bool USBPhyHw::powered ()
Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ void USBPhyHw::init(USBPhyEvents *events)
128
128
{
129
129
volatile uint8_t dummy_read;
130
130
131
+ if (this ->events == NULL ) {
132
+ sleep_manager_lock_deep_sleep ();
133
+ }
131
134
this ->events = events;
132
135
133
136
/* registers me */
@@ -174,6 +177,11 @@ void USBPhyHw::deinit()
174
177
#endif
175
178
dummy_read = CPG.STBCR7 ;
176
179
(void )dummy_read;
180
+
181
+ if (events != NULL ) {
182
+ sleep_manager_unlock_deep_sleep ();
183
+ }
184
+ events = NULL ;
177
185
}
178
186
179
187
bool USBPhyHw::powered ()
Original file line number Diff line number Diff line change @@ -168,6 +168,9 @@ void USBPhyHw::init(USBPhyEvents *events)
168
168
{
169
169
NVIC_DisableIRQ (USBHAL_IRQn);
170
170
171
+ if (this ->events == NULL ) {
172
+ sleep_manager_lock_deep_sleep ();
173
+ }
171
174
this ->events = events;
172
175
sof_enabled = false ;
173
176
memset (epComplete, 0 , sizeof (epComplete));
@@ -333,6 +336,11 @@ void USBPhyHw::deinit()
333
336
{
334
337
HAL_PCD_DeInit (&hpcd);
335
338
NVIC_DisableIRQ (USBHAL_IRQn);
339
+
340
+ if (events != NULL ) {
341
+ sleep_manager_unlock_deep_sleep ();
342
+ }
343
+ events = NULL ;
336
344
}
337
345
338
346
bool USBPhyHw::powered ()
You can’t perform that action at this time.
0 commit comments