diff options
Diffstat (limited to 'drivers/usb/gadget/fsl_usb2_udc.c')
-rw-r--r-- | drivers/usb/gadget/fsl_usb2_udc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c index d57bcfbc08a..9bb7f64a85c 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.c +++ b/drivers/usb/gadget/fsl_usb2_udc.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/moduleparam.h> | 35 | #include <linux/moduleparam.h> |
36 | #include <linux/device.h> | 36 | #include <linux/device.h> |
37 | #include <linux/usb/ch9.h> | 37 | #include <linux/usb/ch9.h> |
38 | #include <linux/usb_gadget.h> | 38 | #include <linux/usb/gadget.h> |
39 | #include <linux/usb/otg.h> | 39 | #include <linux/usb/otg.h> |
40 | #include <linux/dma-mapping.h> | 40 | #include <linux/dma-mapping.h> |
41 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
@@ -1090,14 +1090,11 @@ static int fsl_vbus_session(struct usb_gadget *gadget, int is_active) | |||
1090 | */ | 1090 | */ |
1091 | static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA) | 1091 | static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA) |
1092 | { | 1092 | { |
1093 | #ifdef CONFIG_USB_OTG | ||
1094 | struct fsl_udc *udc; | 1093 | struct fsl_udc *udc; |
1095 | 1094 | ||
1096 | udc = container_of(gadget, struct fsl_udc, gadget); | 1095 | udc = container_of(gadget, struct fsl_udc, gadget); |
1097 | |||
1098 | if (udc->transceiver) | 1096 | if (udc->transceiver) |
1099 | return otg_set_power(udc->transceiver, mA); | 1097 | return otg_set_power(udc->transceiver, mA); |
1100 | #endif | ||
1101 | return -ENOTSUPP; | 1098 | return -ENOTSUPP; |
1102 | } | 1099 | } |
1103 | 1100 | ||
@@ -1120,7 +1117,7 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on) | |||
1120 | return 0; | 1117 | return 0; |
1121 | } | 1118 | } |
1122 | 1119 | ||
1123 | /* defined in usb_gadget.h */ | 1120 | /* defined in gadget.h */ |
1124 | static struct usb_gadget_ops fsl_gadget_ops = { | 1121 | static struct usb_gadget_ops fsl_gadget_ops = { |
1125 | .get_frame = fsl_get_frame, | 1122 | .get_frame = fsl_get_frame, |
1126 | .wakeup = fsl_wakeup, | 1123 | .wakeup = fsl_wakeup, |
@@ -1321,7 +1318,7 @@ static void setup_received_irq(struct fsl_udc *udc, | |||
1321 | | USB_TYPE_STANDARD)) { | 1318 | | USB_TYPE_STANDARD)) { |
1322 | /* Note: The driver has not include OTG support yet. | 1319 | /* Note: The driver has not include OTG support yet. |
1323 | * This will be set when OTG support is added */ | 1320 | * This will be set when OTG support is added */ |
1324 | if (!udc->gadget.is_otg) | 1321 | if (!gadget_is_otg(udc->gadget)) |
1325 | break; | 1322 | break; |
1326 | else if (setup->bRequest == USB_DEVICE_B_HNP_ENABLE) | 1323 | else if (setup->bRequest == USB_DEVICE_B_HNP_ENABLE) |
1327 | udc->gadget.b_hnp_enable = 1; | 1324 | udc->gadget.b_hnp_enable = 1; |
@@ -1330,6 +1327,8 @@ static void setup_received_irq(struct fsl_udc *udc, | |||
1330 | else if (setup->bRequest == | 1327 | else if (setup->bRequest == |
1331 | USB_DEVICE_A_ALT_HNP_SUPPORT) | 1328 | USB_DEVICE_A_ALT_HNP_SUPPORT) |
1332 | udc->gadget.a_alt_hnp_support = 1; | 1329 | udc->gadget.a_alt_hnp_support = 1; |
1330 | else | ||
1331 | break; | ||
1333 | rc = 0; | 1332 | rc = 0; |
1334 | } else | 1333 | } else |
1335 | break; | 1334 | break; |
@@ -1840,10 +1839,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1840 | if (!driver || driver != udc_controller->driver || !driver->unbind) | 1839 | if (!driver || driver != udc_controller->driver || !driver->unbind) |
1841 | return -EINVAL; | 1840 | return -EINVAL; |
1842 | 1841 | ||
1843 | #ifdef CONFIG_USB_OTG | ||
1844 | if (udc_controller->transceiver) | 1842 | if (udc_controller->transceiver) |
1845 | (void)otg_set_peripheral(udc_controller->transceiver, 0); | 1843 | (void)otg_set_peripheral(udc_controller->transceiver, 0); |
1846 | #endif | ||
1847 | 1844 | ||
1848 | /* stop DR, disable intr */ | 1845 | /* stop DR, disable intr */ |
1849 | dr_controller_stop(udc_controller); | 1846 | dr_controller_stop(udc_controller); |