blob: 1e1217a95834eaa4998f7e81f646b696782f51bd [file] [log] [blame]
Jagan Teki106c71f2019-11-19 13:56:20 +05301/* 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 Wanga4a29122020-05-26 11:34:30 +080013#include <dm/ofnode.h>
14
Jagan Teki106c71f2019-11-19 13:56:20 +053015enum usb_phy_interface {
16 USBPHY_INTERFACE_MODE_UNKNOWN,
17 USBPHY_INTERFACE_MODE_UTMI,
18 USBPHY_INTERFACE_MODE_UTMIW,
19};
20
Frank Wanga4a29122020-05-26 11:34:30 +080021#if CONFIG_IS_ENABLED(DM_USB)
22/**
23 * usb_get_phy_mode - Get phy mode for given device_node
24 * @np: Pointer to the given device_node
25 *
26 * The function gets phy interface string from property 'phy_type',
27 * and returns the corresponding enum usb_phy_interface
28 */
29enum usb_phy_interface usb_get_phy_mode(ofnode node);
30#else
31static inline enum usb_phy_interface usb_get_phy_mode(ofnode node)
32{
33 return USBPHY_INTERFACE_MODE_UNKNOWN;
34}
35#endif
36
Jagan Teki106c71f2019-11-19 13:56:20 +053037#endif /* __LINUX_USB_PHY_H */