diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 18:18:00 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 18:18:00 -0400 |
| commit | 64dc9e2e7320f079b97c46b106133b58b8e18d40 (patch) | |
| tree | ab010dc1337d44e29c2b32b7f11788620a91fe4f /include/linux/usb | |
| parent | 01a60e76b6392547ad3dca3ac05b9c886fa5da45 (diff) | |
| parent | 9b192de60b5a584ee4ed967fb6758773c75e4643 (diff) | |
Merge tag 'usb-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes:
usb: patches for v3.10 merge window
Here is the big Gadget & PHY pull request. Many of us have
been really busy lately getting multiple drivers to a better
position.
Since this pull request is so large, I will divide it in sections
so it's easier to grasp what's included.
- cleanups:
. UDC drivers no longer touch gadget->dev, that's now udc-core
responsibility
. Many more UDC drivers converted to usb_gadget_map/unmap_request()
. UDC drivers no longer initialize DMA-related fields from gadget's
device structure
. UDC drivers don't touch gadget.dev.driver directly
. UDC drivers don't assign gadget.dev.release directly
. Removal of some unused DMA_ADDR_INVALID
. Introduction of CONFIG_USB_PHY
. All phy drivers have been moved to drivers/usb/phy and renamed to
a common naming scheme
. Fix PHY layer so it never returns a NULL pointer, also fix all
callers to avoid using IS_ERR_OR_NULL()
. Sparse fixes all over the place
. drivers/usb/otg/ has been deleted
. Marvel drivers (mv_udc, ehci-mv, mv_otg and mv_u3d) improved clock
usage
- new features:
. UDC core now provides a generic way for tracking and reporting
UDC's state (not attached, resuming, suspended, addressed,
default, etc)
. twl4030-usb learned that it shouldn't be enabled during init
. Full DT support for DWC3 has been implemented
. ab8500-usb learned about pinctrl framework
. nop PHY learned about DeviceTree and regulators
. DWC3 learned about suspend/resume
. DWC3 can now be compiled in host-only and gadget-only (as well as
DRD) configurations
. UVC now enables streaming endpoint based on negotiated speed
. isp1301 now implements the PHY API properly
. configfs-based interface for gadget drivers which will lead to
the removal of all code which just combines functions together
to build functional gadget drivers.
. f_serial and f_obex were converted to new configfs interface while
maintaining old interface around.
- non-critical fixes:
. UVC gadget driver got fixes for Endpoint usage and stream calculation
. ab8500-usb fixed unbalanced clock and regulator API usage
. twl4030-usb got a fix for when OMAP3 is booted with cable connected
. fusb300_udc got a fix for DMA usage
. UVC got fixes for two assertions of the USB Video Class Compliance
specification revision 1.1
. build warning issues caused by recent addition of __must_check to
regulator API
These are all changes which deserve a mention, all other changes are related
to these one or minor spelling fixes and other similar tasks.
Signed-of-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/ch9.h | 9 | ||||
| -rw-r--r-- | include/linux/usb/composite.h | 3 | ||||
| -rw-r--r-- | include/linux/usb/dwc3-omap.h | 6 | ||||
| -rw-r--r-- | include/linux/usb/gadget.h | 11 | ||||
| -rw-r--r-- | include/linux/usb/gadget_configfs.h | 110 | ||||
| -rw-r--r-- | include/linux/usb/musb-ux500.h | 31 | ||||
| -rw-r--r-- | include/linux/usb/nop-usb-xceiv.h | 5 | ||||
| -rw-r--r-- | include/linux/usb/otg.h | 9 | ||||
| -rw-r--r-- | include/linux/usb/phy.h | 33 | ||||
| -rw-r--r-- | include/linux/usb/renesas_usbhs.h | 6 |
10 files changed, 203 insertions, 20 deletions
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 9c210f2283df..27603bcbb9b9 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -43,4 +43,13 @@ | |||
| 43 | */ | 43 | */ |
| 44 | extern const char *usb_speed_string(enum usb_device_speed speed); | 44 | extern const char *usb_speed_string(enum usb_device_speed speed); |
| 45 | 45 | ||
| 46 | |||
| 47 | /** | ||
| 48 | * usb_state_string - Returns human readable name for the state. | ||
| 49 | * @state: The state to return a human-readable name for. If it's not | ||
| 50 | * any of the states devices in usb_device_state_string enum, | ||
| 51 | * the string UNKNOWN will be returned. | ||
| 52 | */ | ||
| 53 | extern const char *usb_state_string(enum usb_device_state state); | ||
| 54 | |||
| 46 | #endif /* __LINUX_USB_CH9_H */ | 55 | #endif /* __LINUX_USB_CH9_H */ |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 8860594d6364..5e61589fc166 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
| 40 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
| 41 | #include <linux/log2.h> | 41 | #include <linux/log2.h> |
| 42 | #include <linux/configfs.h> | ||
| 42 | 43 | ||
| 43 | /* | 44 | /* |
| 44 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | 45 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they |
| @@ -464,6 +465,8 @@ struct usb_function_driver { | |||
| 464 | }; | 465 | }; |
| 465 | 466 | ||
| 466 | struct usb_function_instance { | 467 | struct usb_function_instance { |
| 468 | struct config_group group; | ||
| 469 | struct list_head cfs_list; | ||
| 467 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
| 468 | void (*free_func_inst)(struct usb_function_instance *inst); | 471 | void (*free_func_inst)(struct usb_function_instance *inst); |
| 469 | }; | 472 | }; |
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h index 51eae14477f7..5615f4d82724 100644 --- a/include/linux/usb/dwc3-omap.h +++ b/include/linux/usb/dwc3-omap.h | |||
| @@ -19,11 +19,11 @@ enum omap_dwc3_vbus_id_status { | |||
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) | 21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) |
| 22 | extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); | 22 | extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); |
| 23 | #else | 23 | #else |
| 24 | static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) | 24 | static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) |
| 25 | { | 25 | { |
| 26 | return; | 26 | return -ENODEV; |
| 27 | } | 27 | } |
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 2e297e80d59a..c454a88abf2e 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -482,6 +482,7 @@ struct usb_gadget_ops { | |||
| 482 | * @speed: Speed of current connection to USB host. | 482 | * @speed: Speed of current connection to USB host. |
| 483 | * @max_speed: Maximal speed the UDC can handle. UDC must support this | 483 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
| 484 | * and all slower speeds. | 484 | * and all slower speeds. |
| 485 | * @state: the state we are now (attached, suspended, configured, etc) | ||
| 485 | * @sg_supported: true if we can handle scatter-gather | 486 | * @sg_supported: true if we can handle scatter-gather |
| 486 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 487 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
| 487 | * gadget driver must provide a USB OTG descriptor. | 488 | * gadget driver must provide a USB OTG descriptor. |
| @@ -525,6 +526,7 @@ struct usb_gadget { | |||
| 525 | struct list_head ep_list; /* of usb_ep */ | 526 | struct list_head ep_list; /* of usb_ep */ |
| 526 | enum usb_device_speed speed; | 527 | enum usb_device_speed speed; |
| 527 | enum usb_device_speed max_speed; | 528 | enum usb_device_speed max_speed; |
| 529 | enum usb_device_state state; | ||
| 528 | unsigned sg_supported:1; | 530 | unsigned sg_supported:1; |
| 529 | unsigned is_otg:1; | 531 | unsigned is_otg:1; |
| 530 | unsigned is_a_peripheral:1; | 532 | unsigned is_a_peripheral:1; |
| @@ -872,6 +874,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver); | |||
| 872 | */ | 874 | */ |
| 873 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); | 875 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); |
| 874 | 876 | ||
| 877 | extern int usb_add_gadget_udc_release(struct device *parent, | ||
| 878 | struct usb_gadget *gadget, void (*release)(struct device *dev)); | ||
| 875 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); | 879 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); |
| 876 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); | 880 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); |
| 877 | extern int udc_attach_driver(const char *name, | 881 | extern int udc_attach_driver(const char *name, |
| @@ -959,6 +963,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget, | |||
| 959 | 963 | ||
| 960 | /*-------------------------------------------------------------------------*/ | 964 | /*-------------------------------------------------------------------------*/ |
| 961 | 965 | ||
| 966 | /* utility to set gadget state properly */ | ||
| 967 | |||
| 968 | extern void usb_gadget_set_state(struct usb_gadget *gadget, | ||
| 969 | enum usb_device_state state); | ||
| 970 | |||
| 971 | /*-------------------------------------------------------------------------*/ | ||
| 972 | |||
| 962 | /* utility wrapping a simple endpoint selection policy */ | 973 | /* utility wrapping a simple endpoint selection policy */ |
| 963 | 974 | ||
| 964 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 975 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
diff --git a/include/linux/usb/gadget_configfs.h b/include/linux/usb/gadget_configfs.h new file mode 100644 index 000000000000..d74c0ae989d5 --- /dev/null +++ b/include/linux/usb/gadget_configfs.h | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | #ifndef __GADGET_CONFIGFS__ | ||
| 2 | #define __GADGET_CONFIGFS__ | ||
| 3 | |||
| 4 | #include <linux/configfs.h> | ||
| 5 | |||
| 6 | int check_user_usb_string(const char *name, | ||
| 7 | struct usb_gadget_strings *stringtab_dev); | ||
| 8 | |||
| 9 | #define GS_STRINGS_W(__struct, __name) \ | ||
| 10 | static ssize_t __struct##_##__name##_store(struct __struct *gs, \ | ||
| 11 | const char *page, size_t len) \ | ||
| 12 | { \ | ||
| 13 | int ret; \ | ||
| 14 | \ | ||
| 15 | ret = usb_string_copy(page, &gs->__name); \ | ||
| 16 | if (ret) \ | ||
| 17 | return ret; \ | ||
| 18 | return len; \ | ||
| 19 | } | ||
| 20 | |||
| 21 | #define GS_STRINGS_R(__struct, __name) \ | ||
| 22 | static ssize_t __struct##_##__name##_show(struct __struct *gs, \ | ||
| 23 | char *page) \ | ||
| 24 | { \ | ||
| 25 | return sprintf(page, "%s\n", gs->__name ?: ""); \ | ||
| 26 | } | ||
| 27 | |||
| 28 | #define GS_STRING_ITEM_ATTR(struct_name, name) \ | ||
| 29 | static struct struct_name##_attribute struct_name##_##name = \ | ||
| 30 | __CONFIGFS_ATTR(name, S_IRUGO | S_IWUSR, \ | ||
| 31 | struct_name##_##name##_show, \ | ||
| 32 | struct_name##_##name##_store) | ||
| 33 | |||
| 34 | #define GS_STRINGS_RW(struct_name, _name) \ | ||
| 35 | GS_STRINGS_R(struct_name, _name) \ | ||
| 36 | GS_STRINGS_W(struct_name, _name) \ | ||
| 37 | GS_STRING_ITEM_ATTR(struct_name, _name) | ||
| 38 | |||
| 39 | #define USB_CONFIG_STRING_RW_OPS(struct_in) \ | ||
| 40 | CONFIGFS_ATTR_OPS(struct_in); \ | ||
| 41 | \ | ||
| 42 | static struct configfs_item_operations struct_in##_langid_item_ops = { \ | ||
| 43 | .release = struct_in##_attr_release, \ | ||
| 44 | .show_attribute = struct_in##_attr_show, \ | ||
| 45 | .store_attribute = struct_in##_attr_store, \ | ||
| 46 | }; \ | ||
| 47 | \ | ||
| 48 | static struct config_item_type struct_in##_langid_type = { \ | ||
| 49 | .ct_item_ops = &struct_in##_langid_item_ops, \ | ||
| 50 | .ct_attrs = struct_in##_langid_attrs, \ | ||
| 51 | .ct_owner = THIS_MODULE, \ | ||
| 52 | } | ||
| 53 | |||
| 54 | #define USB_CONFIG_STRINGS_LANG(struct_in, struct_member) \ | ||
| 55 | static struct config_group *struct_in##_strings_make( \ | ||
| 56 | struct config_group *group, \ | ||
| 57 | const char *name) \ | ||
| 58 | { \ | ||
| 59 | struct struct_member *gi; \ | ||
| 60 | struct struct_in *gs; \ | ||
| 61 | struct | ||
