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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/****************************************************************************
* (C) Copyright 2008 Samsung Electronics Co., Ltd., All rights reserved
*
* @file s3c-otg-hcdi-hcd.h
* @brief header of s3c-otg-hcdi-hcd \n
* @version
* -# Jun 9,2008 v1.0 by SeungSoo Yang (ss1.yang@samsung.com) \n
* : Creating the initial version of this code \n
* -# Jul 15,2008 v1.2 by SeungSoo Yang (ss1.yang@samsung.com) \n
* : Optimizing for performance \n
* -# Aug 18,2008 v1.3 by SeungSoo Yang (ss1.yang@samsung.com) \n
* : Modifying for successful rmmod & disconnecting \n
* @see None
****************************************************************************/
/****************************************************************************
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
****************************************************************************/
#ifndef _S3C_OTG_HCDI_HCD_H_
#define _S3C_OTG_HCDI_HCD_H_
#ifdef __cplusplus
extern "C"
{
#endif
//for IRQ_NONE (0) IRQ_HANDLED (1) IRQ_RETVAL(x) ((x) != 0)
#include <linux/interrupt.h>
#include <linux/usb.h>
#include "s3c-otg-hcdi-debug.h"
#include "s3c-otg-hcdi-kal.h"
#include "s3c-otg-common-common.h"
#include "s3c-otg-common-datastruct.h"
#include "s3c-otg-common-const.h"
#include "s3c-otg-transfer-transfer.h"
#include "s3c-otg-oci.h"
#include "s3c-otg-roothub.h"
//placed in ISR
//void otg_handle_interrupt(struct usb_hcd *hcd);
irqreturn_t s5pc110_otghcd_irq(struct usb_hcd *hcd);
int s5pc110_otghcd_start(struct usb_hcd *hcd);
void s5pc110_otghcd_stop(struct usb_hcd *hcd);
void s5pc110_otghcd_shutdown(struct usb_hcd *hcd);
int s5pc110_otghcd_get_frame_number(struct usb_hcd *hcd);
int s5pc110_otghcd_urb_enqueue(
struct usb_hcd *hcd,
struct urb *urb,
gfp_t mem_flags);
int s5pc110_otghcd_urb_dequeue(
struct usb_hcd *_hcd,
struct urb *_urb,
int status);
void s5pc110_otghcd_endpoint_disable(
struct usb_hcd *hcd,
struct usb_host_endpoint *ep);
int s5pc110_otghcd_hub_status_data(
struct usb_hcd *_hcd,
char *_buf);
int s5pc110_otghcd_hub_control(
struct usb_hcd *hcd,
u16 type_req,
u16 value,
u16 index,
char * buf,
u16 length);
int s5pc110_otghcd_bus_suspend(struct usb_hcd *hcd);
int s5pc110_otghcd_bus_resume(struct usb_hcd *hcd);
int s5pc110_otghcd_start_port_reset(struct usb_hcd *hcd, unsigned port);
/**
* @struct hc_driver s5pc110_otg_hc_driver
*
* @brief implementation of hc_driver for OTG HCD
*
* describe in detail
*/
static const struct hc_driver s5pc110_otg_hc_driver = {
.description = "EMSP_OTGHCD",
.product_desc = "S3C OTGHCD",
.hcd_priv_size = sizeof(struct sec_otghost),
.irq = s5pc110_otghcd_irq,
.flags = HCD_MEMORY | HCD_USB2,
/** basic lifecycle operations */
//.reset =
.start = s5pc110_otghcd_start,
//.suspend = ,
//.resume = ,
.stop = s5pc110_otghcd_stop,
.shutdown = s5pc110_otghcd_shutdown,
/** managing i/o requests and associated device resources */
.urb_enqueue = s5pc110_otghcd_urb_enqueue,
.urb_dequeue = s5pc110_otghcd_urb_dequeue,
.endpoint_disable = s5pc110_otghcd_endpoint_disable,
/** scheduling support */
.get_frame_number = s5pc110_otghcd_get_frame_number,
/** root hub support */
.hub_status_data = s5pc110_otghcd_hub_status_data,
.hub_control = s5pc110_otghcd_hub_control,
//.hub_irq_enable =
.bus_suspend = s5pc110_otghcd_bus_suspend,
.bus_resume = s5pc110_otghcd_bus_resume,
.start_port_reset = s5pc110_otghcd_start_port_reset,
};
static inline struct sec_otghost *hcd_to_sec_otghost (struct usb_hcd *hcd)
{
return (struct sec_otghost *) (hcd->hcd_priv);
}
static inline struct usb_hcd *sec_otghost_to_hcd (struct sec_otghost *otghost)
{
return container_of ((void *) otghost, struct usb_hcd, hcd_priv);
}
int otg_hcd_init_modules(struct sec_otghost *otghost);
void otg_hcd_deinit_modules(struct sec_otghost *otghost);
#ifdef __cplusplus
}
#endif
#endif /* _S3C_OTG_HCDI_HCD_H_ */
|