diff options
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/ch9.h | 29 | ||||
-rw-r--r-- | include/linux/usb/gadget.h | 4 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 3 | ||||
-rw-r--r-- | include/linux/usb/r8a66597.h | 60 | ||||
-rw-r--r-- | include/linux/usb/renesas_usbhs.h | 14 |
5 files changed, 107 insertions, 3 deletions
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 0fd3fbdd8283..f32a64e57f97 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define __LINUX_USB_CH9_H | 34 | #define __LINUX_USB_CH9_H |
35 | 35 | ||
36 | #include <linux/types.h> /* __u8 etc */ | 36 | #include <linux/types.h> /* __u8 etc */ |
37 | #include <asm/byteorder.h> /* le16_to_cpu */ | ||
37 | 38 | ||
38 | /*-------------------------------------------------------------------------*/ | 39 | /*-------------------------------------------------------------------------*/ |
39 | 40 | ||
@@ -143,6 +144,11 @@ | |||
143 | #define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ | 144 | #define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ |
144 | 145 | ||
145 | #define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 | 146 | #define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 |
147 | /* | ||
148 | * Suspend Options, Table 9-7 USB 3.0 spec | ||
149 | */ | ||
150 | #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) | ||
151 | #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) | ||
146 | 152 | ||
147 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ | 153 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ |
148 | 154 | ||
@@ -570,6 +576,17 @@ static inline int usb_endpoint_is_isoc_out( | |||
570 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); | 576 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); |
571 | } | 577 | } |
572 | 578 | ||
579 | /** | ||
580 | * usb_endpoint_maxp - get endpoint's max packet size | ||
581 | * @epd: endpoint to be checked | ||
582 | * | ||
583 | * Returns @epd's max packet | ||
584 | */ | ||
585 | static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) | ||
586 | { | ||
587 | return le16_to_cpu(epd->wMaxPacketSize); | ||
588 | } | ||
589 | |||
573 | /*-------------------------------------------------------------------------*/ | 590 | /*-------------------------------------------------------------------------*/ |
574 | 591 | ||
575 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | 592 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ |
@@ -851,6 +868,18 @@ enum usb_device_speed { | |||
851 | USB_SPEED_SUPER, /* usb 3.0 */ | 868 | USB_SPEED_SUPER, /* usb 3.0 */ |
852 | }; | 869 | }; |
853 | 870 | ||
871 | #ifdef __KERNEL__ | ||
872 | |||
873 | /** | ||
874 | * usb_speed_string() - Returns human readable-name of the speed. | ||
875 | * @speed: The speed to return human-readable name for. If it's not | ||
876 | * any of the speeds defined in usb_device_speed enum, string for | ||
877 | * USB_SPEED_UNKNOWN will be returned. | ||
878 | */ | ||
879 | extern const char *usb_speed_string(enum usb_device_speed speed); | ||
880 | |||
881 | #endif | ||
882 | |||
854 | enum usb_device_state { | 883 | enum usb_device_state { |
855 | /* NOTATTACHED isn't in the USB spec, and this state acts | 884 | /* NOTATTACHED isn't in the USB spec, and this state acts |
856 | * the same as ATTACHED ... but it's clearer this way. | 885 | * the same as ATTACHED ... but it's clearer this way. |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 087f4b931833..1d3a67523ffc 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -437,9 +437,9 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep) | |||
437 | 437 | ||
438 | struct usb_dcd_config_params { | 438 | struct usb_dcd_config_params { |
439 | __u8 bU1devExitLat; /* U1 Device exit Latency */ | 439 | __u8 bU1devExitLat; /* U1 Device exit Latency */ |
440 | #define USB_DEFULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */ | 440 | #define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */ |
441 | __le16 bU2DevExitLat; /* U2 Device exit Latency */ | 441 | __le16 bU2DevExitLat; /* U2 Device exit Latency */ |
442 | #define USB_DEFULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */ | 442 | #define USB_DEFAULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */ |
443 | }; | 443 | }; |
444 | 444 | ||
445 | 445 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0097136ba45d..03354d557b79 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -178,7 +178,7 @@ struct usb_hcd { | |||
178 | * this structure. | 178 | * this structure. |
179 | */ | 179 | */ |
180 | unsigned long hcd_priv[0] | 180 | unsigned long hcd_priv[0] |
181 | __attribute__ ((aligned(sizeof(unsigned long)))); | 181 | __attribute__ ((aligned(sizeof(s64)))); |
182 | }; | 182 | }; |
183 | 183 | ||
184 | /* 2.4 does this a bit differently ... */ | 184 | /* 2.4 does this a bit differently ... */ |
@@ -343,6 +343,7 @@ struct hc_driver { | |||
343 | * address is set | 343 | * address is set |
344 | */ | 344 | */ |
345 | int (*update_device)(struct usb_hcd *, struct usb_device *); | 345 | int (*update_device)(struct usb_hcd *, struct usb_device *); |
346 | int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int); | ||
346 | }; | 347 | }; |
347 | 348 | ||
348 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 349 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h index b6b8660d0c68..55805f9dcf21 100644 --- a/include/linux/usb/r8a66597.h +++ b/include/linux/usb/r8a66597.h | |||
@@ -48,6 +48,9 @@ struct r8a66597_platdata { | |||
48 | 48 | ||
49 | /* (external controller only) set one = WR0_N shorted to WR1_N */ | 49 | /* (external controller only) set one = WR0_N shorted to WR1_N */ |
50 | unsigned wr0_shorted_to_wr1:1; | 50 | unsigned wr0_shorted_to_wr1:1; |
51 | |||
52 | /* set one = using SUDMAC */ | ||
53 | unsigned sudmac:1; | ||
51 | }; | 54 | }; |
52 | 55 | ||
53 | /* Register definitions */ | 56 | /* Register definitions */ |
@@ -417,5 +420,62 @@ struct r8a66597_platdata { | |||
417 | #define USBSPD 0x00C0 | 420 | #define USBSPD 0x00C0 |
418 | #define RTPORT 0x0001 | 421 | #define RTPORT 0x0001 |
419 | 422 | ||
423 | /* SUDMAC registers */ | ||
424 | #define CH0CFG 0x00 | ||
425 | #define CH1CFG 0x04 | ||
426 | #define CH0BA 0x10 | ||
427 | #define CH1BA 0x14 | ||
428 | #define CH0BBC 0x18 | ||
429 | #define CH1BBC 0x1C | ||
430 | #define CH0CA 0x20 | ||
431 | #define CH1CA 0x24 | ||
432 | #define CH0CBC 0x28 | ||
433 | #define CH1CBC 0x2C | ||
434 | #define CH0DEN 0x30 | ||
435 | #define CH1DEN 0x34 | ||
436 | #define DSTSCLR 0x38 | ||
437 | #define DBUFCTRL 0x3C | ||
438 | #define DINTCTRL 0x40 | ||
439 | #define DINTSTS 0x44 | ||
440 | #define DINTSTSCLR 0x48 | ||
441 | #define CH0SHCTRL 0x50 | ||
442 | #define CH1SHCTRL 0x54 | ||
443 | |||
444 | /* SUDMAC Configuration Registers */ | ||
445 | #define SENDBUFM 0x1000 /* b12: Transmit Buffer Mode */ | ||
446 | #define RCVENDM 0x0100 /* b8: Receive Data Transfer End Mode */ | ||
447 | #define LBA_WAIT 0x0030 /* b5-4: Local Bus Access Wait */ | ||
448 | |||
449 | /* DMA Enable Registers */ | ||
450 | #define DEN 0x0001 /* b1: DMA Transfer Enable */ | ||
451 | |||
452 | /* DMA Status Clear Register */ | ||
453 | #define CH1STCLR 0x0002 /* b2: Ch1 DMA Status Clear */ | ||
454 | #define CH0STCLR 0x0001 /* b1: Ch0 DMA Status Clear */ | ||
455 | |||
456 | /* DMA Buffer Control Register */ | ||
457 | #define CH1BUFW 0x0200 /* b9: Ch1 DMA Buffer Data Transfer Enable */ | ||
458 | #define CH0BUFW 0x0100 /* b8: Ch0 DMA Buffer Data Transfer Enable */ | ||
459 | #define CH1BUFS 0x0002 /* b2: Ch1 DMA Buffer Data Status */ | ||
460 | #define CH0BUFS 0x0001 /* b1: Ch0 DMA Buffer Data Status */ | ||
461 | |||
462 | /* DMA Interrupt Control Register */ | ||
463 | #define CH1ERRE 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Enable */ | ||
464 | #define CH0ERRE 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Enable */ | ||
465 | #define CH1ENDE 0x0002 /* b2: Ch1 DMA Transfer End Int Enable */ | ||
466 | #define CH0ENDE 0x0001 /* b1: Ch0 DMA Transfer End Int Enable */ | ||
467 | |||
468 | /* DMA Interrupt Status Register */ | ||
469 | #define CH1ERRS 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Status */ | ||
470 | #define CH0ERRS 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Status */ | ||
471 | #define CH1ENDS 0x0002 /* b2: Ch1 DMA Transfer End Int Status */ | ||
472 | #define CH0ENDS 0x0001 /* b1: Ch0 DMA Transfer End Int Status */ | ||
473 | |||
474 | /* DMA Interrupt Status Clear Register */ | ||
475 | #define CH1ERRC 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Stat Clear */ | ||
476 | #define CH0ERRC 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Stat Clear */ | ||
477 | #define CH1ENDC 0x0002 /* b2: Ch1 DMA Transfer End Int Stat Clear */ | ||
478 | #define CH0ENDC 0x0001 /* b1: Ch0 DMA Transfer End Int Stat Clear */ | ||
479 | |||
420 | #endif /* __LINUX_USB_R8A66597_H */ | 480 | #endif /* __LINUX_USB_R8A66597_H */ |
421 | 481 | ||
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index 8977431259c6..e5a40c318548 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
@@ -82,6 +82,13 @@ struct renesas_usbhs_platform_callback { | |||
82 | * get VBUS status function. | 82 | * get VBUS status function. |
83 | */ | 83 | */ |
84 | int (*get_vbus)(struct platform_device *pdev); | 84 | int (*get_vbus)(struct platform_device *pdev); |
85 | |||
86 | /* | ||
87 | * option: | ||
88 | * | ||
89 | * VBUS control is needed for Host | ||
90 | */ | ||
91 | int (*set_vbus)(struct platform_device *pdev, int enable); | ||
85 | }; | 92 | }; |
86 | 93 | ||
87 | /* | 94 | /* |
@@ -101,6 +108,8 @@ struct renesas_usbhs_driver_param { | |||
101 | * option: | 108 | * option: |
102 | * | 109 | * |
103 | * for BUSWAIT :: BWAIT | 110 | * for BUSWAIT :: BWAIT |
111 | * see | ||
112 | * renesas_usbhs/common.c :: usbhsc_set_buswait() | ||
104 | * */ | 113 | * */ |
105 | int buswait_bwait; | 114 | int buswait_bwait; |
106 | 115 | ||
@@ -127,6 +136,11 @@ struct renesas_usbhs_driver_param { | |||
127 | * pio <--> dma border. | 136 | * pio <--> dma border. |
128 | */ | 137 | */ |
129 | int pio_dma_border; /* default is 64byte */ | 138 | int pio_dma_border; /* default is 64byte */ |
139 | |||
140 | /* | ||
141 | * option: | ||
142 | */ | ||
143 | u32 has_otg:1; /* for controlling PWEN/EXTLP */ | ||
130 | }; | 144 | }; |
131 | 145 | ||
132 | /* | 146 | /* |