From: Peter Chen Date: Mon, 22 Sep 2014 00:14:16 +0000 (+0800) Subject: usb: chipidea: otg initialization is only needed when the gadget is supported X-Git-Tag: v4.14-rc1~6740^2~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27c62c2da177178771517744acaced08767214e2;p=platform%2Fkernel%2Flinux-rpi.git usb: chipidea: otg initialization is only needed when the gadget is supported 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 41d45a16..7cb74c4 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -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);