Lines Matching +full:other +full:- +full:controller
4 * SPDX-License-Identifier: Apache-2.0
9 * @brief USB host controller (UHC) driver API
22 * @brief USB host controller (UHC) driver API
23 * @defgroup uhc_api USB host controller driver API
74 /** Transfer result, 0 on success, other values on error */
79 * @brief USB host controller event types
101 * Non-correctable error event, requires attention from higher
108 * USB host controller event
113 * by higher layer during controller initialization (uhc_init).
126 /** Pointer to controller's device struct */
139 * @return 0 on success, all other values should be treated as error.
145 * USB host controller capabilities
150 /** USB high speed capable controller */
155 * Controller is initialized by uhc_init()
159 * Controller is enabled and all API functions are available
166 * Mandatory structure for each UHC controller driver.
167 * To be implemented as device's private data (device->data).
170 /** Controller capabilities */
180 /** USB host controller status */
187 * @brief Checks whether the controller is initialized.
191 * @return true if controller is initialized, false otherwise
195 struct uhc_data *data = dev->data; in uhc_is_initialized()
197 return atomic_test_bit(&data->status, UHC_STATUS_INITIALIZED); in uhc_is_initialized()
201 * @brief Checks whether the controller is enabled.
205 * @return true if controller is enabled, false otherwise
209 struct uhc_data *data = dev->data; in uhc_is_enabled()
211 return atomic_test_bit(&data->status, UHC_STATUS_ENABLED); in uhc_is_enabled()
243 * Perform USB bus reset, controller may emit UHC_EVT_RESETED
248 * @return 0 on success, all other values should be treated as error.
249 * @retval -EBUSY if the controller is already performing a bus operation
253 const struct uhc_api *api = dev->api; in uhc_bus_reset()
256 api->lock(dev); in uhc_bus_reset()
257 ret = api->bus_reset(dev); in uhc_bus_reset()
258 api->unlock(dev); in uhc_bus_reset()
270 * @return 0 on success, all other values should be treated as error.
271 * @retval -EALREADY if already enabled
275 const struct uhc_api *api = dev->api; in uhc_sof_enable()
278 api->lock(dev); in uhc_sof_enable()
279 ret = api->sof_enable(dev); in uhc_sof_enable()
280 api->unlock(dev); in uhc_sof_enable()
293 * @return 0 on success, all other values should be treated as error.
294 * @retval -EALREADY if already suspended
298 const struct uhc_api *api = dev->api; in uhc_bus_suspend()
301 api->lock(dev); in uhc_bus_suspend()
302 ret = api->bus_suspend(dev); in uhc_bus_suspend()
303 api->unlock(dev); in uhc_bus_suspend()
316 * @return 0 on success, all other values should be treated as error.
317 * @retval -EBUSY if the controller is already performing a bus operation
321 const struct uhc_api *api = dev->api; in uhc_bus_resume()
324 api->lock(dev); in uhc_bus_resume()
325 ret = api->bus_resume(dev); in uhc_bus_resume()
326 api->unlock(dev); in uhc_bus_resume()
393 * @return 0 on success, all other values should be treated as error.
437 * @brief Queue USB host controller transfer
440 * can be claimed by the controller immediately.
445 * @return 0 on success, all other values should be treated as error.
446 * @retval -EPERM controller is not initialized
451 * @brief Remove a USB host controller transfers from queue
458 * @return 0 on success, all other values should be treated as error.
459 * @retval -EPERM controller is not initialized
464 * @brief Initialize USB host controller
466 * Initialize USB host controller.
471 * @return 0 on success, all other values should be treated as error.
472 * @retval -EINVAL on parameter error (no callback is passed)
473 * @retval -EALREADY already initialized
478 * @brief Enable USB host controller
480 * Enable powered USB host controller and allow host stack to
485 * @return 0 on success, all other values should be treated as error.
486 * @retval -EPERM controller is not initialized
487 * @retval -EALREADY already enabled
492 * @brief Disable USB host controller
494 * Disable enabled USB host controller.
498 * @return 0 on success, all other values should be treated as error.
499 * @retval -EALREADY already disabled
504 * @brief Poweroff USB host controller
506 * Shut down the controller completely to reduce energy consumption
507 * or to change the role of the controller.
511 * @return 0 on success, all other values should be treated as error.
512 * @retval -EALREADY controller is already uninitialized
517 * @brief Get USB host controller capabilities
519 * Obtain the capabilities of the controller
524 * @return USB host controller capabilities.
528 struct uhc_data *data = dev->data; in uhc_caps()
530 return data->caps; in uhc_caps()