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