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: 9166563 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 A08CA607DA for ; Thu, 9 Jun 2016 09:48:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FFB32830C for ; Thu, 9 Jun 2016 09:48:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83CF128338; Thu, 9 Jun 2016 09:48:26 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16E732830C for ; Thu, 9 Jun 2016 09:48:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423511AbcFIJsR (ORCPT ); Thu, 9 Jun 2016 05:48:17 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:24641 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933541AbcFIJpE (ORCPT ); Thu, 9 Jun 2016 05:45:04 -0400 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>; 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 Cc: Bartlomiej Zolnierkiewicz 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= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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;