#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/prefetch.h>
#include <linux/clk.h>
#include <linux/usb/gadget.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/dma-mapping.h>
#include <linux/bcd.h>
#include <linux/version.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include "vhub.h"
#define KERNEL_REL …
#define KERNEL_VER …
enum { … };
static const struct usb_device_descriptor ast_vhub_dev_desc = …;
static const struct usb_qualifier_descriptor ast_vhub_qual_desc = …;
#define AST_VHUB_CONF_DESC_SIZE …
static const struct ast_vhub_full_cdesc ast_vhub_conf_desc = …;
#define AST_VHUB_HUB_DESC_SIZE …
static const struct usb_hub_descriptor ast_vhub_hub_desc = …;
static const struct usb_string ast_vhub_str_array[] = …;
static const struct usb_gadget_strings ast_vhub_strings = …;
static int ast_vhub_hub_dev_status(struct ast_vhub_ep *ep,
u16 wIndex, u16 wValue)
{ … }
static int ast_vhub_hub_ep_status(struct ast_vhub_ep *ep,
u16 wIndex, u16 wValue)
{ … }
static int ast_vhub_hub_dev_feature(struct ast_vhub_ep *ep,
u16 wIndex, u16 wValue,
bool is_set)
{ … }
static int ast_vhub_hub_ep_feature(struct ast_vhub_ep *ep,
u16 wIndex, u16 wValue,
bool is_set)
{ … }
static int ast_vhub_rep_desc(struct ast_vhub_ep *ep,
u8 desc_type, u16 len)
{ … }
static struct usb_gadget_strings*
ast_vhub_str_of_container(struct usb_gadget_string_container *container)
{ … }
static int ast_vhub_collect_languages(struct ast_vhub *vhub, void *buf,
size_t size)
{ … }
static struct usb_gadget_strings *ast_vhub_lookup_string(struct ast_vhub *vhub,
u16 lang_id)
{ … }
static int ast_vhub_rep_string(struct ast_vhub_ep *ep,
u8 string_id, u16 lang_id,
u16 len)
{ … }
enum std_req_rc ast_vhub_std_hub_request(struct ast_vhub_ep *ep,
struct usb_ctrlrequest *crq)
{ … }
static void ast_vhub_update_hub_ep1(struct ast_vhub *vhub,
unsigned int port)
{ … }
static void ast_vhub_change_port_stat(struct ast_vhub *vhub,
unsigned int port,
u16 clr_flags,
u16 set_flags,
bool set_c)
{ … }
static void ast_vhub_send_host_wakeup(struct ast_vhub *vhub)
{ … }
void ast_vhub_device_connect(struct ast_vhub *vhub,
unsigned int port, bool on)
{ … }
static void ast_vhub_wake_work(struct work_struct *work)
{ … }
void ast_vhub_hub_wake_all(struct ast_vhub *vhub)
{ … }
static void ast_vhub_port_reset(struct ast_vhub *vhub, u8 port)
{ … }
static enum std_req_rc ast_vhub_set_port_feature(struct ast_vhub_ep *ep,
u8 port, u16 feat)
{ … }
static enum std_req_rc ast_vhub_clr_port_feature(struct ast_vhub_ep *ep,
u8 port, u16 feat)
{ … }
static enum std_req_rc ast_vhub_get_port_stat(struct ast_vhub_ep *ep,
u8 port)
{ … }
enum std_req_rc ast_vhub_class_hub_request(struct ast_vhub_ep *ep,
struct usb_ctrlrequest *crq)
{ … }
void ast_vhub_hub_suspend(struct ast_vhub *vhub)
{ … }
void ast_vhub_hub_resume(struct ast_vhub *vhub)
{ … }
void ast_vhub_hub_reset(struct ast_vhub *vhub)
{ … }
static void ast_vhub_of_parse_dev_desc(struct ast_vhub *vhub,
const struct device_node *vhub_np)
{ … }
static void ast_vhub_fixup_usb1_dev_desc(struct ast_vhub *vhub)
{ … }
static struct usb_gadget_string_container*
ast_vhub_str_container_alloc(struct ast_vhub *vhub)
{ … }
static void ast_vhub_str_deep_copy(struct usb_gadget_strings *dest,
const struct usb_gadget_strings *src)
{ … }
static int ast_vhub_str_alloc_add(struct ast_vhub *vhub,
const struct usb_gadget_strings *src_str)
{ … }
static const struct { … } str_id_map[] = …;
static int ast_vhub_of_parse_str_desc(struct ast_vhub *vhub,
const struct device_node *desc_np)
{ … }
static int ast_vhub_init_desc(struct ast_vhub *vhub)
{ … }
int ast_vhub_init_hub(struct ast_vhub *vhub)
{ … }