Jagan Teki | 6b7ebff | 2019-11-19 13:56:20 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * USB PHY defines |
| 4 | * |
| 5 | * These APIs may be used between USB controllers. USB device drivers |
| 6 | * (for either host or peripheral roles) don't use these calls; they |
| 7 | * continue to use just usb_device and usb_gadget. |
| 8 | */ |
| 9 | |
| 10 | #ifndef __LINUX_USB_PHY_H |
| 11 | #define __LINUX_USB_PHY_H |
| 12 | |
Frank Wang | 6469794 | 2020-05-26 11:34:30 +0800 | [diff] [blame] | 13 | #include <dm/ofnode.h> |
| 14 | |
Jagan Teki | 6b7ebff | 2019-11-19 13:56:20 +0530 | [diff] [blame] | 15 | enum usb_phy_interface { |
| 16 | USBPHY_INTERFACE_MODE_UNKNOWN, |
| 17 | USBPHY_INTERFACE_MODE_UTMI, |
| 18 | USBPHY_INTERFACE_MODE_UTMIW, |
Matthias Schiffer | 950cb1f | 2021-09-20 15:37:22 +0200 | [diff] [blame] | 19 | USBPHY_INTERFACE_MODE_ULPI, |
| 20 | USBPHY_INTERFACE_MODE_SERIAL, |
| 21 | USBPHY_INTERFACE_MODE_HSIC, |
Jagan Teki | 6b7ebff | 2019-11-19 13:56:20 +0530 | [diff] [blame] | 22 | }; |
| 23 | |
Frank Wang | 6469794 | 2020-05-26 11:34:30 +0800 | [diff] [blame] | 24 | #if CONFIG_IS_ENABLED(DM_USB) |
| 25 | /** |
| 26 | * usb_get_phy_mode - Get phy mode for given device_node |
| 27 | * @np: Pointer to the given device_node |
| 28 | * |
| 29 | * The function gets phy interface string from property 'phy_type', |
| 30 | * and returns the corresponding enum usb_phy_interface |
| 31 | */ |
| 32 | enum usb_phy_interface usb_get_phy_mode(ofnode node); |
| 33 | #else |
| 34 | static inline enum usb_phy_interface usb_get_phy_mode(ofnode node) |
| 35 | { |
| 36 | return USBPHY_INTERFACE_MODE_UNKNOWN; |
| 37 | } |
| 38 | #endif |
| 39 | |
Jagan Teki | 6b7ebff | 2019-11-19 13:56:20 +0530 | [diff] [blame] | 40 | #endif /* __LINUX_USB_PHY_H */ |