Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 2 | /* |
Marek Vasut | 5d5716e | 2015-12-04 02:51:20 +0100 | [diff] [blame] | 3 | * drivers/usb/gadget/dwc2_udc.h |
Marek Vasut | e179ced | 2015-12-04 02:55:37 +0100 | [diff] [blame] | 4 | * Designware DWC2 on-chip full/high speed USB device controllers |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 5 | * Copyright (C) 2005 for Samsung Electronics |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 6 | */ |
7 | |||||
Marek Vasut | 5d5716e | 2015-12-04 02:51:20 +0100 | [diff] [blame] | 8 | #ifndef __DWC2_USB_GADGET |
9 | #define __DWC2_USB_GADGET | ||||
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 10 | |
Kever Yang | e76943c | 2019-10-16 17:13:31 +0800 | [diff] [blame] | 11 | #include <dm/ofnode.h> |
12 | |||||
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 13 | #define PHY0_SLEEP (1 << 5) |
Patrice Chotard | 763bb10 | 2019-03-29 15:42:20 +0100 | [diff] [blame] | 14 | #define DWC2_MAX_HW_ENDPOINTS 16 |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 15 | |
Marek Vasut | c098287 | 2015-12-04 02:23:29 +0100 | [diff] [blame] | 16 | struct dwc2_plat_otg_data { |
Xu Ziyuan | fab3357 | 2016-07-14 14:52:32 +0800 | [diff] [blame] | 17 | void *priv; |
Kever Yang | e76943c | 2019-10-16 17:13:31 +0800 | [diff] [blame] | 18 | ofnode phy_of_node; |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 19 | int (*phy_control)(int on); |
Philipp Tomsich | 6316272 | 2018-12-06 01:26:39 +0100 | [diff] [blame] | 20 | uintptr_t regs_phy; |
Philipp Tomsich | 92693b5 | 2017-06-06 15:42:29 +0200 | [diff] [blame] | 21 | uintptr_t regs_otg; |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 22 | unsigned int usb_phy_ctrl; |
23 | unsigned int usb_flags; | ||||
Marek Vasut | 481a11c | 2014-11-04 04:23:25 +0100 | [diff] [blame] | 24 | unsigned int usb_gusbcfg; |
Xu Ziyuan | 4711788 | 2016-07-14 14:52:33 +0800 | [diff] [blame] | 25 | unsigned int rx_fifo_sz; |
26 | unsigned int np_tx_fifo_sz; | ||||
27 | unsigned int tx_fifo_sz; | ||||
Patrice Chotard | 763bb10 | 2019-03-29 15:42:20 +0100 | [diff] [blame] | 28 | unsigned int tx_fifo_sz_array[DWC2_MAX_HW_ENDPOINTS]; |
29 | unsigned char tx_fifo_sz_nb; | ||||
Patrick Delaunay | 0fdd0bc | 2019-03-29 15:42:17 +0100 | [diff] [blame] | 30 | bool force_b_session_valid; |
Patrick Delaunay | 5739ef2 | 2020-10-15 14:49:37 +0200 | [diff] [blame] | 31 | bool force_vbus_detection; |
Patrick Delaunay | 931e9d7 | 2019-03-29 15:42:21 +0100 | [diff] [blame] | 32 | bool activate_stm_id_vb_detection; |
Lukasz Majewski | 38517a7 | 2011-10-27 10:36:46 +0200 | [diff] [blame] | 33 | }; |
Marek Vasut | 2c12ff0 | 2015-12-04 01:36:36 +0100 | [diff] [blame] | 34 | |
Marek Vasut | a4bb9b3 | 2015-12-04 02:26:33 +0100 | [diff] [blame] | 35 | int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata); |
Marek Vasut | 2c12ff0 | 2015-12-04 01:36:36 +0100 | [diff] [blame] | 36 | |
Patrick Delaunay | 2d76160 | 2019-03-29 15:42:18 +0100 | [diff] [blame] | 37 | int dwc2_udc_B_session_valid(struct udevice *dev); |
38 | |||||
Marek Vasut | 5d5716e | 2015-12-04 02:51:20 +0100 | [diff] [blame] | 39 | #endif /* __DWC2_USB_GADGET */ |