blob: e7e3d259cae521c439d7b02788fae3b8e7d2a930 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Kishon Vijay Abraham Ic2b77b62015-02-23 18:39:54 +05302/* include/linux/usb/otg.h
3 *
Nishanth Menoneaa39c62023-11-01 15:56:03 -05004 * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com
Kishon Vijay Abraham Ic2b77b62015-02-23 18:39:54 +05305 *
6 * USB OTG (On The Go) defines
Kishon Vijay Abraham Ic2b77b62015-02-23 18:39:54 +05307 */
8
9#ifndef __LINUX_USB_OTG_H
10#define __LINUX_USB_OTG_H
11
Kever Yang1b807052020-03-04 08:59:50 +080012#include <dm/ofnode.h>
13
Kishon Vijay Abraham Ic2b77b62015-02-23 18:39:54 +053014enum usb_dr_mode {
15 USB_DR_MODE_UNKNOWN,
16 USB_DR_MODE_HOST,
17 USB_DR_MODE_PERIPHERAL,
18 USB_DR_MODE_OTG,
19};
20
Mugunthan V N1a547132016-04-12 16:01:19 +053021/**
22 * usb_get_dr_mode() - Get dual role mode for given device
Kever Yang1b807052020-03-04 08:59:50 +080023 * @node: ofnode of the given device
Mugunthan V N1a547132016-04-12 16:01:19 +053024 *
25 * The function gets phy interface string from property 'dr_mode',
26 * and returns the correspondig enum usb_dr_mode
27 */
Kever Yang1b807052020-03-04 08:59:50 +080028enum usb_dr_mode usb_get_dr_mode(ofnode node);
Mugunthan V N1a547132016-04-12 16:01:19 +053029
Mugunthan V N58d8fbe2018-05-18 13:15:05 +020030/**
Mark Kettenis5732eae2022-04-19 21:06:33 +020031 * usb_get_dr_mode() - Get dual role mode for given device
32 * @node: ofnode of the given device
33 *
34 * The function gets phy interface string from property
35 * 'role-switch-defaulr-mode', and returns the correspondig enum
36 * usb_dr_mode
37 */
38enum usb_dr_mode usb_get_role_switch_default_mode(ofnode node);
39
40/**
Mugunthan V N58d8fbe2018-05-18 13:15:05 +020041 * usb_get_maximum_speed() - Get maximum speed for given device
Kever Yang1b807052020-03-04 08:59:50 +080042 * @node: ofnode of the given device
Mugunthan V N58d8fbe2018-05-18 13:15:05 +020043 *
44 * The function gets phy interface string from property 'maximum-speed',
45 * and returns the correspondig enum usb_device_speed
46 */
Kever Yang1b807052020-03-04 08:59:50 +080047enum usb_device_speed usb_get_maximum_speed(ofnode node);
Mugunthan V N58d8fbe2018-05-18 13:15:05 +020048
Kishon Vijay Abraham Ic2b77b62015-02-23 18:39:54 +053049#endif /* __LINUX_USB_OTG_H */