Lines Matching +full:vbus +full:- +full:detect

2  * Copyright (c) 2021-2022 Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
45 /** Controller can detect the state change of USB supply VBUS.*/
79 /** High-Bandwidth (interrupt or iso) capable endpoint */
132 /** VBUS ready event. Signals that VBUS is in stable condition. */
134 /** VBUS removed event. Signals that VBUS is below the valid range. */
147 * Non-correctable error event, requires attention from higher
257 * Controller is initialized by udc_init() and can generate the VBUS events,
273 * To be implemented as device's private data (device->data).
314 struct udc_data *data = dev->data; in udc_is_initialized()
316 return atomic_test_bit(&data->status, UDC_STATUS_INITIALIZED); in udc_is_initialized()
328 struct udc_data *data = dev->data; in udc_is_enabled()
330 return atomic_test_bit(&data->status, UDC_STATUS_ENABLED); in udc_is_enabled()
342 struct udc_data *data = dev->data; in udc_is_suspended()
344 return atomic_test_bit(&data->status, UDC_STATUS_SUSPENDED); in udc_is_suspended()
351 * After initialization controller driver should be able to detect
359 * @retval -EINVAL on parameter error (no callback is passed)
360 * @retval -EALREADY already initialized
374 * @retval -EPERM controller is not initialized
375 * @retval -EALREADY already enabled
376 * @retval -ETIMEDOUT enable operation timed out
384 * The driver should continue to detect power state changes.
389 * @retval -EALREADY already disabled
402 * @retval -EALREADY controller is not initialized
418 struct udc_data *data = dev->data; in udc_caps()
420 return data->caps; in udc_caps()
444 * @retval -EPERM controller is not enabled (or not initialized)
448 const struct udc_api *api = dev->api; in udc_set_address()
452 return -EPERM; in udc_set_address()
455 api->lock(dev); in udc_set_address()
456 ret = api->set_address(dev, addr); in udc_set_address()
457 api->unlock(dev); in udc_set_address()
465 * For compliance testing, high-speed controllers must support test modes.
475 * @retval -ENOTSUP Test mode is not supported
480 const struct udc_api *api = dev->api; in udc_test_mode()
484 return -EPERM; in udc_test_mode()
487 if (api->test_mode != NULL) { in udc_test_mode()
488 api->lock(dev); in udc_test_mode()
489 ret = api->test_mode(dev, mode, dryrun); in udc_test_mode()
490 api->unlock(dev); in udc_test_mode()
492 ret = -ENOTSUP; in udc_test_mode()
506 * @retval -EPERM controller is not enabled (or not initialized)
510 const struct udc_api *api = dev->api; in udc_host_wakeup()
514 return -EPERM; in udc_host_wakeup()
517 api->lock(dev); in udc_host_wakeup()
518 ret = api->host_wakeup(dev); in udc_host_wakeup()
519 api->unlock(dev); in udc_host_wakeup()
541 * @retval -EINVAL on wrong parameter
542 * @retval -ENOTSUP endpoint configuration not supported
543 * @retval -ENODEV no endpoints available
564 * @retval -EINVAL on wrong parameter (control IN/OUT endpoint)
565 * @retval -EPERM controller is not initialized
566 * @retval -ENODEV endpoint configuration not found
567 * @retval -EALREADY endpoint is already enabled
584 * @retval -EINVAL on wrong parameter (control IN/OUT endpoint)
585 * @retval -ENODEV endpoint configuration not found
586 * @retval -EALREADY endpoint is already disabled
587 * @retval -EPERM controller is not initialized
600 * @retval -ENODEV endpoint configuration not found
601 * @retval -ENOTSUP not supported (e.g. isochronous endpoint)
602 * @retval -EPERM controller is not enabled
615 * @retval -ENODEV endpoint configuration not found
616 * @retval -ENOTSUP not supported (e.g. isochronous endpoint)
617 * @retval -EPERM controller is not enabled
631 * @retval -ENODEV endpoint configuration not found
632 * @retval -EACCES endpoint is not enabled (TBD)
633 * @retval -EBUSY request can not be queued
634 * @retval -EPERM controller is not initialized
650 * @retval -ENODEV endpoint configuration not found
651 * @retval -EACCES endpoint is not disabled
652 * @retval -EPERM controller is not initialized
696 if (USB_EP_DIR_IS_IN(bi->ep)) { in udc_ep_buf_set_zlp()
697 bi->zlp = 1; in udc_ep_buf_set_zlp()
727 struct udc_data *data = dev->data; in udc_get_event_ctx()
729 return data->event_ctx; in udc_get_event_ctx()
741 return USB_MPS_EP_SIZE(cfg->mps); in udc_mps_ep_size()