usb: chipidea: parameter 'mode' isn't needed for hw_device_reset
authorPeter Chen <peter.chen@freescale.com>
Wed, 26 Nov 2014 05:44:33 +0000 (13:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2014 17:28:12 +0000 (09:28 -0800)
The hw_device_reset is dedicated to be used at device mode initializaiton,
so delete the parameter 'mode'. For host driver, the ehci driver will
handle all things.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/ci.h
drivers/usb/chipidea/core.c
drivers/usb/chipidea/otg_fsm.c
drivers/usb/chipidea/udc.c

index 5bbfcc73cf7006e5e270365dfc7b91826093438c..65913d48f0c80538cb4153aeac05ee6142750191 100644 (file)
@@ -352,7 +352,7 @@ u32 hw_read_intr_enable(struct ci_hdrc *ci);
 
 u32 hw_read_intr_status(struct ci_hdrc *ci);
 
-int hw_device_reset(struct ci_hdrc *ci, u32 mode);
+int hw_device_reset(struct ci_hdrc *ci);
 
 int hw_port_test_set(struct ci_hdrc *ci, u8 mode);
 
index 48b25d9ebf82689d9fcb6562e45433e793381462..e43be34f04b9c40ede1bacef5e45e1fe1bffc3f5 100644 (file)
@@ -410,7 +410,7 @@ static int hw_controller_reset(struct ci_hdrc *ci)
  *
  * This function returns an error code
  */
-int hw_device_reset(struct ci_hdrc *ci, u32 mode)
+int hw_device_reset(struct ci_hdrc *ci)
 {
        int ret;
 
@@ -440,12 +440,12 @@ int hw_device_reset(struct ci_hdrc *ci, u32 mode)
 
        /* USBMODE should be configured step by step */
        hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_IDLE);
-       hw_write(ci, OP_USBMODE, USBMODE_CM, mode);
+       hw_write(ci, OP_USBMODE, USBMODE_CM, USBMODE_CM_DC);
        /* HW >= 2.3 */
        hw_write(ci, OP_USBMODE, USBMODE_SLOM, USBMODE_SLOM);
 
-       if (hw_read(ci, OP_USBMODE, USBMODE_CM) != mode) {
-               pr_err("cannot enter in %s mode", ci_role(ci)->name);
+       if (hw_read(ci, OP_USBMODE, USBMODE_CM) != USBMODE_CM_DC) {
+               pr_err("cannot enter in %s device mode", ci_role(ci)->name);
                pr_err("lpm = %i", ci->hw_bank.lpm);
                return -ENODEV;
        }
index 368cc8e94fd6266bbf52bebd0165cfc2632b209b..7ef124db657aa9ec2f956efc40532ed7b57d1266 100644 (file)
@@ -543,7 +543,7 @@ static int ci_otg_start_host(struct otg_fsm *fsm, int on)
                ci_role_start(ci, CI_ROLE_HOST);
        } else {
                ci_role_stop(ci);
-               hw_device_reset(ci, USBMODE_CM_DC);
+               hw_device_reset(ci);
                ci_role_start(ci, CI_ROLE_GADGET);
        }
        mutex_lock(&fsm->lock);
index bdaa7bac6f4a2dec68a350f7d2c47b47f6fe65c8..4fe18ce3bd5aa6018d924aec5e09b9e4510f516d 100644 (file)
@@ -1471,7 +1471,7 @@ static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
        if (gadget_ready) {
                if (is_active) {
                        pm_runtime_get_sync(&_gadget->dev);
-                       hw_device_reset(ci, USBMODE_CM_DC);
+                       hw_device_reset(ci);
                        hw_device_state(ci, ci->ep0out->qh.dma);
                        usb_gadget_set_state(_gadget, USB_STATE_POWERED);
                } else {
@@ -1660,7 +1660,7 @@ static int ci_udc_start(struct usb_gadget *gadget,
        pm_runtime_get_sync(&ci->gadget.dev);
        if (ci->vbus_active) {
                spin_lock_irqsave(&ci->lock, flags);
-               hw_device_reset(ci, USBMODE_CM_DC);
+               hw_device_reset(ci);
        } else {
                pm_runtime_put_sync(&ci->gadget.dev);
                return retval;