24 #include <linux/device.h>
35 static __u8 c67x00_hub_des[] = {
47 static void c67x00_hub_reset_host_port(
struct c67x00_sie *sie,
int port)
56 spin_unlock_irqrestore(&c67x00->
lock, flags);
61 static int c67x00_hub_status_data(
struct usb_hcd *hcd,
char *
buf)
63 struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd);
80 static int c67x00_hub_control(
struct usb_hcd *hcd,
u16 typeReq,
u16 wValue,
83 struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd);
87 unsigned int port = wIndex-1;
98 if (wIndex > C67X00_PORTS)
126 case ClearHubFeature:
139 if (wIndex > C67X00_PORTS)
145 "SetPortFeature %d (SUSPEND)\n", port);
150 c67x00_hub_reset_host_port(sie, port);
161 "%s: SetPortFeature %d (0x%04x) Error!\n",
162 __func__, port, wValue);
167 case ClearPortFeature:
168 if (wIndex > C67X00_PORTS)
175 c67x00_hub_reset_host_port(sie, port);
181 "ClearPortFeature (%d): C_ENABLE\n", port);
187 "ClearPortFeature (%d): SUSPEND\n", port);
193 "ClearPortFeature (%d): C_SUSPEND\n", port);
199 "ClearPortFeature (%d): POWER\n", port);
210 "ClearPortFeature (%d): OVER_CURRENT\n", port);
216 "ClearPortFeature (%d): C_RESET\n", port);
222 "%s: ClearPortFeature %d (0x%04x) Error!\n",
223 __func__, port, wValue);
228 case GetHubDescriptor:
229 len =
min_t(
unsigned int,
sizeof(c67x00_hub_des), wLength);
230 memcpy(buf, c67x00_hub_des, len);
253 struct usb_hcd *hcd = c67x00_hcd_to_hcd(c67x00);
261 "Unknown SIE msg flag(s): 0x%04x\n", msg);
264 if (
unlikely(hcd->state == HC_STATE_HALT))
267 if (!HCD_HW_ACCESSIBLE(hcd))
280 static int c67x00_hcd_start(
struct usb_hcd *hcd)
282 hcd->uses_new_polling = 1;
283 hcd->state = HC_STATE_RUNNING;
284 set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
292 static void c67x00_hcd_stop(
struct usb_hcd *hcd)
297 static int c67x00_hcd_get_frame(
struct usb_hcd *hcd)
299 struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd);
308 static struct hc_driver c67x00_hc_driver = {
309 .description =
"c67x00-hcd",
310 .product_desc =
"Cypress C67X00 Host Controller",
312 .
flags = HCD_USB11 | HCD_MEMORY,
317 .start = c67x00_hcd_start,
318 .stop = c67x00_hcd_stop,
330 .get_frame_number = c67x00_hcd_get_frame,
335 .hub_status_data = c67x00_hub_status_data,
336 .hub_control = c67x00_hub_control,
358 c67x00 = hcd_to_c67x00_hcd(hcd);
363 INIT_LIST_HEAD(&c67x00->
list[PIPE_ISOCHRONOUS]);
364 INIT_LIST_HEAD(&c67x00->
list[PIPE_INTERRUPT]);
365 INIT_LIST_HEAD(&c67x00->
list[PIPE_CONTROL]);
366 INIT_LIST_HEAD(&c67x00->
list[PIPE_BULK]);
368 INIT_LIST_HEAD(&c67x00->
td_list);
389 sie->
irq = c67x00_hcd_irq;
390 spin_unlock_irqrestore(&sie->
lock, flags);
406 struct usb_hcd *hcd = c67x00_hcd_to_hcd(c67x00);