Lines Matching refs:uhs_ctx
14 int usbh_init(struct usbh_contex *uhs_ctx) in usbh_init() argument
18 k_mutex_lock(&uhs_ctx->mutex, K_FOREVER); in usbh_init()
20 if (!device_is_ready(uhs_ctx->dev)) { in usbh_init()
26 if (uhc_is_initialized(uhs_ctx->dev)) { in usbh_init()
32 ret = usbh_init_device_intl(uhs_ctx); in usbh_init()
35 k_mutex_unlock(&uhs_ctx->mutex); in usbh_init()
39 int usbh_enable(struct usbh_contex *uhs_ctx) in usbh_enable() argument
43 k_mutex_lock(&uhs_ctx->mutex, K_FOREVER); in usbh_enable()
45 if (!uhc_is_initialized(uhs_ctx->dev)) { in usbh_enable()
51 if (uhc_is_enabled(uhs_ctx->dev)) { in usbh_enable()
57 ret = uhc_enable(uhs_ctx->dev); in usbh_enable()
64 k_mutex_unlock(&uhs_ctx->mutex); in usbh_enable()
68 int usbh_disable(struct usbh_contex *uhs_ctx) in usbh_disable() argument
72 if (!uhc_is_enabled(uhs_ctx->dev)) { in usbh_disable()
77 k_mutex_lock(&uhs_ctx->mutex, K_FOREVER); in usbh_disable()
79 ret = uhc_disable(uhs_ctx->dev); in usbh_disable()
84 k_mutex_unlock(&uhs_ctx->mutex); in usbh_disable()
89 int usbh_shutdown(struct usbh_contex *const uhs_ctx) in usbh_shutdown() argument
93 k_mutex_lock(&uhs_ctx->mutex, K_FOREVER); in usbh_shutdown()
95 ret = uhc_shutdown(uhs_ctx->dev); in usbh_shutdown()
100 k_mutex_unlock(&uhs_ctx->mutex); in usbh_shutdown()