diff options
Diffstat (limited to 'drivers/usb')
42 files changed, 384 insertions, 159 deletions
diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig index eb2aa2e5a842..d1bd8ef1f9c1 100644 --- a/drivers/usb/chipidea/Kconfig +++ b/drivers/usb/chipidea/Kconfig | |||
| @@ -12,7 +12,7 @@ if USB_CHIPIDEA | |||
| 12 | 12 | ||
| 13 | config USB_CHIPIDEA_UDC | 13 | config USB_CHIPIDEA_UDC |
| 14 | bool "ChipIdea device controller" | 14 | bool "ChipIdea device controller" |
| 15 | depends on USB_GADGET=y || USB_CHIPIDEA=m | 15 | depends on USB_GADGET=y || (USB_CHIPIDEA=m && USB_GADGET=m) |
| 16 | help | 16 | help |
| 17 | Say Y here to enable device controller functionality of the | 17 | Say Y here to enable device controller functionality of the |
| 18 | ChipIdea driver. | 18 | ChipIdea driver. |
| @@ -20,7 +20,7 @@ config USB_CHIPIDEA_UDC | |||
| 20 | config USB_CHIPIDEA_HOST | 20 | config USB_CHIPIDEA_HOST |
| 21 | bool "ChipIdea host controller" | 21 | bool "ChipIdea host controller" |
| 22 | depends on USB=y | 22 | depends on USB=y |
| 23 | depends on USB_EHCI_HCD=y || USB_CHIPIDEA=m | 23 | depends on USB_EHCI_HCD=y || (USB_CHIPIDEA=m && USB_EHCI_HCD=m) |
| 24 | select USB_EHCI_ROOT_HUB_TT | 24 | select USB_EHCI_ROOT_HUB_TT |
| 25 | help | 25 | help |
| 26 | Say Y here to enable host controller functionality of the | 26 | Say Y here to enable host controller functionality of the |
diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h index aefa0261220c..1b23e354f9fb 100644 --- a/drivers/usb/chipidea/bits.h +++ b/drivers/usb/chipidea/bits.h | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | #define PORTSC_PTC (0x0FUL << 16) | 50 | #define PORTSC_PTC (0x0FUL << 16) |
| 51 | /* PTS and PTW for non lpm version only */ | 51 | /* PTS and PTW for non lpm version only */ |
| 52 | #define PORTSC_PTS(d) \ | 52 | #define PORTSC_PTS(d) \ |
| 53 | ((((d) & 0x3) << 30) | (((d) & 0x4) ? BIT(25) : 0)) | 53 | (u32)((((d) & 0x3) << 30) | (((d) & 0x4) ? BIT(25) : 0)) |
| 54 | #define PORTSC_PTW BIT(28) | 54 | #define PORTSC_PTW BIT(28) |
| 55 | #define PORTSC_STS BIT(29) | 55 | #define PORTSC_STS BIT(29) |
| 56 | 56 | ||
| @@ -59,7 +59,7 @@ | |||
| 59 | #define DEVLC_PSPD_HS (0x02UL << 25) | 59 | #define DEVLC_PSPD_HS (0x02UL << 25) |
| 60 | #define DEVLC_PTW BIT(27) | 60 | #define DEVLC_PTW BIT(27) |
| 61 | #define DEVLC_STS BIT(28) | 61 | #define DEVLC_STS BIT(28) |
| 62 | #define DEVLC_PTS(d) (((d) & 0x7) << 29) | 62 | #define DEVLC_PTS(d) (u32)(((d) & 0x7) << 29) |
| 63 | 63 | ||
| 64 | /* Encoding for DEVLC_PTS and PORTSC_PTS */ | 64 | /* Encoding for DEVLC_PTS and PORTSC_PTS */ |
| 65 | #define PTS_UTMI 0 | 65 | #define PTS_UTMI 0 |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 4191db32f12c..4a8a1d68002c 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -668,6 +668,15 @@ resubmit: | |||
| 668 | static inline int | 668 | static inline int |
| 669 | hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) | 669 | hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) |
| 670 | { | 670 | { |
| 671 | /* Need to clear both directions for control ep */ | ||
| 672 | if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) == | ||
| 673 | USB_ENDPOINT_XFER_CONTROL) { | ||
| 674 | int status = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), | ||
| 675 | HUB_CLEAR_TT_BUFFER, USB_RT_PORT, | ||
| 676 | devinfo ^ 0x8000, tt, NULL, 0, 1000); | ||
| 677 | if (status) | ||
| 678 | return status; | ||
| 679 | } | ||
| 671 | return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), | 680 | return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), |
| 672 | HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo, | 681 | HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo, |
| 673 | tt, NULL, 0, 1000); | 682 | tt, NULL, 0, 1000); |
| @@ -2848,6 +2857,15 @@ static int usb_disable_function_remotewakeup(struct usb_device *udev) | |||
| 2848 | USB_CTRL_SET_TIMEOUT); | 2857 | USB_CTRL_SET_TIMEOUT); |
| 2849 | } | 2858 | } |
| 2850 | 2859 | ||
| 2860 | /* Count of wakeup-enabled devices at or below udev */ | ||
| 2861 | static unsigned wakeup_enabled_descendants(struct usb_device *udev) | ||
| 2862 | { | ||
| 2863 | struct usb_hub *hub = usb_hub_to_struct_hub(udev); | ||
| 2864 | |||
| 2865 | return udev->do_remote_wakeup + | ||
| 2866 | (hub ? hub->wakeup_enabled_descendants : 0); | ||
| 2867 | } | ||
| 2868 | |||
| 2851 | /* | 2869 | /* |
| 2852 | * usb_port_suspend - suspend a usb device's upstream port | 2870 | * usb_port_suspend - suspend a usb device's upstream port |
| 2853 | * @udev: device that's no longer in active use, not a root hub | 2871 | * @udev: device that's no longer in active use, not a root hub |
| @@ -2888,8 +2906,8 @@ static int usb_disable_function_remotewakeup(struct usb_device *udev) | |||
| 2888 | * Linux (2.6) currently has NO mechanisms to initiate that: no khubd | 2906 | * Linux (2.6) currently has NO mechanisms to initiate that: no khubd |
| 2889 | * timer, no SRP, no requests through sysfs. | 2907 | * timer, no SRP, no requests through sysfs. |
| 2890 | * | 2908 | * |
| 2891 | * If Runtime PM isn't enabled or used, non-SuperSpeed devices really get | 2909 | * If Runtime PM isn't enabled or used, non-SuperSpeed devices may not get |
| 2892 | * suspended only when their bus goes into global suspend (i.e., the root | 2910 | * suspended until their bus goes into global suspend (i.e., the root |
| 2893 | * hub is suspended). Nevertheless, we change @udev->state to | 2911 | * hub is suspended). Nevertheless, we change @udev->state to |
| 2894 | * USB_STATE_SUSPENDED as this is the device's "logical" state. The actual | 2912 | * USB_STATE_SUSPENDED as this is the device's "logical" state. The actual |
| 2895 | * upstream port setting is stored in @udev->port_is_suspended. | 2913 | * upstream port setting is stored in @udev->port_is_suspended. |
| @@ -2960,15 +2978,21 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) | |||
| 2960 | /* see 7.1.7.6 */ | 2978 | /* see 7.1.7.6 */ |
| 2961 | if (hub_is_superspeed(hub->hdev)) | 2979 | if (hub_is_superspeed(hub->hdev)) |
| 2962 | status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U3); | 2980 | status = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_U3); |
| 2963 | else if (PMSG_IS_AUTO(msg)) | 2981 | |
| 2964 | status = set_port_feature(hub->hdev, port1, | ||
| 2965 | USB_PORT_FEAT_SUSPEND); | ||
| 2966 | /* | 2982 | /* |
| 2967 | * For system suspend, we do not need to enable the suspend feature | 2983 | * For system suspend, we do not need to enable the suspend feature |
| 2968 | * on individual USB-2 ports. The devices will automatically go | 2984 | * on individual USB-2 ports. The devices will automatically go |
| 2969 | * into suspend a few ms after the root hub stops sending packets. | 2985 | * into suspend a few ms after the root hub stops sending packets. |
| 2970 | * The USB 2.0 spec calls this "global suspend". | 2986 | * The USB 2.0 spec calls this "global suspend". |
| 2987 | * | ||
| 2988 | * However, many USB hubs have a bug: They don't relay wakeup requests | ||
| 2989 | * from a downstream port if the port's suspend feature isn't on. | ||
| 2990 | * Therefore we will turn on the suspend feature if udev or any of its | ||
| 2991 | * descendants is enabled for remote wakeup. | ||
| 2971 | */ | 2992 | */ |
| 2993 | else if (PMSG_IS_AUTO(msg) || wakeup_enabled_descendants(udev) > 0) | ||
| 2994 | status = set_port_feature(hub->hdev, port1, | ||
| 2995 | USB_PORT_FEAT_SUSPEND); | ||
| 2972 | else { | 2996 | else { |
| 2973 | really_suspend = false; | 2997 | really_suspend = false; |
| 2974 | status = 0; | 2998 | status = 0; |
| @@ -3003,15 +3027,16 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) | |||
| 3003 | if (!PMSG_IS_AUTO(msg)) | 3027 | if (!PMSG_IS_AUTO(msg)) |
| 3004 | status = 0; | 3028 | status = 0; |
| 3005 | } else { | 3029 | } else { |
| 3006 | /* device has up to 10 msec to fully suspend */ | ||
| 3007 | dev_dbg(&udev->dev, "usb %ssuspend, wakeup %d\n", | 3030 | dev_dbg(&udev->dev, "usb %ssuspend, wakeup %d\n", |
| 3008 | (PMSG_IS_AUTO(msg) ? "auto-" : ""), | 3031 | (PMSG_IS_AUTO(msg) ? "auto-" : ""), |
| 3009 | udev->do_remote_wakeup); | 3032 | udev->do_remote_wakeup); |
| 3010 | usb_set_device_state(udev, USB_STATE_SUSPENDED); | ||
| 3011 | if (really_suspend) { | 3033 | if (really_suspend) { |
| 3012 | udev->port_is_suspended = 1; | 3034 | udev->port_is_suspended = 1; |
| 3035 | |||
| 3036 | /* device has up to 10 msec to fully suspend */ | ||
| 3013 | msleep(10); | 3037 | msleep(10); |
| 3014 | } | 3038 | } |
| 3039 | usb_set_device_state(udev, USB_STATE_SUSPENDED); | ||
| 3015 | } | 3040 | } |
| 3016 | 3041 | ||
| 3017 | /* | 3042 | /* |
| @@ -3293,7 +3318,11 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) | |||
| 3293 | unsigned port1; | 3318 | unsigned port1; |
| 3294 | int status; | 3319 | int status; |
| 3295 | 3320 | ||
| 3296 | /* Warn if children aren't already suspended */ | 3321 | /* |
| 3322 | * Warn if children aren't already suspended. | ||
| 3323 | * Also, add up the number of wakeup-enabled descendants. | ||
| 3324 | */ | ||
| 3325 | hub->wakeup_enabled_descendants = 0; | ||
| 3297 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { | 3326 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { |
| 3298 | struct usb_device *udev; | 3327 | struct usb_device *udev; |
| 3299 | 3328 | ||
| @@ -3303,6 +3332,9 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) | |||
| 3303 | if (PMSG_IS_AUTO(msg)) | 3332 | if (PMSG_IS_AUTO(msg)) |
| 3304 | return -EBUSY; | 3333 | return -EBUSY; |
| 3305 | } | 3334 | } |
| 3335 | if (udev) | ||
| 3336 | hub->wakeup_enabled_descendants += | ||
| 3337 | wakeup_enabled_descendants(udev); | ||
| 3306 | } | 3338 | } |
| 3307 | 3339 | ||
| 3308 | if (hdev->do_remote_wakeup && hub->quirk_check_port_auto_suspend) { | 3340 | if (hdev->do_remote_wakeup && hub->quirk_check_port_auto_suspend) { |
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index 6508e02b3dac..4e4790dea343 100644 --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h | |||
| @@ -59,6 +59,9 @@ struct usb_hub { | |||
| 59 | struct usb_tt tt; /* Transaction Translator */ | 59 | struct usb_tt tt; /* Transaction Translator */ |
| 60 | 60 | ||
| 61 | unsigned mA_per_port; /* current for each child */ | 61 | unsigned mA_per_port; /* current for each child */ |
| 62 | #ifdef CONFIG_PM | ||
| 63 | unsigned wakeup_enabled_descendants; | ||
| 64 | #endif | ||
| 62 | 65 | ||
| 63 | unsigned limited_power:1; | 66 | unsigned limited_power:1; |
| 64 | unsigned quiescing:1; | 67 | unsigned quiescing:1; |
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index 757aa18027d0..2378958ea63e 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config USB_DWC3 | 1 | config USB_DWC3 |
| 2 | tristate "DesignWare USB3 DRD Core Support" | 2 | tristate "DesignWare USB3 DRD Core Support" |
| 3 | depends on (USB || USB_GADGET) && GENERIC_HARDIRQS | 3 | depends on (USB || USB_GADGET) && GENERIC_HARDIRQS && HAS_DMA |
| 4 | select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD | 4 | select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD |
| 5 | help | 5 | help |
| 6 | Say Y or M here if your system has a Dual Role SuperSpeed | 6 | Say Y or M here if your system has a Dual Role SuperSpeed |
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c35d49d39b76..358375e0b291 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
| @@ -450,7 +450,7 @@ static int dwc3_probe(struct platform_device *pdev) | |||
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | if (IS_ERR(dwc->usb3_phy)) { | 452 | if (IS_ERR(dwc->usb3_phy)) { |
| 453 | ret = PTR_ERR(dwc->usb2_phy); | 453 | ret = PTR_ERR(dwc->usb3_phy); |
| 454 | 454 | ||
| 455 | /* | 455 | /* |
| 456 | * if -ENXIO is returned, it means PHY layer wasn't | 456 | * if -ENXIO is returned, it means PHY layer wasn't |
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index b69d322e3cab..27dad993b007 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h | |||
| @@ -759,8 +759,8 @@ struct dwc3 { | |||
| 759 | 759 | ||
| 760 | struct dwc3_event_type { | 760 | struct dwc3_event_type { |
| 761 | u32 is_devspec:1; | 761 | u32 is_devspec:1; |
| 762 | u32 type:6; | 762 | u32 type:7; |
| 763 | u32 reserved8_31:25; | 763 | u32 reserved8_31:24; |
| 764 | } __packed; | 764 | } __packed; |
| 765 | 765 | ||
| 766 | #define DWC3_DEPEVT_XFERCOMPLETE 0x01 | 766 | #define DWC3_DEPEVT_XFERCOMPLETE 0x01 |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b5e5b35df49c..f77083fedc68 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -1584,6 +1584,7 @@ err1: | |||
| 1584 | __dwc3_gadget_ep_disable(dwc->eps[0]); | 1584 | __dwc3_gadget_ep_disable(dwc->eps[0]); |
| 1585 | 1585 | ||
| 1586 | err0: | 1586 | err0: |
| 1587 | dwc->gadget_driver = NULL; | ||
| 1587 | spin_unlock_irqrestore(&dwc->lock, flags); | 1588 | spin_unlock_irqrestore(&dwc->lock, flags); |
| 1588 | 1589 | ||
| 1589 | return ret; | 1590 | return ret; |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 62f6802f6e0f..8e9368330b10 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
| @@ -193,6 +193,7 @@ config USB_FUSB300 | |||
| 193 | Faraday usb device controller FUSB300 driver | 193 | Faraday usb device controller FUSB300 driver |
| 194 | 194 | ||
| 195 | config USB_FOTG210_UDC | 195 | config USB_FOTG210_UDC |
| 196 | depends on HAS_DMA | ||
| 196 | tristate "Faraday FOTG210 USB Peripheral Controller" | 197 | tristate "Faraday FOTG210 USB Peripheral Controller" |
| 197 | help | 198 | help |
| 198 | Faraday USB2.0 OTG controller which can be configured as | 199 | Faraday USB2.0 OTG controller which can be configured as |
| @@ -328,13 +329,14 @@ config USB_S3C_HSUDC | |||
| 328 | 329 | ||
| 329 | config USB_MV_UDC | 330 | config USB_MV_UDC |
| 330 | tristate "Marvell USB2.0 Device Controller" | 331 | tristate "Marvell USB2.0 Device Controller" |
| 331 | depends on GENERIC_HARDIRQS | 332 | depends on GENERIC_HARDIRQS && HAS_DMA |
| 332 | help | 333 | help |
| 333 | Marvell Socs (including PXA and MMP series) include a high speed | 334 | Marvell Socs (including PXA and MMP series) include a high speed |
| 334 | USB2.0 OTG controller, which can be configured as high speed or | 335 | USB2.0 OTG controller, which can be configured as high speed or |
| 335 | full speed USB peripheral. | 336 | full speed USB peripheral. |
| 336 | 337 | ||
| 337 | config USB_MV_U3D | 338 | config USB_MV_U3D |
| 339 | depends on HAS_DMA | ||
| 338 | tristate "MARVELL PXA2128 USB 3.0 controller" | 340 | tristate "MARVELL PXA2128 USB 3.0 controller" |
| 339 | help | 341 | help |
| 340 | MARVELL PXA2128 Processor series include a super speed USB3.0 device | 342 | MARVELL PXA2128 Processor series include a super speed USB3.0 device |
| @@ -639,6 +641,7 @@ config USB_CONFIGFS_RNDIS | |||
| 639 | depends on USB_CONFIGFS | 641 | depends on USB_CONFIGFS |
| 640 | depends on NET | 642 | depends on NET |
| 641 | select USB_U_ETHER | 643 | select USB_U_ETHER |
| 644 | select USB_U_RNDIS | ||
| 642 | select USB_F_RNDIS | 645 | select USB_F_RNDIS |
| 643 | help | 646 | help |
| 644 | Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, | 647 | Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 073b938f9135..d9a6add0c852 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
| @@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc) | |||
| 870 | if (udc->clocked) | 870 | if (udc->clocked) |
| 871 | return; | 871 | return; |
| 872 | udc->clocked = 1; | 872 | udc->clocked = 1; |
| 873 | clk_enable(udc->iclk); | 873 | clk_prepare_enable(udc->iclk); |
| 874 | clk_enable(udc->fclk); | 874 | clk_prepare_enable(udc->fclk); |
| 875 | } | 875 | } |
| 876 | 876 | ||
| 877 | static void clk_off(struct at91_udc *udc) | 877 | static void clk_off(struct at91_udc *udc) |
| @@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc) | |||
| 880 | return; | 880 | return; |
| 881 | udc->clocked = 0; | 881 | udc->clocked = 0; |
| 882 | udc->gadget.speed = USB_SPEED_UNKNOWN; | 882 | udc->gadget.speed = USB_SPEED_UNKNOWN; |
| 883 | clk_disable(udc->fclk); | 883 | clk_disable_unprepare(udc->fclk); |
| 884 | clk_disable(udc->iclk); | 884 | clk_disable_unprepare(udc->iclk); |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | /* | 887 | /* |
| @@ -1725,7 +1725,7 @@ static int at91udc_probe(struct platform_device *pdev) | |||
| 1725 | /* init software state */ | 1725 | /* init software state */ |
| 1726 | udc = &controller; | 1726 | udc = &controller; |
| 1727 | udc->gadget.dev.parent = dev; | 1727 | udc->gadget.dev.parent = dev; |
| 1728 | if (pdev->dev.of_node) | 1728 | if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) |
| 1729 | at91udc_of_init(udc, pdev->dev.of_node); | 1729 | at91udc_of_init(udc, pdev->dev.of_node); |
| 1730 | else | 1730 | else |
| 1731 | memcpy(&udc->board, dev->platform_data, | 1731 | memcpy(&udc->board, dev->platform_data, |
| @@ -1782,12 +1782,14 @@ static int at91udc_probe(struct platform_device *pdev) | |||
| 1782 | } | 1782 | } |
| 1783 | 1783 | ||
| 1784 | /* don't do anything until we have both gadget driver and VBUS */ | 1784 | /* don't do anything until we have both gadget driver and VBUS */ |
| 1785 | clk_enable(udc->iclk); | 1785 | retval = clk_prepare_enable(udc->iclk); |
| 1786 | if (retval) | ||
| 1787 | goto fail1; | ||
| 1786 | at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); | 1788 | at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); |
| 1787 | at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff); | 1789 | at91_udp_write(udc, AT91_UDP_IDR, 0xffffffff); |
| 1788 | /* Clear all pending interrupts - UDP may be used by bootloader. */ | 1790 | /* Clear all pending interrupts - UDP may be used by bootloader. */ |
| 1789 | at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff); | 1791 | at91_udp_write(udc, AT91_UDP_ICR, 0xffffffff); |
| 1790 | clk_disable(udc->iclk); | 1792 | clk_disable_unprepare(udc->iclk); |
| 1791 | 1793 | ||
| 1792 | /* request UDC and maybe VBUS irqs */ | 1794 | /* request UDC and maybe VBUS irqs */ |
| 1793 | udc->udp_irq = platform_get_irq(pdev, 0); | 1795 | udc->udp_irq = platform_get_irq(pdev, 0); |
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index f48712ffe261..c1c113ef950c 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
| @@ -449,14 +449,20 @@ fail: | |||
| 449 | 449 | ||
| 450 | static int __exit eth_unbind(struct usb_composite_dev *cdev) | 450 | static int __exit eth_unbind(struct usb_composite_dev *cdev) |
| 451 | { | 451 | { |
| 452 | if (has_rndis()) | 452 | if (has_rndis()) { |
| 453 | usb_put_function(f_rndis); | ||
| 453 | usb_put_function_instance(fi_rndis); | 454 | usb_put_function_instance(fi_rndis); |
| 454 | if (use_eem) | 455 | } |
| 456 | if (use_eem) { | ||
| 457 | usb_put_function(f_eem); | ||
| 455 | usb_put_function_instance(fi_eem); | 458 | usb_put_function_instance(fi_eem); |
| 456 | else if (can_support_ecm(cdev->gadget)) | 459 | } else if (can_support_ecm(cdev->gadget)) { |
| 460 | usb_put_function(f_ecm); | ||
| 457 | usb_put_function_instance(fi_ecm); | 461 | usb_put_function_instance(fi_ecm); |
| 458 | else | 462 | } else { |
| 463 | usb_put_function(f_geth); | ||
| 459 | usb_put_function_instance(fi_geth); | 464 | usb_put_function_instance(fi_geth); |
| 465 | } | ||
| 460 | return 0; | 466 | return 0; |
| 461 | } | 467 | } |
| 462 | 468 | ||
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c index 5d3561ea1c15..edab45da3741 100644 --- a/drivers/usb/gadget/f_ecm.c +++ b/drivers/usb/gadget/f_ecm.c | |||
| @@ -959,8 +959,11 @@ static struct usb_function_instance *ecm_alloc_inst(void) | |||
| 959 | mutex_init(&opts->lock); | 959 | mutex_init(&opts->lock); |
| 960 | opts->func_inst.free_func_inst = ecm_free_inst; | 960 | opts->func_inst.free_func_inst = ecm_free_inst; |
| 961 | opts->net = gether_setup_default(); | 961 | opts->net = gether_setup_default(); |
| 962 | if (IS_ERR(opts->net)) | 962 | if (IS_ERR(opts->net)) { |
| 963 | return ERR_PTR(PTR_ERR(opts->net)); | 963 | struct net_device *net = opts->net; |
| 964 | kfree(opts); | ||
| 965 | return ERR_CAST(net); | ||
| 966 | } | ||
| 964 | 967 | ||
| 965 | config_group_init_type_name(&opts->func_inst.group, "", &ecm_func_type); | 968 | config_group_init_type_name(&opts->func_inst.group, "", &ecm_func_type); |
| 966 | 969 | ||
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index 90ee8022e8d8..d00392d879db 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c | |||
| @@ -593,8 +593,11 @@ static struct usb_function_instance *eem_alloc_inst(void) | |||
| 593 | mutex_init(&opts->lock); | 593 | mutex_init(&opts->lock); |
| 594 | opts->func_inst.free_func_inst = eem_free_inst; | 594 | opts->func_inst.free_func_inst = eem_free_inst; |
| 595 | opts->net = gether_setup_default(); | 595 | opts->net = gether_setup_default(); |
| 596 | if (IS_ERR(opts->net)) | 596 | if (IS_ERR(opts->net)) { |
| 597 | return ERR_CAST(opts->net); | 597 | struct net_device *net = opts->net; |
| 598 | kfree(opts); | ||
| 599 | return ERR_CAST(net); | ||
| 600 | } | ||
| 598 | 601 | ||
| 599 | config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type); | 602 | config_group_init_type_name(&opts->func_inst.group, "", &eem_func_type); |
| 600 | 603 | ||
diff --git a/drivers/usb/gadget/f_ncm.c b/drivers/usb/gadget/f_ncm.c index 952177f7eb9b..1c28fe13328a 100644 --- a/drivers/usb/gadget/f_ncm.c +++ b/drivers/usb/gadget/f_ncm.c | |||
| @@ -1350,8 +1350,11 @@ static struct usb_function_instance *ncm_alloc_inst(void) | |||
| 1350 | mutex_init(&opts->lock); | 1350 | mutex_init(&opts->lock); |
| 1351 | opts->func_inst.free_func_inst = ncm_free_inst; | 1351 | opts->func_inst.free_func_inst = ncm_free_inst; |
| 1352 | opts->net = gether_setup_default(); | 1352 | opts->net = gether_setup_default(); |
| 1353 | if (IS_ERR(opts->net)) | 1353 | if (IS_ERR(opts->net)) { |
| 1354 | return ERR_PTR(PTR_ERR(opts->net)); | 1354 | struct net_device *net = opts->net; |
| 1355 | kfree(opts); | ||
| 1356 | return ERR_CAST(net); | ||
| 1357 | } | ||
| 1355 | 1358 | ||
| 1356 | config_group_init_type_name(&opts->func_inst.group, "", &ncm_func_type); | 1359 | config_group_init_type_name(&opts->func_inst.group, "", &ncm_func_type); |
| 1357 | 1360 | ||
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c index 7944fb0efe3b..eb3aa817a662 100644 --- a/drivers/usb/gadget/f_phonet.c +++ b/drivers/usb/gadget/f_phonet.c | |||
| @@ -488,7 +488,6 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f) | |||
| 488 | struct usb_ep *ep; | 488 | struct usb_ep *ep; |
| 489 | int status, i; | 489 | int status, i; |
| 490 | 490 | ||
| 491 | #ifndef USBF_PHONET_INCLUDED | ||
| 492 | struct f_phonet_opts *phonet_opts; | 491 | struct f_phonet_opts *phonet_opts; |
| 493 | 492 | ||
| 494 | phonet_opts = container_of(f->fi, struct f_phonet_opts, func_inst); | 493 | phonet_opts = container_of(f->fi, struct f_phonet_opts, func_inst); |
| @@ -507,7 +506,6 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f) | |||
| 507 | return status; | 506 | return status; |
| 508 | phonet_opts->bound = true; | 507 | phonet_opts->bound = true; |
| 509 | } | 508 | } |
| 510 | #endif | ||
| 511 | 509 | ||
| 512 | /* Reserve interface IDs */ | 510 | /* Reserve interface IDs */ |
| 513 | status = usb_interface_id(c, f); | 511 | status = usb_interface_id(c, f); |
| @@ -656,8 +654,11 @@ static struct usb_function_instance *phonet_alloc_inst(void) | |||
| 656 | 654 | ||
| 657 | opts->func_inst.free_func_inst = phonet_free_inst; | 655 | opts->func_inst.free_func_inst = phonet_free_inst; |
| 658 | opts->net = gphonet_setup_default(); | 656 | opts->net = gphonet_setup_default(); |
| 659 | if (IS_ERR(opts->net)) | 657 | if (IS_ERR(opts->net)) { |
| 660 | return ERR_PTR(PTR_ERR(opts->net)); | 658 | struct net_device *net = opts->net; |
| 659 | kfree(opts); | ||
| 660 | return ERR_CAST(net); | ||
| 661 | } | ||
| 661 | 662 | ||
| 662 | config_group_init_type_name(&opts->func_inst.group, "", | 663 | config_group_init_type_name(&opts->func_inst.group, "", |
| 663 | &phonet_func_type); | 664 | &phonet_func_type); |
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 191df35ae69d..717ed7f95639 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
| @@ -963,8 +963,11 @@ static struct usb_function_instance *rndis_alloc_inst(void) | |||
| 963 | mutex_init(&opts->lock); | 963 | mutex_init(&opts->lock); |
| 964 | opts->func_inst.free_func_inst = rndis_free_inst; | 964 | opts->func_inst.free_func_inst = rndis_free_inst; |
| 965 | opts->net = gether_setup_default(); | 965 | opts->net = gether_setup_default(); |
| 966 | if (IS_ERR(opts->net)) | 966 | if (IS_ERR(opts->net)) { |
| 967 | return ERR_CAST(opts->net); | 967 | struct net_device *net = opts->net; |
| 968 | kfree(opts); | ||
| 969 | return ERR_CAST(net); | ||
| 970 | } | ||
| 968 | 971 | ||
| 969 | config_group_init_type_name(&opts->func_inst.group, "", | 972 | config_group_init_type_name(&opts->func_inst.group, "", |
| 970 | &rndis_func_type); | 973 | &rndis_func_type); |
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index 5601e1d96c4f..7c8674fa7e80 100644 --- a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c | |||
| @@ -505,8 +505,11 @@ static struct usb_function_instance *geth_alloc_inst(void) | |||
| 505 | mutex_init(&opts->lock); | 505 | mutex_init(&opts->lock); |
| 506 | opts->func_inst.free_func_inst = geth_free_inst; | 506 | opts->func_inst.free_func_inst = geth_free_inst; |
| 507 | opts->net = gether_setup_default(); | 507 | opts->net = gether_setup_default(); |
| 508 | if (IS_ERR(opts->net)) | 508 | if (IS_ERR(opts->net)) { |
| 509 | return ERR_CAST(opts->net); | 509 | struct net_device *net = opts->net; |
| 510 | kfree(opts); | ||
| 511 | return ERR_CAST(net); | ||
| 512 | } | ||
| 510 | 513 | ||
| 511 | config_group_init_type_name(&opts->func_inst.group, "", | 514 | config_group_init_type_name(&opts->func_inst.group, "", |
| 512 | &gether_func_type); | 515 | &gether_func_type); |
diff --git a/drivers/usb/gadget/fotg210-udc.c b/drivers/usb/gadget/fotg210-udc.c index cce5535b1dc6..10cd18ddd0d4 100644 --- a/drivers/usb/gadget/fotg210-udc.c +++ b/drivers/usb/gadget/fotg210-udc.c | |||
| @@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = { | |||
| 1074 | .udc_stop = fotg210_udc_stop, | 1074 | .udc_stop = fotg210_udc_stop, |
| 1075 | }; | 1075 | }; |
| 1076 | 1076 | ||
| 1077 | static int __exit fotg210_udc_remove(struct platform_device *pdev) | 1077 | static int fotg210_udc_remove(struct platform_device *pdev) |
| 1078 | { | 1078 | { |
| 1079 | struct fotg210_udc *fotg210 = dev_get_drvdata(&pdev->dev); | 1079 | struct fotg210_udc *fotg210 = dev_get_drvdata(&pdev->dev); |
| 1080 | 1080 | ||
| @@ -1088,7 +1088,7 @@ static int __exit fotg210_udc_remove(struct platform_device *pdev) | |||
| 1088 | return 0; | 1088 | return 0; |
| 1089 | } | 1089 | } |
| 1090 | 1090 | ||
| 1091 | static int __init fotg210_udc_probe(struct platform_device *pdev) | 1091 | static int fotg210_udc_probe(struct platform_device *pdev) |
| 1092 | { | 1092 | { |
| 1093 | struct resource *res, *ires; | 1093 | struct resource *res, *ires; |
| 1094 | struct fotg210_udc *fotg210 = NULL; | 1094 | struct fotg210_udc *fotg210 = NULL; |
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 032b96a51ce4..2a1ebefd8f9e 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c | |||
| @@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c) | |||
| 160 | return ret; | 160 | return ret; |
| 161 | 161 | ||
| 162 | f_acm_rndis = usb_get_function(fi_acm); | 162 | f_acm_rndis = usb_get_function(fi_acm); |
| 163 | if (IS_ERR(f_acm_rndis)) { | 163 | if (IS_ERR(f_acm_rndis)) |
| 164 | ret = PTR_ERR(f_acm_rndis); | 164 | return PTR_ERR(f_acm_rndis); |
| 165 | goto err_func_acm; | ||
| 166 | } | ||
| 167 | 165 | ||
| 168 | ret = usb_add_function(c, f_acm_rndis); | 166 | ret = usb_add_function(c, f_acm_rndis); |
| 169 | if (ret) | 167 | if (ret) |
| @@ -178,7 +176,6 @@ err_fsg: | |||
| 178 | usb_remove_function(c, f_acm_rndis); | 176 | usb_remove_function(c, f_acm_rndis); |
| 179 | err_conf: | 177 | err_conf: |
| 180 | usb_put_function(f_acm_rndis); | 178 | usb_put_function(f_acm_rndis); |
| 181 | err_func_acm: | ||
| 182 | return ret; | 179 | return ret; |
| 183 | } | 180 | } |
| 184 | 181 | ||
| @@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c) | |||
| 226 | /* implicit port_num is zero */ | 223 | /* implicit port_num is zero */ |
| 227 | f_acm_multi = usb_get_function(fi_acm); | 224 | f_acm_multi = usb_get_function(fi_acm); |
| 228 | if (IS_ERR(f_acm_multi)) | 225 | if (IS_ERR(f_acm_multi)) |
| 229 | goto err_func_acm; | 226 | return PTR_ERR(f_acm_multi); |
| 230 | 227 | ||
| 231 | ret = usb_add_function(c, f_acm_multi); | 228 | ret = usb_add_function(c, f_acm_multi); |
| 232 | if (ret) | 229 | if (ret) |
| @@ -241,7 +238,6 @@ err_fsg: | |||
| 241 | usb_remove_function(c, f_acm_multi); | 238 | usb_remove_function(c, f_acm_multi); |
| 242 | err_conf: | 239 | err_conf: |
| 243 | usb_put_function(f_acm_multi); | 240 | usb_put_function(f_acm_multi); |
| 244 | err_func_acm: | ||
| 245 | return ret; | 241 | return ret; |
| 246 | } | 242 | } |
| 247 | 243 | ||
diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c index 07fdb3eaf48a..ec6a2d290398 100644 --- a/drivers/usb/gadget/mv_u3d_core.c +++ b/drivers/usb/gadget/mv_u3d_core.c | |||
| @@ -1776,7 +1776,7 @@ static int mv_u3d_remove(struct platform_device *dev) | |||
| 1776 | kfree(u3d->eps); | 1776 | kfree(u3d->eps); |
| 1777 | 1777 | ||
| 1778 | if (u3d->irq) | 1778 | if (u3d->irq) |
| 1779 | free_irq(u3d->irq, &dev->dev); | 1779 | free_irq(u3d->irq, u3d); |
| 1780 | 1780 | ||
| 1781 | if (u3d->cap_regs) | 1781 | if (u3d->cap_regs) |
| 1782 | iounmap(u3d->cap_regs); | 1782 | iounmap(u3d->cap_regs); |
| @@ -1974,7 +1974,7 @@ static int mv_u3d_probe(struct platform_device *dev) | |||
| 1974 | return 0; | 1974 | return 0; |
| 1975 | 1975 | ||
| 1976 | err_unregister: | 1976 | err_unregister: |
| 1977 | free_irq(u3d->irq, &dev->dev); | 1977 | free_irq(u3d->irq, u3d); |
| 1978 | err_request_irq: | 1978 | err_request_irq: |
| 1979 | err_get_irq: | 1979 | err_get_irq: |
| 1980 | kfree(u3d->status_req); | 1980 | kfree(u3d->status_req); |
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index ffd8fa541101..13e25f80fc20 100644 --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c | |||
| @@ -50,6 +50,8 @@ static DEFINE_MUTEX(udc_lock); | |||
| 50 | 50 | ||
| 51 | /* ------------------------------------------------------------------------- */ | 51 | /* ------------------------------------------------------------------------- */ |
| 52 | 52 | ||
| 53 | #ifdef CONFIG_HAS_DMA | ||
| 54 | |||
| 53 | int usb_gadget_map_request(struct usb_gadget *gadget, | 55 | int usb_gadget_map_request(struct usb_gadget *gadget, |
| 54 | struct usb_request *req, int is_in) | 56 | struct usb_request *req, int is_in) |
| 55 | { | 57 | { |
| @@ -99,13 +101,15 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget, | |||
| 99 | } | 101 | } |
| 100 | EXPORT_SYMBOL_GPL(usb_gadget_unmap_request); | 102 | EXPORT_SYMBOL_GPL(usb_gadget_unmap_request); |
| 101 | 103 | ||
| 104 | #endif /* CONFIG_HAS_DMA */ | ||
| 105 | |||
| 102 | /* ------------------------------------------------------------------------- */ | 106 | /* ------------------------------------------------------------------------- */ |
| 103 | 107 | ||
| 104 | void usb_gadget_set_state(struct usb_gadget *gadget, | 108 | void usb_gadget_set_state(struct usb_gadget *gadget, |
| 105 | enum usb_device_state state) | 109 | enum usb_device_state state) |
| 106 | { | 110 | { |
| 107 | gadget->state = state; | 111 | gadget->state = state; |
| 108 | sysfs_notify(&gadget->dev.kobj, NULL, "status"); | 112 | sysfs_notify(&gadget->dev.kobj, NULL, "state"); |
| 109 | } | 113 | } |
| 110 | EXPORT_SYMBOL_GPL(usb_gadget_set_state); | 114 | EXPORT_SYMBOL_GPL(usb_gadget_set_state); |
| 111 | 115 | ||
| @@ -194,9 +198,11 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget, | |||
| 194 | dev_set_name(&gadget->dev, "gadget"); | 198 | dev_set_name(&gadget->dev, "gadget"); |
| 195 | gadget->dev.parent = parent; | 199 | gadget->dev.parent = parent; |
| 196 | 200 | ||
| 201 | #ifdef CONFIG_HAS_DMA | ||
| 197 | dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask); | 202 | dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask); |
| 198 | gadget->dev.dma_parms = parent->dma_parms; | 203 | gadget->dev.dma_parms = parent->dma_parms; |
| 199 | gadget->dev.dma_mask = parent->dma_mask; | 204 | gadget->dev.dma_mask = parent->dma_mask; |
| 205 | #endif | ||
| 200 | 206 | ||
| 201 | if (release) | 207 | if (release) |
| 202 | gadget->dev.release = release; | 208 | gadget->dev.release = release; |
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 2b702772d04d..6dce37555c4f 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
| @@ -874,6 +874,7 @@ static int ehci_hub_control ( | |||
| 874 | ehci->reset_done[wIndex] = jiffies | 874 | ehci->reset_done[wIndex] = jiffies |
| 875 | + msecs_to_jiffies(20); | 875 | + msecs_to_jiffies(20); |
| 876 | usb_hcd_start_port_resume(&hcd->self, wIndex); | 876 | usb_hcd_start_port_resume(&hcd->self, wIndex); |
| 877 | set_bit(wIndex, &ehci->resuming_ports); | ||
| 877 | /* check the port again */ | 878 | /* check the port again */ |
| 878 | mod_timer(&ehci_to_hcd(ehci)->rh_timer, | 879 | mod_timer(&ehci_to_hcd(ehci)->rh_timer, |
| 879 | ehci->reset_done[wIndex]); | 880 | ehci->reset_done[wIndex]); |
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h index 4b8a2092432f..978c849f9c9a 100644 --- a/drivers/usb/host/pci-quirks.h +++ b/drivers/usb/host/pci-quirks.h | |||
| @@ -13,6 +13,7 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev); | |||
| 13 | void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); | 13 | void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); |
| 14 | void sb800_prefetch(struct device *dev, int on); | 14 | void sb800_prefetch(struct device *dev, int on); |
| 15 | #else | 15 | #else |
| 16 | struct pci_dev; | ||
| 16 | static inline void usb_amd_quirk_pll_disable(void) {} | 17 | static inline void usb_amd_quirk_pll_disable(void) {} |
| 17 | static inline void usb_amd_quirk_pll_enable(void) {} | 18 | static inline void usb_amd_quirk_pll_enable(void) {} |
| 18 | static inline void usb_amd_dev_put(void) {} | 19 | static inline void usb_amd_dev_put(void) {} |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index cc24e39b97d5..f00cb203faea 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
| @@ -93,7 +93,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
| 93 | } | 93 | } |
| 94 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && | 94 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && |
| 95 | pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { | 95 | pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { |
| 96 | xhci->quirks |= XHCI_SPURIOUS_SUCCESS; | ||
| 97 | xhci->quirks |= XHCI_EP_LIMIT_QUIRK; | 96 | xhci->quirks |= XHCI_EP_LIMIT_QUIRK; |
| 98 | xhci->limit_active_eps = 64; | 97 | xhci->limit_active_eps = 64; |
| 99 | xhci->quirks |= XHCI_SW_BW_CHECKING; | 98 | xhci->quirks |= XHCI_SW_BW_CHECKING; |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 1e57eafa6910..5b08cd85f8e7 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -434,7 +434,7 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci, | |||
| 434 | 434 | ||
| 435 | /* A ring has pending URBs if its TD list is not empty */ | 435 | /* A ring has pending URBs if its TD list is not empty */ |
| 436 | if (!(ep->ep_state & EP_HAS_STREAMS)) { | 436 | if (!(ep->ep_state & EP_HAS_STREAMS)) { |
| 437 | if (!(list_empty(&ep->ring->td_list))) | 437 | if (ep->ring && !(list_empty(&ep->ring->td_list))) |
| 438 | xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0); | 438 | xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0); |
| 439 | return; | 439 | return; |
| 440 | } | 440 | } |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 2c49f00260ca..41eb4fc33453 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -329,7 +329,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci) | |||
| 329 | return; | 329 | return; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) | 332 | static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) |
| 333 | { | 333 | { |
| 334 | int i; | 334 | int i; |
| 335 | 335 | ||
| @@ -1181,9 +1181,6 @@ static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, | |||
| 1181 | } | 1181 | } |
| 1182 | 1182 | ||
| 1183 | xhci = hcd_to_xhci(hcd); | 1183 | xhci = hcd_to_xhci(hcd); |
| 1184 | if (xhci->xhc_state & XHCI_STATE_HALTED) | ||
| 1185 | return -ENODEV; | ||
| 1186 | |||
| 1187 | if (check_virt_dev) { | 1184 | if (check_virt_dev) { |
| 1188 | if (!udev->slot_id || !xhci->devs[udev->slot_id]) { | 1185 | if (!udev->slot_id || !xhci->devs[udev->slot_id]) { |
| 1189 | printk(KERN_DEBUG "xHCI %s called with unaddressed " | 1186 | printk(KERN_DEBUG "xHCI %s called with unaddressed " |
| @@ -1199,6 +1196,9 @@ static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, | |||
| 1199 | } | 1196 | } |
| 1200 | } | 1197 | } |
| 1201 | 1198 | ||
| 1199 | if (xhci->xhc_state & XHCI_STATE_HALTED) | ||
| 1200 | return -ENODEV; | ||
| 1201 | |||
| 1202 | return 1; | 1202 | return 1; |
| 1203 | } | 1203 | } |
| 1204 | 1204 | ||
| @@ -3898,7 +3898,7 @@ int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1) | |||
| 3898 | * Issue an Evaluate Context command to change the Maximum Exit Latency in the | 3898 | * Issue an Evaluate Context command to change the Maximum Exit Latency in the |
| 3899 | * slot context. If that succeeds, store the new MEL in the xhci_virt_device. | 3899 | * slot context. If that succeeds, store the new MEL in the xhci_virt_device. |
| 3900 | */ | 3900 | */ |
| 3901 | static int xhci_change_max_exit_latency(struct xhci_hcd *xhci, | 3901 | static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci, |
| 3902 | struct usb_device *udev, u16 max_exit_latency) | 3902 | struct usb_device *udev, u16 max_exit_latency) |
| 3903 | { | 3903 | { |
| 3904 | struct xhci_virt_device *virt_dev; | 3904 | struct xhci_virt_device *virt_dev; |
| @@ -4892,6 +4892,13 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) | |||
| 4892 | 4892 | ||
| 4893 | get_quirks(dev, xhci); | 4893 | get_quirks(dev, xhci); |
| 4894 | 4894 | ||
| 4895 | /* In xhci controllers which follow xhci 1.0 spec gives a spurious | ||
| 4896 | * success event after a short transfer. This quirk will ignore such | ||
| 4897 | * spurious event. | ||
| 4898 | */ | ||
| 4899 | if (xhci->hci_version > 0x96) | ||
| 4900 | xhci->quirks |= XHCI_SPURIOUS_SUCCESS; | ||
| 4901 | |||
| 4895 | /* Make sure the HC is halted. */ | 4902 | /* Make sure the HC is halted. */ |
| 4896 | retval = xhci_halt(xhci); | 4903 | retval = xhci_halt(xhci); |
| 4897 | if (retval) | 4904 | if (retval) |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index c21386ec5d35..de98906f786d 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
| @@ -3247,6 +3247,7 @@ static const struct usb_device_id sisusb_table[] = { | |||
| 3247 | { USB_DEVICE(0x0711, 0x0903) }, | 3247 | { USB_DEVICE(0x0711, 0x0903) }, |
| 3248 | { USB_DEVICE(0x0711, 0x0918) }, | 3248 | { USB_DEVICE(0x0711, 0x0918) }, |
| 3249 | { USB_DEVICE(0x0711, 0x0920) }, | 3249 | { USB_DEVICE(0x0711, 0x0920) }, |
| 3250 | { USB_DEVICE(0x0711, 0x0950) }, | ||
| 3250 | { USB_DEVICE(0x182d, 0x021c) }, | 3251 | { USB_DEVICE(0x182d, 0x021c) }, |
| 3251 | { USB_DEVICE(0x182d, 0x0269) }, | 3252 | { USB_DEVICE(0x182d, 0x0269) }, |
| 3252 | { } | 3253 | { } |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 6708a3b78ad8..f44e8b5e00c9 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
| @@ -481,7 +481,7 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32); | |||
| 481 | 481 | ||
| 482 | static int omap2430_probe(struct platform_device *pdev) | 482 | static int omap2430_probe(struct platform_device *pdev) |
| 483 | { | 483 | { |
| 484 | struct resource musb_resources[2]; | 484 | struct resource musb_resources[3]; |
| 485 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; | 485 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; |
| 486 | struct omap_musb_board_data *data; | 486 | struct omap_musb_board_data *data; |
| 487 | struct platform_device *musb; | 487 | struct platform_device *musb; |
| @@ -581,6 +581,11 @@ static int omap2430_probe(struct platform_device *pdev) | |||
| 581 | musb_resources[1].end = pdev->resource[1].end; | 581 | musb_resources[1].end = pdev->resource[1].end; |
| 582 | musb_resources[1].flags = pdev->resource[1].flags; | 582 | musb_resources[1].flags = pdev->resource[1].flags; |
| 583 | 583 | ||
| 584 | musb_resources[2].name = pdev->resource[2].name; | ||
| 585 | musb_resources[2].start = pdev->resource[2].start; | ||
| 586 | musb_resources[2].end = pdev->resource[2].end; | ||
| 587 | musb_resources[2].flags = pdev->resource[2].flags; | ||
| 588 | |||
| 584 | ret = platform_device_add_resources(musb, musb_resources, | 589 | ret = platform_device_add_resources(musb, musb_resources, |
| 585 | ARRAY_SIZE(musb_resources)); | 590 | ARRAY_SIZE(musb_resources)); |
| 586 | if (ret) { | 591 | if (ret) { |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 2c06a8969a9f..6f8a9ca96ae7 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
| @@ -1156,7 +1156,7 @@ static u64 tusb_dmamask = DMA_BIT_MASK(32); | |||
| 1156 | 1156 | ||
| 1157 | static int tusb_probe(struct platform_device *pdev) | 1157 | static int tusb_probe(struct platform_device *pdev) |
| 1158 | { | 1158 | { |
| 1159 | struct resource musb_resources[2]; | 1159 | struct resource musb_resources[3]; |
| 1160 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; | 1160 | struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; |
| 1161 | struct platform_device *musb; | 1161 | struct platform_device *musb; |
| 1162 | struct tusb6010_glue *glue; | 1162 | struct tusb6010_glue *glue; |
| @@ -1199,6 +1199,11 @@ static int tusb_probe(struct platform_device *pdev) | |||
| 1199 | musb_resources[1].end = pdev->resource[1].end; | 1199 | musb_resources[1].end = pdev->resource[1].end; |
| 1200 | musb_resources[1].flags = pdev->resource[1].flags; | 1200 | musb_resources[1].flags = pdev->resource[1].flags; |
| 1201 | 1201 | ||
| 1202 | musb_resources[2].name = pdev->resource[2].name; | ||
| 1203 | musb_resources[2].start = pdev->resource[2].start; | ||
| 1204 | musb_resources[2].end = pdev->resource[2].end; | ||
| 1205 | musb_resources[2].flags = pdev->resource[2].flags; | ||
| 1206 | |||
| 1202 | ret = platform_device_add_resources(musb, musb_resources, | 1207 | ret = platform_device_add_resources(musb, musb_resources, |
| 1203 | ARRAY_SIZE(musb_resources)); | 1208 | ARRAY_SIZE(musb_resources)); |
| 1204 | if (ret) { | 1209 | if (ret) { |
diff --git a/drivers/usb/phy/phy-omap-usb3.c b/drivers/usb/phy/phy-omap-usb3.c index efe6e1464f45..a2fb30bbb971 100644 --- a/drivers/usb/phy/phy-omap-usb3.c +++ b/drivers/usb/phy/phy-omap-usb3.c | |||
| @@ -71,9 +71,9 @@ static struct usb_dpll_params omap_usb3_dpll_params[NUM_SYS_CLKS] = { | |||
| 71 | {1250, 5, 4, 20, 0}, /* 12 MHz */ | 71 | {1250, 5, 4, 20, 0}, /* 12 MHz */ |
| 72 | {3125, 20, 4, 20, 0}, /* 16.8 MHz */ | 72 | {3125, 20, 4, 20, 0}, /* 16.8 MHz */ |
| 73 | {1172, 8, 4, 20, 65537}, /* 19.2 MHz */ | 73 | {1172, 8, 4, 20, 65537}, /* 19.2 MHz */ |
| 74 | {1000, 7, 4, 10, 0}, /* 20 MHz */ | ||
| 74 | {1250, 12, 4, 20, 0}, /* 26 MHz */ | 75 | {1250, 12, 4, 20, 0}, /* 26 MHz */ |
| 75 | {3125, 47, 4, 20, 92843}, /* 38.4 MHz */ | 76 | {3125, 47, 4, 20, 92843}, /* 38.4 MHz */ |
| 76 | {1000, 7, 4, 10, 0}, /* 20 MHz */ | ||
| 77 | 77 | ||
| 78 | }; | 78 | }; |
| 79 | 79 | ||
diff --git a/drivers/usb/phy/phy-samsung-usb2.c b/drivers/usb/phy/phy-samsung-usb2.c index 1011c16ade7e..758b86d0fcb3 100644 --- a/drivers/usb/phy/phy-samsung-usb2.c +++ b/drivers/usb/phy/phy-samsung-usb2.c | |||
| @@ -388,7 +388,7 @@ static int samsung_usb2phy_probe(struct platform_device *pdev) | |||
| 388 | clk = devm_clk_get(dev, "otg"); | 388 | clk = devm_clk_get(dev, "otg"); |
| 389 | 389 | ||
| 390 | if (IS_ERR(clk)) { | 390 | if (IS_ERR(clk)) { |
| 391 | dev_err(dev, "Failed to get otg clock\n"); | 391 | dev_err(dev, "Failed to get usbhost/otg clock\n"); |
| 392 | return PTR_ERR(clk); | 392 | return PTR_ERR(clk); |
| 393 | } | 393 | } |
| 394 | 394 | ||
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index ed4949faa70d..805940c37353 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
| @@ -855,10 +855,6 @@ static int usbhsg_gadget_stop(struct usb_gadget *gadget, | |||
| 855 | struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); | 855 | struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); |
| 856 | struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); | 856 | struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); |
| 857 | 857 | ||
| 858 | if (!driver || | ||
| 859 | !driver->unbind) | ||
| 860 | return -EINVAL; | ||
| 861 | |||
| 862 | usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD); | 858 | usbhsg_try_stop(priv, USBHSG_STATUS_REGISTERD); |
| 863 | gpriv->driver = NULL; | 859 | gpriv->driver = NULL; |
| 864 | 860 | ||
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index 8c3a42ea910c..7eef9b33fde6 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
| @@ -719,6 +719,13 @@ config USB_SERIAL_FLASHLOADER | |||
| 719 | To compile this driver as a module, choose M here: the | 719 | To compile this driver as a module, choose M here: the |
| 720 | module will be called flashloader. | 720 | module will be called flashloader. |
| 721 | 721 | ||
| 722 | config USB_SERIAL_SUUNTO | ||
| 723 | tristate "USB Suunto ANT+ driver" | ||
| 724 | help | ||
| 725 | Say Y here if you want to use the Suunto ANT+ USB device. | ||
| 726 | |||
| 727 | To compile this driver as a module, choose M here: the | ||
| 728 | module will be called suunto. | ||
| 722 | 729 | ||
| 723 | config USB_SERIAL_DEBUG | 730 | config USB_SERIAL_DEBUG |
| 724 | tristate "USB Debugging Device" | 731 | tristate "USB Debugging Device" |
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index f7130114488f..a14a870d993f 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile | |||
| @@ -54,6 +54,7 @@ obj-$(CONFIG_USB_SERIAL_SIEMENS_MPI) += siemens_mpi.o | |||
| 54 | obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o | 54 | obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o |
| 55 | obj-$(CONFIG_USB_SERIAL_SPCP8X5) += spcp8x5.o | 55 | obj-$(CONFIG_USB_SERIAL_SPCP8X5) += spcp8x5.o |
| 56 | obj-$(CONFIG_USB_SERIAL_SSU100) += ssu100.o | 56 | obj-$(CONFIG_USB_SERIAL_SSU100) += ssu100.o |
| 57 | obj-$(CONFIG_USB_SERIAL_SUUNTO) += suunto.o | ||
| 57 | obj-$(CONFIG_USB_SERIAL_SYMBOL) += symbolserial.o | 58 | obj-$(CONFIG_USB_SERIAL_SYMBOL) += symbolserial.o |
| 58 | obj-$(CONFIG_USB_SERIAL_WWAN) += usb_wwan.o | 59 | obj-$(CONFIG_USB_SERIAL_WWAN) += usb_wwan.o |
| 59 | obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o | 60 | obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index d6ef2f8da37d..0eae4ba3760e 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -53,6 +53,7 @@ static const struct usb_device_id id_table[] = { | |||
| 53 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | 53 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ |
| 54 | { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | 54 | { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ |
| 55 | { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */ | 55 | { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */ |
| 56 | { USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */ | ||
| 56 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ | 57 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ |
| 57 | { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ | 58 | { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ |
| 58 | { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */ | 59 | { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */ |
| @@ -118,6 +119,8 @@ static const struct usb_device_id id_table[] = { | |||
| 118 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ | 119 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ |
| 119 | { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ | 120 | { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ |
| 120 | { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ | 121 | { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ |
| 122 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ | ||
| 123 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ | ||
| 121 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 124 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| 122 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ | 125 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
| 123 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ | 126 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ |
| @@ -148,6 +151,7 @@ static const struct usb_device_id id_table[] = { | |||
| 148 | { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ | 151 | { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ |
| 149 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 152 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
| 150 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 153 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
| 154 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ | ||
| 151 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ | 155 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ |
| 152 | { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ | 156 | { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ |
| 153 | { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ | 157 | { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 7260ec660347..b65e657c641d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -735,9 +735,34 @@ static struct usb_device_id id_table_combined [] = { | |||
| 735 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), | 735 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), |
| 736 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, | 736 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, |
| 737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
| 738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | 738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, |
| 739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, | 739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, |
| 740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, | 740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) }, |
| 741 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57B_PID) }, | ||
| 742 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29A_PID) }, | ||
| 743 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29B_PID) }, | ||
| 744 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29F_PID) }, | ||
| 745 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62B_PID) }, | ||
| 746 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S01_PID) }, | ||
| 747 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63_PID) }, | ||
| 748 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_29C_PID) }, | ||
| 749 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_81B_PID) }, | ||
| 750 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_82B_PID) }, | ||
| 751 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5D_PID) }, | ||
| 752 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K4Y_PID) }, | ||
| 753 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_K5G_PID) }, | ||
| 754 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S05_PID) }, | ||
| 755 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_60_PID) }, | ||
| 756 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_61_PID) }, | ||
| 757 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_62_PID) }, | ||
| 758 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_63B_PID) }, | ||
| 759 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_64_PID) }, | ||
| 760 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_65_PID) }, | ||
| 761 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92_PID) }, | ||
| 762 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_92D_PID) }, | ||
| 763 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_W5R_PID) }, | ||
| 764 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_A5R_PID) }, | ||
| 765 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_PW1_PID) }, | ||
| 741 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 766 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
| 742 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 767 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
| 743 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 768 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 6dd79253205d..1b8af461b522 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -815,11 +815,35 @@ | |||
| 815 | /* | 815 | /* |
| 816 | * RT Systems programming cables for various ham radios | 816 | * RT Systems programming cables for various ham radios |
| 817 | */ | 817 | */ |
| 818 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 818 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
| 819 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | 819 | #define RTSYSTEMS_USB_S03_PID 0x9001 /* RTS-03 USB to Serial Adapter */ |
| 820 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ | 820 | #define RTSYSTEMS_USB_59_PID 0x9e50 /* USB-59 USB to 8 pin plug */ |
| 821 | #define RTSYSTEMS_RTS01_PID 0x9e57 /* USB-RTS01 Radio Cable */ | 821 | #define RTSYSTEMS_USB_57A_PID 0x9e51 /* USB-57A USB to 4pin 3.5mm plug */ |
| 822 | 822 | #define RTSYSTEMS_USB_57B_PID 0x9e52 /* USB-57B USB to extended 4pin 3.5mm plug */ | |
| 823 | #define RTSYSTEMS_USB_29A_PID 0x9e53 /* USB-29A USB to 3.5mm stereo plug */ | ||
| 824 | #define RTSYSTEMS_USB_29B_PID 0x9e54 /* USB-29B USB to 6 pin mini din */ | ||
| 825 | #define RTSYSTEMS_USB_29F_PID 0x9e55 /* USB-29F USB to 6 pin modular plug */ | ||
| 826 | #define RTSYSTEMS_USB_62B_PID 0x9e56 /* USB-62B USB to 8 pin mini din plug*/ | ||
| 827 | #define RTSYSTEMS_USB_S01_PID 0x9e57 /* USB-RTS01 USB to 3.5 mm stereo plug*/ | ||
| 828 | #define RTSYSTEMS_USB_63_PID 0x9e58 /* USB-63 USB to 9 pin female*/ | ||
| 829 | #define RTSYSTEMS_USB_29C_PID 0x9e59 /* USB-29C USB to 4 pin modular plug*/ | ||
| 830 | #define RTSYSTEMS_USB_81B_PID 0x9e5A /* USB-81 USB to 8 pin mini din plug*/ | ||
| 831 | #define RTSYSTEMS_USB_82B_PID 0x9e5B /* USB-82 USB to 2.5 mm stereo plug*/ | ||
| 832 | #define RTSYSTEMS_USB_K5D_PID 0x9e5C /* USB-K5D USB to 8 pin modular plug*/ | ||
| 833 | #define RTSYSTEMS_USB_K4Y_PID 0x9e5D /* USB-K4Y USB to 2.5/3.5 mm plugs*/ | ||
| 834 | #define RTSYSTEMS_USB_K5G_PID 0x9e5E /* USB-K5G USB to 8 pin modular plug*/ | ||
| 835 | #define RTSYSTEMS_USB_S05_PID 0x9e5F /* USB-RTS05 USB to 2.5 mm stereo plug*/ | ||
| 836 | #define RTSYSTEMS_USB_60_PID 0x9e60 /* USB-60 USB to 6 pin din*/ | ||
| 837 | #define RTSYSTEMS_USB_61_PID 0x9e61 /* USB-61 USB to 6 pin mini din*/ | ||
| 838 | #define RTSYSTEMS_USB_62_PID 0x9e62 /* USB-62 USB to 8 pin mini din*/ | ||
| 839 | #define RTSYSTEMS_USB_63B_PID 0x9e63 /* USB-63 USB to 9 pin female*/ | ||
| 840 | #define RTSYSTEMS_USB_64_PID 0x9e64 /* USB-64 USB to 9 pin male*/ | ||
| 841 | #define RTSYSTEMS_USB_65_PID 0x9e65 /* USB-65 USB to 9 pin female null modem*/ | ||
| 842 | #define RTSYSTEMS_USB_92_PID 0x9e66 /* USB-92 USB to 12 pin plug*/ | ||
| 843 | #define RTSYSTEMS_USB_92D_PID 0x9e67 /* USB-92D USB to 12 pin plug data*/ | ||
| 844 | #define RTSYSTEMS_USB_W5R_PID 0x9e68 /* USB-W5R USB to 8 pin modular plug*/ | ||
| 845 | #define RTSYSTEMS_USB_A5R_PID 0x9e69 /* USB-A5R USB to 8 pin modular plug*/ | ||
| 846 | #define RTSYSTEMS_USB_PW1_PID 0x9e6A /* USB-PW1 USB to 8 pin modular plug*/ | ||
| 823 | 847 | ||
| 824 | /* | 848 | /* |
| 825 | * Physik Instrumente | 849 | * Physik Instrumente |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 0a818b238508..d953d674f222 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
| @@ -183,7 +183,10 @@ | |||
| 183 | #define LED_ON_MS 500 | 183 | #define LED_ON_MS 500 |
| 184 | #define LED_OFF_MS 500 | 184 | #define LED_OFF_MS 500 |
| 185 | 185 | ||
| 186 | static int device_type; | 186 | enum mos7840_flag { |
| 187 | MOS7840_FLAG_CTRL_BUSY, | ||
| 188 | MOS7840_FLAG_LED_BUSY, | ||
| 189 | }; | ||
| 187 | 190 | ||
| 188 | static const struct usb_device_id id_table[] = { | 191 | static const struct usb_device_id id_table[] = { |
| 189 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 192 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
| @@ -238,9 +241,12 @@ struct moschip_port { | |||
| 238 | 241 | ||
| 239 | /* For device(s) with LED indicator */ | 242 | /* For device(s) with LED indicator */ |
| 240 | bool has_led; | 243 | bool has_led; |
| 241 | bool led_flag; | ||
| 242 | struct timer_list led_timer1; /* Timer for LED on */ | 244 | struct timer_list led_timer1; /* Timer for LED on */ |
| 243 | struct timer_list led_timer2; /* Timer for LED off */ | 245 | struct timer_list led_timer2; /* Timer for LED off */ |
| 246 | struct urb *led_urb; | ||
| 247 | struct usb_ctrlrequest *led_dr; | ||
| 248 | |||
| 249 | unsigned long flags; | ||
| 244 | }; | 250 | }; |
| 245 | 251 | ||
| 246 | /* | 252 | /* |
| @@ -460,10 +466,10 @@ static void mos7840_control_callback(struct urb *urb) | |||
| 460 | case -ESHUTDOWN: | 466 | case -ESHUTDOWN: |
| 461 | /* this urb is terminated, clean up */ | 467 | /* this urb is terminated, clean up */ |
| 462 | dev_dbg(dev, "%s - urb shutting down with status: %d\n", __func__, status); | 468 | dev_dbg(dev, "%s - urb shutting down with status: %d\n", __func__, status); |
| 463 | return; | 469 | goto out; |
| 464 | default: | 470 | default: |
| 465 | dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status); | 471 | dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status); |
| 466 | return; | 472 | goto out; |
| 467 | } | 473 | } |
| 468 | 474 | ||
| 469 | dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); | 475 | dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); |
| @@ -476,6 +482,8 @@ static void mos7840_control_callback(struct urb *urb) | |||
| 476 | mos7840_handle_new_msr(mos7840_port, regval); | 482 | mos7840_handle_new_msr(mos7840_port, regval); |
| 477 | else if (mos7840_port->MsrLsr == 1) | 483 | else if (mos7840_port->MsrLsr == 1) |
| 478 | mos7840_handle_new_lsr(mos7840_port, regval); | 484 | mos7840_handle_new_lsr(mos7840_port, regval); |
| 485 | out: | ||
| 486 | clear_bit_unlock(MOS7840_FLAG_CTRL_BUSY, &mos7840_port->flags); | ||
| 479 | } | 487 | } |
| 480 | 488 | ||
| 481 | static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, | 489 | static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, |
| @@ -486,6 +494,9 @@ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, | |||
| 486 | unsigned char *buffer = mcs->ctrl_buf; | 494 | unsigned char *buffer = mcs->ctrl_buf; |
| 487 | int ret; | 495 | int ret; |
| 488 | 496 | ||
| 497 | if (test_and_set_bit_lock(MOS7840_FLAG_CTRL_BUSY, &mcs->flags)) | ||
| 498 | return -EBUSY; | ||
| 499 | |||
| 489 | dr->bRequestType = MCS_RD_RTYPE; | 500 | dr->bRequestType = MCS_RD_RTYPE; |
| 490 | dr->bRequest = MCS_RDREQ; | 501 | dr->bRequest = MCS_RDREQ; |
| 491 | dr->wValue = cpu_to_le16(Wval); /* 0 */ | 502 | dr->wValue = cpu_to_le16(Wval); /* 0 */ |
| @@ -497,6 +508,9 @@ static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, | |||
| 497 | mos7840_control_callback, mcs); | 508 | mos7840_control_callback, mcs); |
| 498 | mcs->control_urb->transfer_buffer_length = 2; | 509 | mcs->control_urb->transfer_buffer_length = 2; |
| 499 | ret = usb_submit_urb(mcs->control_urb, GFP_ATOMIC); | 510 | ret = usb_submit_urb(mcs->control_urb, GFP_ATOMIC); |
| 511 | if (ret) | ||
| 512 | clear_bit_unlock(MOS7840_FLAG_CTRL_BUSY, &mcs->flags); | ||
| 513 | |||
| 500 | return ret; | 514 | return ret; |
| 501 | } | 515 | } |
| 502 | 516 | ||
| @@ -523,7 +537,7 @@ static void mos7840_set_led_async(struct moschip_port *mcs, __u16 wval, | |||
| 523 | __u16 reg) | 537 | __u16 reg) |
| 524 | { | 538 | { |
| 525 | struct usb_device *dev = mcs->port->serial->dev; | 539 | struct usb_device *dev = mcs->port->serial->dev; |
| 526 | struct usb_ctrlrequest *dr = mcs->dr; | 540 | struct usb_ctrlrequest *dr = mcs->led_dr; |
| 527 | 541 | ||
| 528 | dr->bRequestType = MCS_WR_RTYPE; | 542 | dr->bRequestType = MCS_WR_RTYPE; |
| 529 | dr->bRequest = MCS_WRREQ; | 543 | dr->bRequest = MCS_WRREQ; |
| @@ -531,10 +545,10 @@ static void mos7840_set_led_async(struct moschip_port *mcs, __u16 wval, | |||
| 531 | dr->wIndex = cpu_to_le16(reg); | 545 | dr->wIndex = cpu_to_le16(reg); |
| 532 | dr->wLength = cpu_to_le16(0); | 546 | dr->wLength = cpu_to_le16(0); |
| 533 | 547 | ||
| 534 | usb_fill_control_urb(mcs->control_urb, dev, usb_sndctrlpipe(dev, 0), | 548 | usb_fill_control_urb(mcs->led_urb, dev, usb_sndctrlpipe(dev, 0), |
| 535 | (unsigned char *)dr, NULL, 0, mos7840_set_led_callback, NULL); | 549 | (unsigned char *)dr, NULL, 0, mos7840_set_led_callback, NULL); |
| 536 | 550 | ||
| 537 | usb_submit_urb(mcs->control_urb, GFP_ATOMIC); | 551 | usb_submit_urb(mcs->led_urb, GFP_ATOMIC); |
| 538 | } | 552 | } |
| 539 | 553 | ||
| 540 | static void mos7840_set_led_sync(struct usb_serial_port *port, __u16 reg, | 554 | static void mos7840_set_led_sync(struct usb_serial_port *port, __u16 reg, |
| @@ -560,7 +574,19 @@ static void mos7840_led_flag_off(unsigned long arg) | |||
| 560 | { | 574 | { |
| 561 | struct moschip_port *mcs = (struct moschip_port *) arg; | 575 | struct moschip_port *mcs = (struct moschip_port *) arg; |
| 562 | 576 | ||
| 563 | mcs->led_flag = false; | 577 | clear_bit_unlock(MOS7840_FLAG_LED_BUSY, &mcs->flags); |
| 578 | } | ||
| 579 | |||
| 580 | static void mos7840_led_activity(struct usb_serial_port *port) | ||
| 581 | { | ||
| 582 | struct moschip_port *mos7840_port = usb_get_serial_port_data(port); | ||
| 583 | |||
| 584 | if (test_and_set_bit_lock(MOS7840_FLAG_LED_BUSY, &mos7840_port->flags)) | ||
| 585 | return; | ||
| 586 | |||
| 587 | mos7840_set_led_async(mos7840_port, 0x0301, MODEM_CONTROL_REGISTER); | ||
| 588 | mod_timer(&mos7840_port->led_timer1, | ||
| 589 | jiffies + msecs_to_jiffies(LED_ON_MS)); | ||
| 564 | } | 590 | } |
| 565 | 591 | ||
| 566 | /***************************************************************************** | 592 | /***************************************************************************** |
| @@ -758,14 +784,8 @@ static void mos7840_bulk_in_callback(struct urb *urb) | |||
| 758 | return; | 784 | return; |
| 759 | } | 785 | } |
| 760 | 786 | ||
| 761 | /* Turn on LED */ | 787 | if (mos7840_port->has_led) |
| 762 | if (mos7840_port->has_led && !mos7840_port->led_flag) { | 788 | mos7840_led_activity(port); |
| 763 | mos7840_port->led_flag = true; | ||
| 764 | mos7840_set_led_async(mos7840_port, 0x0301, | ||
| 765 | MODEM_CONTROL_REGISTER); | ||
| 766 | mod_timer(&mos7840_port->led_timer1, | ||
| 767 | jiffies + msecs_to_jiffies(LED_ON_MS)); | ||
| 768 | } | ||
| 769 | 789 | ||
| 770 | mos7840_port->read_urb_busy = true; | 790 | mos7840_port->read_urb_busy = true; |
| 771 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); | 791 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); |
| @@ -816,18 +836,6 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) | |||
| 816 | /************************************************************************/ | 836 | /************************************************************************/ |
| 817 | /* D R I V E R T T Y I N T E R F A C E F U N C T I O N S */ | 837 | /* D R I V E R T T Y I N T E R F A C E F U N C T I O N S */ |
| 818 | /************************************************************************/ | 838 | /************************************************************************/ |
| 819 | #ifdef MCSSerialProbe | ||
| 820 | static int mos7840_serial_probe(struct usb_serial *serial, | ||
| 821 | const struct usb_device_id *id) | ||
| 822 | { | ||
| 823 | |||
| 824 | /*need to implement the mode_reg reading and updating\ | ||
| 825 | structures usb_serial_ device_type\ | ||
| 826 | (i.e num_ports, num_bulkin,bulkout etc) */ | ||
| 827 | /* Also we can update the changes attach */ | ||
| 828 | return 1; | ||
| 829 | } | ||
| 830 | #endif | ||
| 831 | 839 | ||
| 832 | /***************************************************************************** | 840 | /***************************************************************************** |
| 833 | * mos7840_open | 841 | * mos7840_open |
| @@ -905,20 +913,20 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
| 905 | status = mos7840_get_reg_sync(port, mos7840_port->SpRegOffset, &Data); | 913 | status = mos7840_get_reg_sync(port, mos7840_port->SpRegOffset, &Data); |
| 906 | if (status < 0) { | 914 | if (status < 0) { |
| 907 | dev_dbg(&port->dev, "Reading Spreg failed\n"); | 915 | dev_dbg(&port->dev, "Reading Spreg failed\n"); |
| 908 | return -1; | 916 | goto err; |
| 909 | } | 917 | } |
| 910 | Data |= 0x80; | 918 | Data |= 0x80; |
| 911 | status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data); | 919 | status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data); |
| 912 | if (status < 0) { | 920 | if (status < 0) { |
| 913 | dev_dbg(&port->dev, "writing Spreg failed\n"); | 921 | dev_dbg(&port->dev, "writing Spreg failed\n"); |
| 914 | return -1; | 922 | goto err; |
| 915 | } | 923 | } |
| 916 | 924 | ||
| 917 | Data &= ~0x80; | 925 | Data &= ~0x80; |
| 918 | status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data); | 926 | status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data); |
| 919 | if (status < 0) { | 927 | if (status < 0) { |
| 920 | dev_dbg(&port->dev, "writing Spreg failed\n"); | 928 | dev_dbg(&port->dev, "writing Spreg failed\n"); |
| 921 | return -1; | 929 | goto err; |
| 922 | } | 930 | } |
| 923 | /* End of block to be checked */ | 931 | /* End of block to be checked */ |
| 924 | 932 | ||
| @@ -927,7 +935,7 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
| 927 | &Data); | 935 | &Data); |
| 928 | if (status < 0) { | 936 | if (status < 0) { |
| 929 | dev_dbg(&port->dev, "Reading Controlreg failed\n"); | 937 | dev_dbg(&port->dev, "Reading Controlreg failed\n"); |
| 930 | return -1; | 938 | goto err; |
| 931 | } | 939 | } |
| 932 | Data |= 0x08; /* Driver done bit */ | 940 | Data |= 0x08; /* Driver done bit */ |
| 933 | Data |= 0x20; /* rx_disable */ | 941 | Data |= 0x20; /* rx_disable */ |
| @@ -935,7 +943,7 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
| 935 | mos7840_port->ControlRegOffset, Data); | 943 | mos7840_port->ControlRegOffset, Data); |
| 936 | if (status < 0) { | 944 | if (status < 0) { |
| 937 | dev_dbg(&port->dev, "writing Controlreg failed\n"); | 945 | dev_dbg(&port->dev, "writing Controlreg failed\n"); |
| 938 | return -1; | 946 | goto err; |
| 939 | } | 947 | } |
| 940 | /* do register settings here */ | 948 | /* do register settings here */ |
| 941 | /* Set all regs to the device default values. */ | 949 | /* Set all regs to the device default values. */ |
| @@ -946,21 +954,21 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
| 946 | status = mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); | 954 | status = mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); |
| 947 | if (status < 0) { | 955 | if (status < 0) { |
| 948 | dev_dbg(&port->dev, "disabling interrupts failed\n"); | 956 | dev_dbg(&port->dev, "disabling interrupts failed\n"); |
| 949 | return -1; | 957 | goto err; |
| 950 | } | 958 | } |
| 951 | /* Set FIFO_CONTROL_REGISTER to the default value */ | 959 | /* Set FIFO_CONTROL_REGISTER to the default value */ |
| 952 | Data = 0x00; | 960 | Data = 0x00; |
| 953 | status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); | 961 | status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); |
| 954 | if (status < 0) { | 962 | if (status < 0) { |
| 955 | dev_dbg(&port->dev, "Writing FIFO_CONTROL_REGISTER failed\n"); | 963 | dev_dbg(&port->dev, "Writing FIFO_CONTROL_REGISTER failed\n"); |
| 956 | return -1; | 964 | goto err; |
| 957 | } | 965 | } |
| 958 | 966 | ||
| 959 | Data = 0xcf; | 967 | Data = 0xcf; |
| 960 | status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); | 968 | status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); |
| 961 | if (status < 0) { | 969 | if (status < 0) { |
| 962 | dev_dbg(&port->dev, "Writing FIFO_CONTROL_REGISTER failed\n"); | 970 | dev_dbg(&port->dev, "Writing FIFO_CONTROL_REGISTER failed\n"); |
| 963 | return -1; | 971 | goto err; |
| 964 | } | 972 | } |
| 965 | 973 | ||
| 966 | Data = 0x03; | 974 | Data = 0x03; |
| @@ -1103,6 +1111,15 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
| 1103 | /* mos7840_change_port_settings(mos7840_port,old_termios); */ | 1111 | /* mos7840_change_port_settings(mos7840_port,old_termios); */ |
| 1104 | 1112 | ||
| 1105 | return 0; | 1113 | return 0; |
| 1114 | err: | ||
| 1115 | for (j = 0; j < NUM_URBS; ++j) { | ||
| 1116 | urb = mos7840_port->write_urb_pool[j]; | ||
| 1117 | if (!urb) | ||
| 1118 | continue; | ||
| 1119 | kfree(urb->transfer_buffer); | ||
| 1120 | usb_free_urb(urb); | ||
| 1121 | } | ||
| 1122 | return status; | ||
| 1106 | } | 1123 | } |
| 1107 | 1124 | ||
| 1108 | /***************************************************************************** | 1125 | /***************************************************************************** |
| @@ -1445,13 +1462,8 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
| 1445 | data1 = urb->transfer_buffer; | 1462 | data1 = urb->transfer_buffer; |
| 1446 | dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress); | 1463 | dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress); |
| 1447 | 1464 | ||
| 1448 | /* Turn on LED */ | 1465 | if (mos7840_port->has_led) |
| 1449 | if (mos7840_port->has_led && !mos7840_port->led_flag) { | 1466 | mos7840_led_activity(port); |
| 1450 | mos7840_port->led_flag = true; | ||
| 1451 | mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0301); | ||
| 1452 | mod_timer(&mos7840_port->led_timer1, | ||
| 1453 | jiffies + msecs_to_jiffies(LED_ON_MS)); | ||
| 1454 | } | ||
| 1455 | 1467 | ||
| 1456 | /* send it down the pipe */ | 1468 | /* send it down the pipe */ |
| 1457 | status = usb_submit_urb(urb, GFP_ATOMIC); | 1469 | status = usb_submit_urb(urb, GFP_ATOMIC); |
| @@ -2178,38 +2190,48 @@ static int mos7810_check(struct usb_serial *serial) | |||
| 2178 | return 0; | 2190 | return 0; |
| 2179 | } | 2191 | } |
| 2180 | 2192 | ||
| 2181 | static int mos7840_calc_num_ports(struct usb_serial *serial) | 2193 | static int mos7840_probe(struct usb_serial *serial, |
| 2194 | const struct usb_device_id *id) | ||
| 2182 | { | 2195 | { |
| 2183 | __u16 data = 0x00; | 2196 | u16 product = serial->dev->descriptor.idProduct; |
| 2184 | u8 *buf; | 2197 | u8 *buf; |
| 2185 | int mos7840_num_ports; | 2198 | int device_type; |
| 2199 | |||
| 2200 | if (product == MOSCHIP_DEVICE_ID_7810 || | ||
| 2201 | product == MOSCHIP_DEVICE_ID_7820) { | ||
| 2202 | device_type = product; | ||
| 2203 | goto out; | ||
| 2204 | } | ||
| 2186 | 2205 | ||
| 2187 | buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); | 2206 | buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); |
| 2188 | if (buf) { | 2207 | if (!buf) |
| 2189 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2208 | return -ENOMEM; |
| 2209 | |||
| 2210 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | ||
| 2190 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, | 2211 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, |
| 2191 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2212 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); |
| 2192 | data = *buf; | ||
| 2193 | kfree(buf); | ||
| 2194 | } | ||
| 2195 | 2213 | ||
| 2196 | if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || | 2214 | /* For a MCS7840 device GPIO0 must be set to 1 */ |
| 2197 | serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) { | 2215 | if (buf[0] & 0x01) |
| 2198 | device_type = serial->dev->descriptor.idProduct; | 2216 | device_type = MOSCHIP_DEVICE_ID_7840; |
| 2199 | } else { | 2217 | else if (mos7810_check(serial)) |
| 2200 | /* For a MCS7840 device GPIO0 must be set to 1 */ | 2218 | device_type = MOSCHIP_DEVICE_ID_7810; |
| 2201 | if ((data & 0x01) == 1) | 2219 | else |
| 2202 | device_type = MOSCHIP_DEVICE_ID_7840; | 2220 | device_type = MOSCHIP_DEVICE_ID_7820; |
| 2203 | else if (mos7810_check(serial)) | 2221 | |
| 2204 | device_type = MOSCHIP_DEVICE_ID_7810; | 2222 | kfree(buf); |
| 2205 | else | 2223 | out: |
| 2206 | device_type = MOSCHIP_DEVICE_ID_7820; | 2224 | usb_set_serial_data(serial, (void *)(unsigned long)device_type); |
| 2207 | } | 2225 | |
| 2226 | return 0; | ||
| 2227 | } | ||
| 2228 | |||
| 2229 | static int mos7840_calc_num_ports(struct usb_serial *serial) | ||
| 2230 | { | ||
| 2231 | int device_type = (unsigned long)usb_get_serial_data(serial); | ||
| 2232 | int mos7840_num_ports; | ||
| 2208 | 2233 | ||
| 2209 | mos7840_num_ports = (device_type >> 4) & 0x000F; | 2234 | mos7840_num_ports = (device_type >> 4) & 0x000F; |
| 2210 | serial->num_bulk_in = mos7840_num_ports; | ||
| 2211 | serial->num_bulk_out = mos7840_num_ports; | ||
| 2212 | serial->num_ports = mos7840_num_ports; | ||
| 2213 | 2235 | ||
| 2214 | return mos7840_num_ports; | 2236 | return mos7840_num_ports; |
| 2215 | } | 2237 | } |
| @@ -2217,6 +2239,7 @@ static int mos7840_calc_num_ports(struct usb_serial *serial) | |||
| 2217 | static int mos7840_port_probe(struct usb_serial_port *port) | 2239 | static int mos7840_port_probe(struct usb_serial_port *port) |
| 2218 | { | 2240 | { |
| 2219 | struct usb_serial *serial = port->serial; | 2241 | struct usb_serial *serial = port->serial; |
| 2242 | int device_type = (unsigned long)usb_get_serial_data(serial); | ||
| 2220 | struct moschip_port *mos7840_port; | 2243 | struct moschip_port *mos7840_port; |
| 2221 | int status; | 2244 | int status; |
| 2222 | int pnum; | 2245 | int pnum; |
| @@ -2392,6 +2415,14 @@ static int mos7840_port_probe(struct usb_serial_port *port) | |||
| 2392 | if (device_type == MOSCHIP_DEVICE_ID_7810) { | 2415 | if (device_type == MOSCHIP_DEVICE_ID_7810) { |
| 2393 | mos7840_port->has_led = true; | 2416 | mos7840_port->has_led = true; |
| 2394 | 2417 | ||
| 2418 | mos7840_port->led_urb = usb_alloc_urb(0, GFP_KERNEL); | ||
| 2419 | mos7840_port->led_dr = kmalloc(sizeof(*mos7840_port->led_dr), | ||
| 2420 | GFP_KERNEL); | ||
| 2421 | if (!mos7840_port->led_urb || !mos7840_port->led_dr) { | ||
| 2422 | status = -ENOMEM; | ||
| 2423 | goto error; | ||
| 2424 | } | ||
| 2425 | |||
| 2395 | init_timer(&mos7840_port->led_timer1); | 2426 | init_timer(&mos7840_port->led_timer1); |
| 2396 | mos7840_port->led_timer1.function = mos7840_led_off; | 2427 | mos7840_port->led_timer1.function = mos7840_led_off; |
| 2397 | mos7840_port->led_timer1.expires = | 2428 | mos7840_port->led_timer1.expires = |
| @@ -2404,8 +2435,6 @@ static int mos7840_port_probe(struct usb_serial_port *port) | |||
| 2404 | jiffies + msecs_to_jiffies(LED_OFF_MS); | 2435 | jiffies + msecs_to_jiffies(LED_OFF_MS); |
| 2405 | mos7840_port->led_timer2.data = (unsigned long)mos7840_port; | 2436 | mos7840_port->led_timer2.data = (unsigned long)mos7840_port; |
| 2406 | 2437 | ||
| 2407 | mos7840_port->led_flag = false; | ||
| 2408 | |||
| 2409 | /* Turn off LED */ | 2438 | /* Turn off LED */ |
| 2410 | mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300); | 2439 | mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300); |
| 2411 | } | 2440 | } |
| @@ -2427,6 +2456,8 @@ out: | |||
| 2427 | } | 2456 | } |
| 2428 | return 0; | 2457 | return 0; |
| 2429 | error: | 2458 | error: |
| 2459 | kfree(mos7840_port->led_dr); | ||
| 2460 | usb_free_urb(mos7840_port->led_urb); | ||
| 2430 | kfree(mos7840_port->dr); | 2461 | kfree(mos7840_port->dr); |
| 2431 | kfree(mos7840_port->ctrl_buf); | 2462 | kfree(mos7840_port->ctrl_buf); |
| 2432 | usb_free_urb(mos7840_port->control_urb); | 2463 | usb_free_urb(mos7840_port->control_urb); |
| @@ -2447,6 +2478,10 @@ static int mos7840_port_remove(struct usb_serial_port *port) | |||
| 2447 | 2478 | ||
| 2448 | del_timer_sync(&mos7840_port->led_timer1); | 2479 | del_timer_sync(&mos7840_port->led_timer1); |
| 2449 | del_timer_sync(&mos7840_port->led_timer2); | 2480 | del_timer_sync(&mos7840_port->led_timer2); |
| 2481 | |||
| 2482 | usb_kill_urb(mos7840_port->led_urb); | ||
| 2483 | usb_free_urb(mos7840_port->led_urb); | ||
| 2484 | kfree(mos7840_port->led_dr); | ||
| 2450 | } | 2485 | } |
| 2451 | usb_kill_urb(mos7840_port->control_urb); | 2486 | usb_kill_urb(mos7840_port->control_urb); |
| 2452 | usb_free_urb(mos7840_port->control_urb); | 2487 | usb_free_urb(mos7840_port->control_urb); |
| @@ -2473,9 +2508,7 @@ static struct usb_serial_driver moschip7840_4port_device = { | |||
| 2473 | .throttle = mos7840_throttle, | 2508 | .throttle = mos7840_throttle, |
| 2474 | .unthrottle = mos7840_unthrottle, | 2509 | .unthrottle = mos7840_unthrottle, |
| 2475 | .calc_num_ports = mos7840_calc_num_ports, | 2510 | .calc_num_ports = mos7840_calc_num_ports, |
| 2476 | #ifdef MCSSerialProbe | 2511 | .probe = mos7840_probe, |
| 2477 | .probe = mos7840_serial_probe, | ||
| 2478 | #endif | ||
| 2479 | .ioctl = mos7840_ioctl, | 2512 | .ioctl = mos7840_ioctl, |
| 2480 | .set_termios = mos7840_set_termios, | 2513 | .set_termios = mos7840_set_termios, |
| 2481 | .break_ctl = mos7840_break, | 2514 | .break_ctl = mos7840_break, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5dd857de05b0..1cf6f125f5f0 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -341,17 +341,12 @@ static void option_instat_callback(struct urb *urb); | |||
| 341 | #define OLIVETTI_VENDOR_ID 0x0b3c | 341 | #define OLIVETTI_VENDOR_ID 0x0b3c |
| 342 | #define OLIVETTI_PRODUCT_OLICARD100 0xc000 | 342 | #define OLIVETTI_PRODUCT_OLICARD100 0xc000 |
| 343 | #define OLIVETTI_PRODUCT_OLICARD145 0xc003 | 343 | #define OLIVETTI_PRODUCT_OLICARD145 0xc003 |
| 344 | #define OLIVETTI_PRODUCT_OLICARD200 0xc005 | ||
| 344 | 345 | ||
| 345 | /* Celot products */ | 346 | /* Celot products */ |
| 346 | #define CELOT_VENDOR_ID 0x211f | 347 | #define CELOT_VENDOR_ID 0x211f |
| 347 | #define CELOT_PRODUCT_CT680M 0x6801 | 348 | #define CELOT_PRODUCT_CT680M 0x6801 |
| 348 | 349 | ||
| 349 | /* ONDA Communication vendor id */ | ||
| 350 | #define ONDA_VENDOR_ID 0x1ee8 | ||
| 351 | |||
| 352 | /* ONDA MT825UP HSDPA 14.2 modem */ | ||
| 353 | #define ONDA_MT825UP 0x000b | ||
| 354 | |||
| 355 | /* Samsung products */ | 350 | /* Samsung products */ |
| 356 | #define SAMSUNG_VENDOR_ID 0x04e8 | 351 | #define SAMSUNG_VENDOR_ID 0x04e8 |
| 357 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 | 352 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 |
| @@ -444,7 +439,8 @@ static void option_instat_callback(struct urb *urb); | |||
| 444 | 439 | ||
| 445 | /* Hyundai Petatel Inc. products */ | 440 | /* Hyundai Petatel Inc. products */ |
| 446 | #define PETATEL_VENDOR_ID 0x1ff4 | 441 | #define PETATEL_VENDOR_ID 0x1ff4 |
| 447 | #define PETATEL_PRODUCT_NP10T 0x600e | 442 | #define PETATEL_PRODUCT_NP10T_600A 0x600a |
| 443 | #define PETATEL_PRODUCT_NP10T_600E 0x600e | ||
| 448 | 444 | ||
| 449 | /* TP-LINK Incorporated products */ | 445 | /* TP-LINK Incorporated products */ |
| 450 | #define TPLINK_VENDOR_ID 0x2357 | 446 | #define TPLINK_VENDOR_ID 0x2357 |
| @@ -782,6 +778,7 @@ static const struct usb_device_id option_ids[] = { | |||
| 782 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, | 778 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, |
| 783 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 779 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
| 784 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 780 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
| 781 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ | ||
| 785 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | 782 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
| 786 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 783 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
| 787 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, | 784 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, |
| @@ -817,7 +814,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 817 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff), | 814 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff), |
| 818 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | 815 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, |
| 819 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) }, | 816 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) }, |
| 820 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) }, | 817 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff), |
| 818 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | ||
| 821 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) }, | 819 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) }, |
| 822 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff), | 820 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff), |
| 823 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 821 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| @@ -1256,8 +1254,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1256 | 1254 | ||
| 1257 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, | 1255 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, |
| 1258 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, | 1256 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, |
| 1257 | { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) }, | ||
| 1259 | { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ | 1258 | { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ |
| 1260 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */ | ||
| 1261 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ | 1259 | { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ |
| 1262 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, | 1260 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, |
| 1263 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM610) }, | 1261 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM610) }, |
| @@ -1329,9 +1327,12 @@ static const struct usb_device_id option_ids[] = { | |||
| 1329 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) }, | 1327 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) }, |
| 1330 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, | 1328 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, |
| 1331 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, | 1329 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, |
| 1332 | { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, | 1330 | { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) }, |
| 1331 | { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) }, | ||
| 1333 | { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), | 1332 | { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), |
| 1334 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 1333 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 1334 | { USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */ | ||
| 1335 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
| 1335 | { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, | 1336 | { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, |
| 1336 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x02, 0x01) }, /* D-Link DWM-156 (variant) */ | 1337 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x02, 0x01) }, /* D-Link DWM-156 (variant) */ |
| 1337 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x00, 0x00) }, /* D-Link DWM-156 (variant) */ | 1338 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x00, 0x00) }, /* D-Link DWM-156 (variant) */ |
| @@ -1339,6 +1340,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1339 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, | 1340 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, |
| 1340 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, | 1341 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, |
| 1341 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, | 1342 | { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, |
| 1343 | { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ | ||
| 1344 | { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ | ||
| 1342 | { } /* Terminating entry */ | 1345 | { } /* Terminating entry */ |
| 1343 | }; | 1346 | }; |
| 1344 | MODULE_DEVICE_TABLE(usb, option_ids); | 1347 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/serial/suunto.c b/drivers/usb/serial/suunto.c new file mode 100644 index 000000000000..2248e7a7d5ad --- /dev/null +++ b/drivers/usb/serial/suunto.c | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* | ||
| 2 | * Suunto ANT+ USB Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
| 5 | * Copyright (C) 2013 Linux Foundation | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License version 2 as published by | ||
| 9 | * the Free Software Foundation only. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/init.h> | ||
| 14 | #include <linux/tty.h> | ||
| 15 | #include <linux/module.h> | ||
| 16 | #include <linux/usb.h> | ||
| 17 | #include <linux/usb/serial.h> | ||
| 18 | #include <linux/uaccess.h> | ||
| 19 | |||
| 20 | static const struct usb_device_id id_table[] = { | ||
| 21 | { USB_DEVICE(0x0fcf, 0x1008) }, | ||
| 22 | { }, | ||
| 23 | }; | ||
| 24 | MODULE_DEVICE_TABLE(usb, id_table); | ||
| 25 | |||
| 26 | static struct usb_serial_driver suunto_device = { | ||
| 27 | .driver = { | ||
| 28 | .owner = THIS_MODULE, | ||
| 29 | .name = KBUILD_MODNAME, | ||
| 30 | }, | ||
| 31 | .id_table = id_table, | ||
| 32 | .num_ports = 1, | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct usb_serial_driver * const serial_drivers[] = { | ||
| 36 | &suunto_device, | ||
| 37 | NULL, | ||
| 38 | }; | ||
| 39 | |||
| 40 | module_usb_serial_driver(serial_drivers, id_table); | ||
| 41 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 7182bb774b79..375b5a400b6f 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
| @@ -371,7 +371,7 @@ static int ti_startup(struct usb_serial *serial) | |||
| 371 | usb_set_serial_data(serial, tdev); | 371 | usb_set_serial_data(serial, tdev); |
| 372 | 372 | ||
| 373 | /* determine device type */ | 373 | /* determine device type */ |
| 374 | if (usb_match_id(serial->interface, ti_id_table_3410)) | 374 | if (serial->type == &ti_1port_device) |
| 375 | tdev->td_is_3410 = 1; | 375 | tdev->td_is_3410 = 1; |
| 376 | dev_dbg(&dev->dev, "%s - device type is %s\n", __func__, | 376 | dev_dbg(&dev->dev, "%s - device type is %s\n", __func__, |
| 377 | tdev->td_is_3410 ? "3410" : "5052"); | 377 | tdev->td_is_3410 ? "3410" : "5052"); |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 1799335288bd..c015f2c16729 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
| @@ -665,6 +665,13 @@ UNUSUAL_DEV( 0x054c, 0x016a, 0x0000, 0x9999, | |||
| 665 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 665 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 666 | US_FL_FIX_INQUIRY ), | 666 | US_FL_FIX_INQUIRY ), |
| 667 | 667 | ||
| 668 | /* Submitted by Ren Bigcren <bigcren.ren@sonymobile.com> */ | ||
| 669 | UNUSUAL_DEV( 0x054c, 0x02a5, 0x0100, 0x0100, | ||
| 670 | "Sony Corp.", | ||
| 671 | "MicroVault Flash Drive", | ||
| 672 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
| 673 | US_FL_NO_READ_CAPACITY_16 ), | ||
| 674 | |||
| 668 | /* floppy reports multiple luns */ | 675 | /* floppy reports multiple luns */ |
| 669 | UNUSUAL_DEV( 0x055d, 0x2020, 0x0000, 0x0210, | 676 | UNUSUAL_DEV( 0x055d, 0x2020, 0x0000, 0x0210, |
| 670 | "SAMSUNG", | 677 | "SAMSUNG", |
