Skip to content

Commit

Permalink
usb: chipidea: otg initialization is only needed when the gadget is s…
Browse files Browse the repository at this point in the history
…upported

We have only needed to enable otg initialization when both of
below conditions are satisfied:

- The controller is otg capable
- The gadget function is enabled

If the controller is otg capable, but is host-only configuration, we do
not need to access register otgsc and do any otg operations (eg, create
otg workqueue).

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Chen authored and Greg Kroah-Hartman committed Sep 24, 2014
1 parent f40017e commit 27c62c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/chipidea/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
goto deinit_phy;
}

if (ci->is_otg) {
if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) {
/* Disable and clear all OTG irq */
hw_write_otgsc(ci, OTGSC_INT_EN_BITS | OTGSC_INT_STATUS_BITS,
OTGSC_INT_STATUS_BITS);
Expand Down

0 comments on commit 27c62c2

Please sign in to comment.