Welcome to mirror list, hosted at ThFree Co, Russian Federation.

usb_msg_center.h « manager « sunxi_usb « usb « drivers - github.com/ClusterM/sun-nontendocm-kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c4486e691618cbfa911c05a8a7d065ccc89c8805 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * drivers/usb/sunxi_usb/manager/usb_msg_center.h
 * (C) Copyright 2010-2015
 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
 * javen, 2011-4-14, create this file
 *
 * usb msg distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 */

#ifndef  __USB_MSG_CENTER_H__
#define  __USB_MSG_CENTER_H__

/* usb role mode */
typedef enum usb_role{
	USB_ROLE_NULL = 0,
	USB_ROLE_HOST,
	USB_ROLE_DEVICE,
}usb_role_t;

typedef struct usb_msg{
	u8  app_drv_null;		//not install any driver
	u8  app_insmod_host;
	u8  app_rmmod_host;
	u8  app_insmod_device;
	u8  app_rmmod_device;

	u8  hw_insmod_host;
	u8  hw_rmmod_host;
	u8  hw_insmod_device;
	u8  hw_rmmod_device;
}usb_msg_t;

typedef struct usb_msg_center_info{
	struct usb_cfg *cfg;

	struct usb_msg msg;
	enum usb_role role;

	u32 skip;			//if skip, not enter msg process
	//mainly to omit invalid msg
}usb_msg_center_info_t;

void hw_insmod_usb_host(void);
void hw_rmmod_usb_host(void);
void hw_insmod_usb_device(void);
void hw_rmmod_usb_device(void);

enum usb_role get_usb_role(void);
#ifdef CONFIG_USB_SUNXI_HACK
void _set_usb_role(enum usb_role role);
#endif
void usb_msg_center(struct usb_cfg *cfg);

s32 usb_msg_center_init(struct usb_cfg *cfg);
s32 usb_msg_center_exit(struct usb_cfg *cfg);

#endif   //__USB_MSG_CENTER_H__