1 /****************************************************************************
2 * (C) Copyright 2008 Samsung Electronics Co., Ltd., All rights reserved
4 * @file s3c-otg-hcdi-hcd.h
5 * @brief header of s3c-otg-hcdi-hcd \n
7 * -# Jun 9,2008 v1.0 by SeungSoo Yang (ss1.yang@samsung.com) \n
8 * : Creating the initial version of this code \n
9 * -# Jul 15,2008 v1.2 by SeungSoo Yang (ss1.yang@samsung.com) \n
10 * : Optimizing for performance \n
11 * -# Aug 18,2008 v1.3 by SeungSoo Yang (ss1.yang@samsung.com) \n
12 * : Modifying for successful rmmod & disconnecting \n
14 ****************************************************************************/
15 /****************************************************************************
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 ****************************************************************************/
31 #ifndef _S3C_OTG_HCDI_HCD_H_
32 #define _S3C_OTG_HCDI_HCD_H_
39 //for IRQ_NONE (0) IRQ_HANDLED (1) IRQ_RETVAL(x) ((x) != 0)
40 #include <linux/interrupt.h>
42 #include <linux/usb.h>
44 #include "s3c-otg-hcdi-debug.h"
45 #include "s3c-otg-hcdi-kal.h"
47 #include "s3c-otg-common-common.h"
48 #include "s3c-otg-common-datastruct.h"
49 #include "s3c-otg-common-const.h"
51 #include "s3c-otg-transfer-transfer.h"
52 #include "s3c-otg-oci.h"
53 #include "s3c-otg-roothub.h"
56 //void otg_handle_interrupt(struct usb_hcd *hcd);
58 irqreturn_t s5pc110_otghcd_irq(struct usb_hcd *hcd);
60 int s5pc110_otghcd_start(struct usb_hcd *hcd);
61 void s5pc110_otghcd_stop(struct usb_hcd *hcd);
62 void s5pc110_otghcd_shutdown(struct usb_hcd *hcd);
64 int s5pc110_otghcd_get_frame_number(struct usb_hcd *hcd);
66 int s5pc110_otghcd_urb_enqueue(
71 int s5pc110_otghcd_urb_dequeue(
76 void s5pc110_otghcd_endpoint_disable(
78 struct usb_host_endpoint *ep);
80 int s5pc110_otghcd_hub_status_data(
84 int s5pc110_otghcd_hub_control(
92 int s5pc110_otghcd_bus_suspend(struct usb_hcd *hcd);
93 int s5pc110_otghcd_bus_resume(struct usb_hcd *hcd);
94 int s5pc110_otghcd_start_port_reset(struct usb_hcd *hcd, unsigned port);
97 * @struct hc_driver s5pc110_otg_hc_driver
99 * @brief implementation of hc_driver for OTG HCD
103 static const struct hc_driver s5pc110_otg_hc_driver = {
104 .description = "EMSP_OTGHCD",
105 .product_desc = "S3C OTGHCD",
106 .hcd_priv_size = sizeof(struct sec_otghost),
108 .irq = s5pc110_otghcd_irq,
109 .flags = HCD_MEMORY | HCD_USB2,
111 /** basic lifecycle operations */
113 .start = s5pc110_otghcd_start,
116 .stop = s5pc110_otghcd_stop,
117 .shutdown = s5pc110_otghcd_shutdown,
119 /** managing i/o requests and associated device resources */
120 .urb_enqueue = s5pc110_otghcd_urb_enqueue,
121 .urb_dequeue = s5pc110_otghcd_urb_dequeue,
122 .endpoint_disable = s5pc110_otghcd_endpoint_disable,
124 /** scheduling support */
125 .get_frame_number = s5pc110_otghcd_get_frame_number,
127 /** root hub support */
128 .hub_status_data = s5pc110_otghcd_hub_status_data,
129 .hub_control = s5pc110_otghcd_hub_control,
131 .bus_suspend = s5pc110_otghcd_bus_suspend,
132 .bus_resume = s5pc110_otghcd_bus_resume,
133 .start_port_reset = s5pc110_otghcd_start_port_reset,
136 static inline struct sec_otghost *hcd_to_sec_otghost (struct usb_hcd *hcd)
138 return (struct sec_otghost *) (hcd->hcd_priv);
140 static inline struct usb_hcd *sec_otghost_to_hcd (struct sec_otghost *otghost)
142 return container_of ((void *) otghost, struct usb_hcd, hcd_priv);
145 int otg_hcd_init_modules(struct sec_otghost *otghost);
146 void otg_hcd_deinit_modules(struct sec_otghost *otghost);
151 #endif /* _S3C_OTG_HCDI_HCD_H_ */