@@ -25,8 +25,6 @@ struct usb_dw_stm32_clk {
25
25
size_t pclken_len ;
26
26
};
27
27
28
- #define DT_DRV_COMPAT snps_dwc2
29
-
30
28
static inline int stm32f4_fsotg_enable_clk (const struct usb_dw_stm32_clk * const clk )
31
29
{
32
30
int ret ;
@@ -94,7 +92,7 @@ static inline int stm32f4_fsotg_disable_phy(const struct device *dev)
94
92
return stm32f4_fsotg_enable_clk(&stm32f4_clk_##n); \
95
93
} \
96
94
\
97
- struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \
95
+ const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \
98
96
.pre_enable = stm32f4_fsotg_enable_clk_##n, \
99
97
.post_enable = stm32f4_fsotg_enable_phy, \
100
98
.disable = stm32f4_fsotg_disable_phy, \
@@ -104,14 +102,11 @@ static inline int stm32f4_fsotg_disable_phy(const struct device *dev)
104
102
105
103
DT_INST_FOREACH_STATUS_OKAY (QUIRK_STM32F4_FSOTG_DEFINE )
106
104
107
- #undef DT_DRV_COMPAT
108
-
109
105
#endif /*DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_fsotg) */
110
106
111
107
#if DT_HAS_COMPAT_STATUS_OKAY (nordic_nrf_usbhs )
112
108
113
- #define DT_DRV_COMPAT snps_dwc2
114
-
109
+ #include <zephyr/logging/log.h>
115
110
#include <nrfs_backend_ipc_service.h>
116
111
#include <nrfs_usb.h>
117
112
@@ -129,6 +124,7 @@ static K_EVENT_DEFINE(usbhs_events);
129
124
130
125
static void usbhs_vbus_handler (nrfs_usb_evt_t const * p_evt , void * const context )
131
126
{
127
+ LOG_MODULE_DECLARE (udc_dwc2 , CONFIG_UDC_DRIVER_LOG_LEVEL );
132
128
const struct device * dev = context ;
133
129
134
130
switch (p_evt -> type ) {
@@ -156,6 +152,7 @@ static void usbhs_vbus_handler(nrfs_usb_evt_t const *p_evt, void *const context)
156
152
157
153
static inline int usbhs_enable_nrfs_service (const struct device * dev )
158
154
{
155
+ LOG_MODULE_DECLARE (udc_dwc2 , CONFIG_UDC_DRIVER_LOG_LEVEL );
159
156
nrfs_err_t nrfs_err ;
160
157
int err ;
161
158
@@ -182,6 +179,7 @@ static inline int usbhs_enable_nrfs_service(const struct device *dev)
182
179
183
180
static inline int usbhs_enable_core (const struct device * dev )
184
181
{
182
+ LOG_MODULE_DECLARE (udc_dwc2 , CONFIG_UDC_DRIVER_LOG_LEVEL );
185
183
NRF_USBHS_Type * wrapper = USBHS_DT_WRAPPER_REG_ADDR (0 );
186
184
k_timeout_t timeout = K_FOREVER ;
187
185
@@ -229,6 +227,7 @@ static inline int usbhs_disable_core(const struct device *dev)
229
227
230
228
static inline int usbhs_disable_nrfs_service (const struct device * dev )
231
229
{
230
+ LOG_MODULE_DECLARE (udc_dwc2 , CONFIG_UDC_DRIVER_LOG_LEVEL );
232
231
nrfs_err_t nrfs_err ;
233
232
234
233
nrfs_err = nrfs_usb_disable_request ((void * )dev );
@@ -297,7 +296,7 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev)
297
296
}
298
297
299
298
#define QUIRK_NRF_USBHS_DEFINE (n ) \
300
- struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \
299
+ const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \
301
300
.init = usbhs_enable_nrfs_service, \
302
301
.pre_enable = usbhs_enable_core, \
303
302
.disable = usbhs_disable_core, \
@@ -311,8 +310,6 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev)
311
310
312
311
DT_INST_FOREACH_STATUS_OKAY (QUIRK_NRF_USBHS_DEFINE )
313
312
314
- #undef DT_DRV_COMPAT
315
-
316
313
#endif /*DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_usbhs) */
317
314
318
315
/* Add next vendor quirks definition above this line */
0 commit comments