diff options
Diffstat (limited to 'drivers/usb/gadget/s3c-hsotg.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index d208c46341d7..75a28e6d3761 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -2963,9 +2963,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget, | |||
2963 | goto err; | 2963 | goto err; |
2964 | } | 2964 | } |
2965 | 2965 | ||
2966 | s3c_hsotg_phy_enable(hsotg); | ||
2967 | |||
2968 | s3c_hsotg_core_init(hsotg); | ||
2969 | hsotg->last_rst = jiffies; | 2966 | hsotg->last_rst = jiffies; |
2970 | dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name); | 2967 | dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name); |
2971 | return 0; | 2968 | return 0; |
@@ -3028,10 +3025,40 @@ static int s3c_hsotg_gadget_getframe(struct usb_gadget *gadget) | |||
3028 | return s3c_hsotg_read_frameno(to_hsotg(gadget)); | 3025 | return s3c_hsotg_read_frameno(to_hsotg(gadget)); |
3029 | } | 3026 | } |
3030 | 3027 | ||
3028 | /** | ||
3029 | * s3c_hsotg_pullup - connect/disconnect the USB PHY | ||
3030 | * @gadget: The usb gadget state | ||
3031 | * @is_on: Current state of the USB PHY | ||
3032 | * | ||
3033 | * Connect/Disconnect the USB PHY pullup | ||
3034 | */ | ||
3035 | static int s3c_hsotg_pullup(struct usb_gadget *gadget, int is_on) | ||
3036 | { | ||
3037 | struct s3c_hsotg *hsotg = to_hsotg(gadget); | ||
3038 | unsigned long flags = 0; | ||
3039 | |||
3040 | dev_dbg(hsotg->dev, "%s: is_in: %d\n", __func__, is_on); | ||
3041 | |||
3042 | spin_lock_irqsave(&hsotg->lock, flags); | ||
3043 | if (is_on) { | ||
3044 | s3c_hsotg_phy_enable(hsotg); | ||
3045 | s3c_hsotg_core_init(hsotg); | ||
3046 | } else { | ||
3047 | s3c_hsotg_disconnect(hsotg); | ||
3048 | s3c_hsotg_phy_disable(hsotg); | ||
3049 | } | ||
3050 | |||
3051 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; | ||
3052 | spin_unlock_irqrestore(&hsotg->lock, flags); | ||
3053 | |||
3054 | return 0; | ||
3055 | } | ||
3056 | |||
3031 | static struct usb_gadget_ops s3c_hsotg_gadget_ops = { | 3057 | static struct usb_gadget_ops s3c_hsotg_gadget_ops = { |
3032 | .get_frame = s3c_hsotg_gadget_getframe, | 3058 | .get_frame = s3c_hsotg_gadget_getframe, |
3033 | .udc_start = s3c_hsotg_udc_start, | 3059 | .udc_start = s3c_hsotg_udc_start, |
3034 | .udc_stop = s3c_hsotg_udc_stop, | 3060 | .udc_stop = s3c_hsotg_udc_stop, |
3061 | .pullup = s3c_hsotg_pullup, | ||
3035 | }; | 3062 | }; |
3036 | 3063 | ||
3037 | /** | 3064 | /** |