From patchwork Thu Jun 9 09:44:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9166611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 106916048F for ; Thu, 9 Jun 2016 09:50:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F40D82830C for ; Thu, 9 Jun 2016 09:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8B7028336; Thu, 9 Jun 2016 09:50:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B7972830C for ; Thu, 9 Jun 2016 09:50:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAwaR-0003D2-99; Thu, 09 Jun 2016 09:49:15 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAwWh-0005ab-En for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2016 09:45:24 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8I00DLY0EZ8J70@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2016 10:44:59 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-aa-57593a9b2647 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 31.F6.05254.B9A39575; Thu, 9 Jun 2016 10:44:59 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8I006RA0EHZZ10@eusync1.samsung.com>; Thu, 09 Jun 2016 10:44:59 +0100 (BST) From: Krzysztof Kozlowski To: Ulf Hansson , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Krzysztof Kozlowski , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Liam Girdwood , Mark Brown , Greg Kroah-Hartman , Hans de Goede , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Heiko Stuebner , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, hzpeterchen@gmail.com Subject: [RFC v4 12/14] EXAMPLE CODE: usb: hub: Power sequence the ports on activation Date: Thu, 09 Jun 2016 11:44:29 +0200 Message-id: <1465465471-28740-13-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1465465471-28740-1-git-send-email-k.kozlowski@samsung.com> References: <1465465471-28740-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t/xy7qzrSLDDY5M57bYOGM9q8XUh0/Y LCY9ec9sMf/IOVaLiSsnM1v0v1nIatG8eD2bxZvj05ks/j96zWrRdXUTm8W5VysZLV6/MLT4 dqWDyWLT42usFif6PrBaXN41h83iyP9+RovPvUcYLWac38dksWhZK7PF0usXmSwmTF/LYrHu 4Qsmi9a9R9gtTu8usVg//xabxfG14Q7SHmvmrWH0uNzXy+Sxc9Zddo+Vy7+weWxeoeXx6sId Fo9NqzrZPO5c28PmsX/uGnaPzUvqPd7vu8rm0bdlFaPH9mvzmD2O39jO5PF5k1wAfxSXTUpq TmZZapG+XQJXxrGtt5gL7nNU3H25ibmBcTZ7FyMnh4SAicTM7kcsELaYxIV769m6GLk4hASW Mkq8+7gSymlkkmjaOo8ZpIpNwFhi8/IlYAkRgUvsEjcubWcCSTALWEhs3boabKywQITEk0s/ wBpYBFQldvcfZwOxeQU8JGZefcQEsU5O4uSxyawgNidQ/NG9x2D1QgLuEnsXT2abwMi7gJFh FaNoamlyQXFSeq6hXnFibnFpXrpecn7uJkZI7H3Zwbj4mNUhRgEORiUeXs2UiHAh1sSy4src Q4wSHMxKIrw/zCPDhXhTEiurUovy44tKc1KLDzFKc7AoifPO3fU+REggPbEkNTs1tSC1CCbL xMEp1cAY8/My05NJaRMyb6asKmfcn6cX/O+T9K31U2ZxBT6y23H4j2wT9xqL9bnhtVWHp2iy RF84srNmhre849UHfTZ386fsFXVSObX4Ser+1U4J/QbPdWT5ZR6q8x5/ErSpXc7d2Y775fSX P85qrjgoI5sXEOvhcF85yeqo4Ovwm1Vx3z9dPtXc1mSsxFKckWioxVxUnAgA44Ocu7kCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160609_024523_806941_DEBB26A6 X-CRM114-Status: GOOD ( 16.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The autodetection of attached USB device might not work on certain boards where the power is delivered externally. These devices also might require a hard reset. Use pwrseq for that in USB hub. Signed-off-by: Krzysztof Kozlowski --- drivers/usb/core/hub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index c421745b84aa..46d9f9aedacc 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1663,6 +1664,15 @@ static int hub_configure(struct usb_hub *hub, usb_hub_adjust_deviceremovable(hdev, hub->descriptor); + /* FIXME: When do the pre-power-on? */ + /* + for (i = 0; i < maxchild; i++) + pwrseq_pre_power_on(hub->ports[i]->pwrseq); + */ + + for (i = 0; i < maxchild; i++) + pwrseq_post_power_on(hub->ports[i]->pwrseq); + hub_activate(hub, HUB_INIT); return 0;