diff options
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/chipidea.h | 5 | ||||
| -rw-r--r-- | include/linux/usb/composite.h | 7 | ||||
| -rw-r--r-- | include/linux/usb/ehci-dbgp.h | 83 | ||||
| -rw-r--r-- | include/linux/usb/ehci_def.h | 65 | ||||
| -rw-r--r-- | include/linux/usb/gadget.h | 5 | ||||
| -rw-r--r-- | include/linux/usb/hcd.h | 3 | ||||
| -rw-r--r-- | include/linux/usb/otg.h | 7 | ||||
| -rw-r--r-- | include/linux/usb/phy.h | 6 | ||||
| -rw-r--r-- | include/linux/usb/renesas_usbhs.h | 4 |
9 files changed, 115 insertions, 70 deletions
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index e14c09a45c5a..535997a6681b 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
| @@ -13,11 +13,12 @@ struct ci_hdrc_platform_data { | |||
| 13 | /* offset of the capability registers */ | 13 | /* offset of the capability registers */ |
| 14 | uintptr_t capoffset; | 14 | uintptr_t capoffset; |
| 15 | unsigned power_budget; | 15 | unsigned power_budget; |
| 16 | struct usb_phy *phy; | 16 | struct phy *phy; |
| 17 | /* old usb_phy interface */ | ||
| 18 | struct usb_phy *usb_phy; | ||
| 17 | enum usb_phy_interface phy_mode; | 19 | enum usb_phy_interface phy_mode; |
| 18 | unsigned long flags; | 20 | unsigned long flags; |
| 19 | #define CI_HDRC_REGS_SHARED BIT(0) | 21 | #define CI_HDRC_REGS_SHARED BIT(0) |
| 20 | #define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) | ||
| 21 | #define CI_HDRC_DISABLE_STREAMING BIT(3) | 22 | #define CI_HDRC_DISABLE_STREAMING BIT(3) |
| 22 | /* | 23 | /* |
| 23 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, | 24 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index c330f5ef42cf..3d87defcc527 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -427,6 +427,8 @@ static inline struct usb_composite_driver *to_cdriver( | |||
| 427 | * @b_vendor_code: bMS_VendorCode part of the OS string | 427 | * @b_vendor_code: bMS_VendorCode part of the OS string |
| 428 | * @use_os_string: false by default, interested gadgets set it | 428 | * @use_os_string: false by default, interested gadgets set it |
| 429 | * @os_desc_config: the configuration to be used with OS descriptors | 429 | * @os_desc_config: the configuration to be used with OS descriptors |
| 430 | * @setup_pending: true when setup request is queued but not completed | ||
| 431 | * @os_desc_pending: true when os_desc request is queued but not completed | ||
| 430 | * | 432 | * |
| 431 | * One of these devices is allocated and initialized before the | 433 | * One of these devices is allocated and initialized before the |
| 432 | * associated device driver's bind() is called. | 434 | * associated device driver's bind() is called. |
| @@ -488,6 +490,9 @@ struct usb_composite_dev { | |||
| 488 | 490 | ||
| 489 | /* protects deactivations and delayed_status counts*/ | 491 | /* protects deactivations and delayed_status counts*/ |
| 490 | spinlock_t lock; | 492 | spinlock_t lock; |
| 493 | |||
| 494 | unsigned setup_pending:1; | ||
| 495 | unsigned os_desc_pending:1; | ||
| 491 | }; | 496 | }; |
| 492 | 497 | ||
| 493 | extern int usb_string_id(struct usb_composite_dev *c); | 498 | extern int usb_string_id(struct usb_composite_dev *c); |
| @@ -501,6 +506,8 @@ extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); | |||
| 501 | extern void composite_disconnect(struct usb_gadget *gadget); | 506 | extern void composite_disconnect(struct usb_gadget *gadget); |
| 502 | extern int composite_setup(struct usb_gadget *gadget, | 507 | extern int composite_setup(struct usb_gadget *gadget, |
| 503 | const struct usb_ctrlrequest *ctrl); | 508 | const struct usb_ctrlrequest *ctrl); |
| 509 | extern void composite_suspend(struct usb_gadget *gadget); | ||
| 510 | extern void composite_resume(struct usb_gadget *gadget); | ||
| 504 | 511 | ||
| 505 | /* | 512 | /* |
| 506 | * Some systems will need runtime overrides for the product identifiers | 513 | * Some systems will need runtime overrides for the product identifiers |
diff --git a/include/linux/usb/ehci-dbgp.h b/include/linux/usb/ehci-dbgp.h new file mode 100644 index 000000000000..7344d9e591cc --- /dev/null +++ b/include/linux/usb/ehci-dbgp.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* | ||
| 2 | * Standalone EHCI usb debug driver | ||
| 3 | * | ||
| 4 | * Originally written by: | ||
| 5 | * Eric W. Biederman" <ebiederm@xmission.com> and | ||
| 6 | * Yinghai Lu <yhlu.kernel@gmail.com> | ||
| 7 | * | ||
| 8 | * Changes for early/late printk and HW errata: | ||
| 9 | * Jason Wessel <jason.wessel@windriver.com> | ||
| 10 | * Copyright (C) 2009 Wind River Systems, Inc. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_USB_EHCI_DBGP_H | ||
| 15 | #define __LINUX_USB_EHCI_DBGP_H | ||
| 16 | |||
| 17 | #include <linux/console.h> | ||
| 18 | #include <linux/types.h> | ||
| 19 | |||
| 20 | /* Appendix C, Debug port ... intended for use with special "debug devices" | ||
| 21 | * that can help if there's no serial console. (nonstandard enumeration.) | ||
| 22 | */ | ||
| 23 | struct ehci_dbg_port { | ||
| 24 | u32 control; | ||
| 25 | #define DBGP_OWNER (1<<30) | ||
| 26 | #define DBGP_ENABLED (1<<28) | ||
| 27 | #define DBGP_DONE (1<<16) | ||
| 28 | #define DBGP_INUSE (1<<10) | ||
| 29 | #define DBGP_ERRCODE(x) (((x)>>7)&0x07) | ||
| 30 | # define DBGP_ERR_BAD 1 | ||
| 31 | # define DBGP_ERR_SIGNAL 2 | ||
| 32 | #define DBGP_ERROR (1<<6) | ||
| 33 | #define DBGP_GO (1<<5) | ||
| 34 | #define DBGP_OUT (1<<4) | ||
| 35 | #define DBGP_LEN(x) (((x)>>0)&0x0f) | ||
| 36 | u32 pids; | ||
| 37 | #define DBGP_PID_GET(x) (((x)>>16)&0xff) | ||
| 38 | #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok)) | ||
| 39 | u32 data03; | ||
| 40 | u32 data47; | ||
| 41 | u32 address; | ||
| 42 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | ||
| 43 | }; | ||
| 44 | |||
| 45 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
| 46 | extern int early_dbgp_init(char *s); | ||
| 47 | extern struct console early_dbgp_console; | ||
| 48 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
| 49 | |||
| 50 | struct usb_hcd; | ||
| 51 | |||
| 52 | #ifdef CONFIG_XEN_DOM0 | ||
| 53 | extern int xen_dbgp_reset_prep(struct usb_hcd *); | ||
| 54 | extern int xen_dbgp_external_startup(struct usb_hcd *); | ||
| 55 | #else | ||
| 56 | static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
| 57 | { | ||
| 58 | return 1; /* Shouldn't this be 0? */ | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
| 62 | { | ||
| 63 | return -1; | ||
| 64 | } | ||
| 65 | #endif | ||
| 66 | |||
| 67 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
| 68 | /* Call backs from ehci host driver to ehci debug driver */ | ||
| 69 | extern int dbgp_external_startup(struct usb_hcd *); | ||
| 70 | extern int dbgp_reset_prep(struct usb_hcd *); | ||
| 71 | #else | ||
| 72 | static inline int dbgp_reset_prep(struct usb_hcd *hcd) | ||
| 73 | { | ||
| 74 | return xen_dbgp_reset_prep(hcd); | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline int dbgp_external_startup(struct usb_hcd *hcd) | ||
| 78 | { | ||
| 79 | return xen_dbgp_external_startup(hcd); | ||
| 80 | } | ||
| 81 | #endif | ||
| 82 | |||
| 83 | #endif /* __LINUX_USB_EHCI_DBGP_H */ | ||
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index daec99af5d54..966889a20ea3 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
| @@ -19,6 +19,8 @@ | |||
| 19 | #ifndef __LINUX_USB_EHCI_DEF_H | 19 | #ifndef __LINUX_USB_EHCI_DEF_H |
| 20 | #define __LINUX_USB_EHCI_DEF_H | 20 | #define __LINUX_USB_EHCI_DEF_H |
| 21 | 21 | ||
| 22 | #include <linux/usb/ehci-dbgp.h> | ||
| 23 | |||
| 22 | /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */ | 24 | /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */ |
| 23 | 25 | ||
| 24 | /* Section 2.2 Host Controller Capability Registers */ | 26 | /* Section 2.2 Host Controller Capability Registers */ |
| @@ -190,67 +192,4 @@ struct ehci_regs { | |||
| 190 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ | 192 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ |
| 191 | }; | 193 | }; |
| 192 | 194 | ||
| 193 | /* Appendix C, Debug port ... intended for use with special "debug devices" | ||
| 194 | * that can help if there's no serial console. (nonstandard enumeration.) | ||
| 195 | */ | ||
| 196 | struct ehci_dbg_port { | ||
| 197 | u32 control; | ||
| 198 | #define DBGP_OWNER (1<<30) | ||
| 199 | #define DBGP_ENABLED (1<<28) | ||
| 200 | #define DBGP_DONE (1<<16) | ||
| 201 | #define DBGP_INUSE (1<<10) | ||
| 202 | #define DBGP_ERRCODE(x) (((x)>>7)&0x07) | ||
| 203 | # define DBGP_ERR_BAD 1 | ||
| 204 | # define DBGP_ERR_SIGNAL 2 | ||
| 205 | #define DBGP_ERROR (1<<6) | ||
| 206 | #define DBGP_GO (1<<5) | ||
| 207 | #define DBGP_OUT (1<<4) | ||
| 208 | #define DBGP_LEN(x) (((x)>>0)&0x0f) | ||
| 209 | u32 pids; | ||
| 210 | #define DBGP_PID_GET(x) (((x)>>16)&0xff) | ||
| 211 | #define DBGP_PID_SET(data, tok) (((data)<<8)|(tok)) | ||
| 212 | u32 data03; | ||
| 213 | u32 data47; | ||
| 214 | u32 address; | ||
| 215 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | ||
| 216 | }; | ||
| 217 | |||
| 218 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
| 219 | #include <linux/init.h> | ||
| 220 | extern int __init early_dbgp_init(char *s); | ||
| 221 | extern struct console early_dbgp_console; | ||
| 222 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
| 223 | |||
| 224 | struct usb_hcd; | ||
| 225 | |||
| 226 | #ifdef CONFIG_XEN_DOM0 | ||
| 227 | extern int xen_dbgp_reset_prep(struct usb_hcd *); | ||
| 228 | extern int xen_dbgp_external_startup(struct usb_hcd *); | ||
| 229 | #else | ||
| 230 | static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
| 231 | { | ||
| 232 | return 1; /* Shouldn't this be 0? */ | ||
| 233 | } | ||
| 234 | |||
| 235 | static inline int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
| 236 | { | ||
| 237 | return -1; | ||
| 238 | } | ||
| 239 | #endif | ||
| 240 | |||
| 241 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
| 242 | /* Call backs from ehci host driver to ehci debug driver */ | ||
| 243 | extern int dbgp_external_startup(struct usb_hcd *); | ||
| 244 | extern int dbgp_reset_prep(struct usb_hcd *hcd); | ||
| 245 | #else | ||
| 246 | static inline int dbgp_reset_prep(struct usb_hcd *hcd) | ||
| 247 | { | ||
| 248 | return xen_dbgp_reset_prep(hcd); | ||
| 249 | } | ||
| 250 | static inline int dbgp_external_startup(struct usb_hcd *hcd) | ||
| 251 | { | ||
| 252 | return xen_dbgp_external_startup(hcd); | ||
| 253 | } | ||
| 254 | #endif | ||
| 255 | |||
| 256 | #endif /* __LINUX_USB_EHCI_DEF_H */ | 195 | #endif /* __LINUX_USB_EHCI_DEF_H */ |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 522cafe26790..70ddb3943b62 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -490,8 +490,7 @@ struct usb_gadget_ops { | |||
| 490 | void (*get_config_params)(struct usb_dcd_config_params *); | 490 | void (*get_config_params)(struct usb_dcd_config_params *); |
| 491 | int (*udc_start)(struct usb_gadget *, | 491 | int (*udc_start)(struct usb_gadget *, |
| 492 | struct usb_gadget_driver *); | 492 | struct usb_gadget_driver *); |
| 493 | int (*udc_stop)(struct usb_gadget *, | 493 | int (*udc_stop)(struct usb_gadget *); |
| 494 | struct usb_gadget_driver *); | ||
| 495 | }; | 494 | }; |
| 496 | 495 | ||
| 497 | /** | 496 | /** |
| @@ -925,7 +924,7 @@ extern int usb_add_gadget_udc_release(struct device *parent, | |||
| 925 | struct usb_gadget *gadget, void (*release)(struct device *dev)); | 924 | struct usb_gadget *gadget, void (*release)(struct device *dev)); |
| 926 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); | 925 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); |
| 927 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); | 926 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); |
| 928 | extern int udc_attach_driver(const char *name, | 927 | extern int usb_udc_attach_driver(const char *name, |
| 929 | struct usb_gadget_driver *driver); | 928 | struct usb_gadget_driver *driver); |
| 930 | 929 | ||
| 931 | /*-------------------------------------------------------------------------*/ | 930 | /*-------------------------------------------------------------------------*/ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 668898e29d0e..086bf13307e6 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -379,6 +379,9 @@ struct hc_driver { | |||
| 379 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, | 379 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, |
| 380 | struct usb_device *, enum usb3_link_state state); | 380 | struct usb_device *, enum usb3_link_state state); |
| 381 | int (*find_raw_port_number)(struct usb_hcd *, int); | 381 | int (*find_raw_port_number)(struct usb_hcd *, int); |
| 382 | /* Call for power on/off the port if necessary */ | ||
| 383 | int (*port_power)(struct usb_hcd *hcd, int portnum, bool enable); | ||
| 384 | |||
| 382 | }; | 385 | }; |
| 383 | 386 | ||
| 384 | static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) | 387 | static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 154332b7c8c0..52661c5da690 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -9,15 +9,20 @@ | |||
| 9 | #ifndef __LINUX_USB_OTG_H | 9 | #ifndef __LINUX_USB_OTG_H |
| 10 | #define __LINUX_USB_OTG_H | 10 | #define __LINUX_USB_OTG_H |
| 11 | 11 | ||
| 12 | #include <linux/phy/phy.h> | ||
| 12 | #include <linux/usb/phy.h> | 13 | #include <linux/usb/phy.h> |
| 13 | 14 | ||
| 14 | struct usb_otg { | 15 | struct usb_otg { |
| 15 | u8 default_a; | 16 | u8 default_a; |
| 16 | 17 | ||
| 17 | struct usb_phy *phy; | 18 | struct phy *phy; |
| 19 | /* old usb_phy interface */ | ||
| 20 | struct usb_phy *usb_phy; | ||
| 18 | struct usb_bus *host; | 21 | struct usb_bus *host; |
| 19 | struct usb_gadget *gadget; | 22 | struct usb_gadget *gadget; |
| 20 | 23 | ||
| 24 | enum usb_otg_state state; | ||
| 25 | |||
| 21 | /* bind/unbind the host controller */ | 26 | /* bind/unbind the host controller */ |
| 22 | int (*set_host)(struct usb_otg *otg, struct usb_bus *host); | 27 | int (*set_host)(struct usb_otg *otg, struct usb_bus *host); |
| 23 | 28 | ||
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 353053a33f21..f499c23e6342 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
| @@ -77,7 +77,6 @@ struct usb_phy { | |||
| 77 | unsigned int flags; | 77 | unsigned int flags; |
| 78 | 78 | ||
| 79 | enum usb_phy_type type; | 79 | enum usb_phy_type type; |
| 80 | enum usb_otg_state state; | ||
| 81 | enum usb_phy_events last_event; | 80 | enum usb_phy_events last_event; |
| 82 | 81 | ||
| 83 | struct usb_otg *otg; | 82 | struct usb_otg *otg; |
| @@ -210,6 +209,7 @@ extern void usb_put_phy(struct usb_phy *); | |||
| 210 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | 209 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); |
| 211 | extern int usb_bind_phy(const char *dev_name, u8 index, | 210 | extern int usb_bind_phy(const char *dev_name, u8 index, |
| 212 | const char *phy_dev_name); | 211 | const char *phy_dev_name); |
| 212 | extern void usb_phy_set_event(struct usb_phy *x, unsigned long event); | ||
| 213 | #else | 213 | #else |
| 214 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | 214 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) |
| 215 | { | 215 | { |
| @@ -251,6 +251,10 @@ static inline int usb_bind_phy(const char *dev_name, u8 index, | |||
| 251 | { | 251 | { |
| 252 | return -EOPNOTSUPP; | 252 | return -EOPNOTSUPP; |
| 253 | } | 253 | } |
| 254 | |||
| 255 | static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event) | ||
| 256 | { | ||
| 257 | } | ||
| 254 | #endif | 258 | #endif |
| 255 | 259 | ||
| 256 | static inline int | 260 | static inline int |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index d5952bb66752..9fd9e481ea98 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
| @@ -145,6 +145,10 @@ struct renesas_usbhs_driver_param { | |||
| 145 | int d0_rx_id; | 145 | int d0_rx_id; |
| 146 | int d1_tx_id; | 146 | int d1_tx_id; |
| 147 | int d1_rx_id; | 147 | int d1_rx_id; |
| 148 | int d2_tx_id; | ||
| 149 | int d2_rx_id; | ||
| 150 | int d3_tx_id; | ||
| 151 | int d3_rx_id; | ||
| 148 | 152 | ||
| 149 | /* | 153 | /* |
| 150 | * option: | 154 | * option: |
