xref: /rk3399_rockchip-uboot/include/linux/usb/otg.h (revision c637f2321bc4ce8e021571daba5bf82a677b865f)
19848e574SKishon Vijay Abraham I /* include/linux/usb/otg.h
29848e574SKishon Vijay Abraham I  *
39848e574SKishon Vijay Abraham I  * Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com
49848e574SKishon Vijay Abraham I  *
59848e574SKishon Vijay Abraham I  * USB OTG (On The Go) defines
69848e574SKishon Vijay Abraham I  *
79848e574SKishon Vijay Abraham I  * SPDX-License-Identifier:     GPL-2.0+
89848e574SKishon Vijay Abraham I  */
99848e574SKishon Vijay Abraham I 
109848e574SKishon Vijay Abraham I #ifndef __LINUX_USB_OTG_H
119848e574SKishon Vijay Abraham I #define __LINUX_USB_OTG_H
129848e574SKishon Vijay Abraham I 
13*ef78966dSKever Yang #include <dm/ofnode.h>
14*ef78966dSKever Yang 
159848e574SKishon Vijay Abraham I enum usb_dr_mode {
169848e574SKishon Vijay Abraham I 	USB_DR_MODE_UNKNOWN,
179848e574SKishon Vijay Abraham I 	USB_DR_MODE_HOST,
189848e574SKishon Vijay Abraham I 	USB_DR_MODE_PERIPHERAL,
199848e574SKishon Vijay Abraham I 	USB_DR_MODE_OTG,
209848e574SKishon Vijay Abraham I };
219848e574SKishon Vijay Abraham I 
22c0c62d92SMugunthan V N /**
23c0c62d92SMugunthan V N  * usb_get_dr_mode() - Get dual role mode for given device
24*ef78966dSKever Yang  * @node: ofnode of the given device
25c0c62d92SMugunthan V N  *
26c0c62d92SMugunthan V N  * The function gets phy interface string from property 'dr_mode',
27c0c62d92SMugunthan V N  * and returns the correspondig enum usb_dr_mode
28c0c62d92SMugunthan V N  */
29*ef78966dSKever Yang enum usb_dr_mode usb_get_dr_mode(ofnode node);
30c0c62d92SMugunthan V N 
3181cd8855SMugunthan V N /**
3281cd8855SMugunthan V N  * usb_get_maximum_speed() - Get maximum speed for given device
33*ef78966dSKever Yang  * @node: ofnode of the given device
3481cd8855SMugunthan V N  *
3581cd8855SMugunthan V N  * The function gets phy interface string from property 'maximum-speed',
3681cd8855SMugunthan V N  * and returns the correspondig enum usb_device_speed
3781cd8855SMugunthan V N  */
38*ef78966dSKever Yang enum usb_device_speed usb_get_maximum_speed(ofnode node);
3981cd8855SMugunthan V N 
409848e574SKishon Vijay Abraham I #endif /* __LINUX_USB_OTG_H */
41