2018-05-07 05:58:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2011-10-27 16:36:46 +08:00
|
|
|
/*
|
2015-12-04 09:51:20 +08:00
|
|
|
* drivers/usb/gadget/dwc2_udc.h
|
2015-12-04 09:55:37 +08:00
|
|
|
* Designware DWC2 on-chip full/high speed USB device controllers
|
2011-10-27 16:36:46 +08:00
|
|
|
* Copyright (C) 2005 for Samsung Electronics
|
|
|
|
*/
|
|
|
|
|
2015-12-04 09:51:20 +08:00
|
|
|
#ifndef __DWC2_USB_GADGET
|
|
|
|
#define __DWC2_USB_GADGET
|
2011-10-27 16:36:46 +08:00
|
|
|
|
2019-10-16 17:13:31 +08:00
|
|
|
#include <dm/ofnode.h>
|
|
|
|
|
2011-10-27 16:36:46 +08:00
|
|
|
#define PHY0_SLEEP (1 << 5)
|
2019-03-29 22:42:20 +08:00
|
|
|
#define DWC2_MAX_HW_ENDPOINTS 16
|
2011-10-27 16:36:46 +08:00
|
|
|
|
2015-12-04 09:23:29 +08:00
|
|
|
struct dwc2_plat_otg_data {
|
2016-07-14 14:52:32 +08:00
|
|
|
void *priv;
|
2019-10-16 17:13:31 +08:00
|
|
|
ofnode phy_of_node;
|
2011-10-27 16:36:46 +08:00
|
|
|
int (*phy_control)(int on);
|
2018-12-06 08:26:39 +08:00
|
|
|
uintptr_t regs_phy;
|
2017-06-06 21:42:29 +08:00
|
|
|
uintptr_t regs_otg;
|
2011-10-27 16:36:46 +08:00
|
|
|
unsigned int usb_phy_ctrl;
|
|
|
|
unsigned int usb_flags;
|
2014-11-04 11:23:25 +08:00
|
|
|
unsigned int usb_gusbcfg;
|
2016-07-14 14:52:33 +08:00
|
|
|
unsigned int rx_fifo_sz;
|
|
|
|
unsigned int np_tx_fifo_sz;
|
|
|
|
unsigned int tx_fifo_sz;
|
2019-03-29 22:42:20 +08:00
|
|
|
unsigned int tx_fifo_sz_array[DWC2_MAX_HW_ENDPOINTS];
|
|
|
|
unsigned char tx_fifo_sz_nb;
|
2019-03-29 22:42:17 +08:00
|
|
|
bool force_b_session_valid;
|
2020-10-15 20:49:37 +08:00
|
|
|
bool force_vbus_detection;
|
2019-03-29 22:42:21 +08:00
|
|
|
bool activate_stm_id_vb_detection;
|
2011-10-27 16:36:46 +08:00
|
|
|
};
|
2015-12-04 08:36:36 +08:00
|
|
|
|
2015-12-04 09:26:33 +08:00
|
|
|
int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata);
|
2015-12-04 08:36:36 +08:00
|
|
|
|
2019-03-29 22:42:18 +08:00
|
|
|
int dwc2_udc_B_session_valid(struct udevice *dev);
|
|
|
|
|
2015-12-04 09:51:20 +08:00
|
|
|
#endif /* __DWC2_USB_GADGET */
|