Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Kishon Vijay Abraham I | c2b77b6 | 2015-02-23 18:39:54 +0530 | [diff] [blame] | 2 | /* include/linux/usb/otg.h |
| 3 | * |
Nishanth Menon | eaa39c6 | 2023-11-01 15:56:03 -0500 | [diff] [blame] | 4 | * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com |
Kishon Vijay Abraham I | c2b77b6 | 2015-02-23 18:39:54 +0530 | [diff] [blame] | 5 | * |
| 6 | * USB OTG (On The Go) defines |
Kishon Vijay Abraham I | c2b77b6 | 2015-02-23 18:39:54 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __LINUX_USB_OTG_H |
| 10 | #define __LINUX_USB_OTG_H |
| 11 | |
Kever Yang | 1b80705 | 2020-03-04 08:59:50 +0800 | [diff] [blame] | 12 | #include <dm/ofnode.h> |
| 13 | |
Kishon Vijay Abraham I | c2b77b6 | 2015-02-23 18:39:54 +0530 | [diff] [blame] | 14 | enum 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 N | 1a54713 | 2016-04-12 16:01:19 +0530 | [diff] [blame] | 21 | /** |
| 22 | * usb_get_dr_mode() - Get dual role mode for given device |
Kever Yang | 1b80705 | 2020-03-04 08:59:50 +0800 | [diff] [blame] | 23 | * @node: ofnode of the given device |
Mugunthan V N | 1a54713 | 2016-04-12 16:01:19 +0530 | [diff] [blame] | 24 | * |
| 25 | * The function gets phy interface string from property 'dr_mode', |
| 26 | * and returns the correspondig enum usb_dr_mode |
| 27 | */ |
Kever Yang | 1b80705 | 2020-03-04 08:59:50 +0800 | [diff] [blame] | 28 | enum usb_dr_mode usb_get_dr_mode(ofnode node); |
Mugunthan V N | 1a54713 | 2016-04-12 16:01:19 +0530 | [diff] [blame] | 29 | |
Mugunthan V N | 58d8fbe | 2018-05-18 13:15:05 +0200 | [diff] [blame] | 30 | /** |
Mark Kettenis | 5732eae | 2022-04-19 21:06:33 +0200 | [diff] [blame] | 31 | * 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 | */ |
| 38 | enum usb_dr_mode usb_get_role_switch_default_mode(ofnode node); |
| 39 | |
| 40 | /** |
Mugunthan V N | 58d8fbe | 2018-05-18 13:15:05 +0200 | [diff] [blame] | 41 | * usb_get_maximum_speed() - Get maximum speed for given device |
Kever Yang | 1b80705 | 2020-03-04 08:59:50 +0800 | [diff] [blame] | 42 | * @node: ofnode of the given device |
Mugunthan V N | 58d8fbe | 2018-05-18 13:15:05 +0200 | [diff] [blame] | 43 | * |
| 44 | * The function gets phy interface string from property 'maximum-speed', |
| 45 | * and returns the correspondig enum usb_device_speed |
| 46 | */ |
Kever Yang | 1b80705 | 2020-03-04 08:59:50 +0800 | [diff] [blame] | 47 | enum usb_device_speed usb_get_maximum_speed(ofnode node); |
Mugunthan V N | 58d8fbe | 2018-05-18 13:15:05 +0200 | [diff] [blame] | 48 | |
Kishon Vijay Abraham I | c2b77b6 | 2015-02-23 18:39:54 +0530 | [diff] [blame] | 49 | #endif /* __LINUX_USB_OTG_H */ |