From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C109C433F5 for ; Tue, 19 Oct 2021 16:26:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C554E6113B for ; Tue, 19 Oct 2021 16:26:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C554E6113B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1I/r0/cM/unBlirxSwfvvK4EWbKPQ7uyK2nmN02i8Cg=; b=SKCpH9qFuUVqBE SAI8L2omtShZBcliJAxM7ansBrnutdGgJQ+XnLfEcxtZR0/jW7esKxjA7Gcg5JkAKVginE3Ldu1RY zaKNygvn3PkD5xH6LMK+4ZcyvsOSTdNl5JjnVdkafOj+96qRH86yLLuWUGO+uNDPYGRdLp12Z9eg+ +aCzqAkcjXBKf0FdnyLE3GAaJEWZiQoNn1Fk0sb4Z3eUM4bAJHekL3+OCNP5NZxDRBQkCOqGIeqw3 5gHvXT+jzjiVi2sBOqcaeIcHWmdtBizJQAcXq7Le07uDGZ7BYqHRSKbqJZJJ2XOjDKgEe5YyjBJDj +SIvG3MNPgQhG/aO3ijA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcrvA-001v0p-8Q; Tue, 19 Oct 2021 16:25:00 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcrv6-001uzZ-0J for linux-arm-kernel@lists.infradead.org; Tue, 19 Oct 2021 16:24:57 +0000 Received: by mail-qt1-x833.google.com with SMTP id c28so438321qtv.11 for ; Tue, 19 Oct 2021 09:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=15SUVNjuA+MqctsOYnbPTmIlkRsNZOxO4riu8UF//h0=; b=fK+lPSwI1RGJXAeOcYSmAi+RRs1ueziY8FqbXBa7BV7E6/7ByaK9ZCRh4GJ/AD3tJH KMFoi6ZnmXOtxgyveYyZLIIKkdqGEn4bgFZ3npMLiyPPZEXjf0FRBJ1QWsPUmy1GmqQ+ ORo+WtPrWflHN2JPS3no9tLz1jt1sMSSC3YZ8rMATQuYIPelGrmMCmKm7S+8Ep+km5v3 UFS0dGbUDHUjmRPJuqMEekENex2g/uxRI7rjUae03apr/DsfFWa8coFytMyrG4wID414 L3Evm2x5kDzlTqn1GMnnCbRu6EW8I//L9ZRBKvMu+bHgTrg4SBgU0SLRCd4fcA3rvy1K JUNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=15SUVNjuA+MqctsOYnbPTmIlkRsNZOxO4riu8UF//h0=; b=IDAoRWz9ErWHk6/Zj4hsaLO5Q1+u629Uw/JGQKg4DEr24FH2luReWulF6pt+fe+jL9 rbea3S25rtgaGdB0ujoW1I10cnrDQHh9EuYA/SbISNkIOmRAKHWZcnZpvcwxWB3rFdyK f3Ik4la6D/1CXICcjeupa/7JUTHHwlL+4TUe2DyylJmvhY+NWLVcQBA7o0iU3Had5X5V l1yZoCsuHXBAH5oLLE2dNr1nbZaJOm5JR8enwMrDzLt4Vk3V6tdCqmq3aoHnY+5D+Xei 5r0X67DfaTkyF6eRHZV/nHrAZNMaFAhR0f5o+hIzDrQdhkj7cBKibb0iZ7SG9wTHSz5p 4VCg== X-Gm-Message-State: AOAM530JxWRYi9DFDVE3iEvXEFxPRjcIyEpbcbrogRKIivUXDnQrc8me 70M9bHJwEd4PrfDZceTj//BDoGU3Jw3nBQypgHAyWA== X-Google-Smtp-Source: ABdhPJwhsxdepZGrzEMoIzc6l/55gIir0sm89iZlWRUPYW3kP59vAcG9XWpOFy592VMNC+pRPFoGt4IIFn2UIbiT9J8= X-Received: by 2002:ac8:7d92:: with SMTP id c18mr1039528qtd.388.1634660693042; Tue, 19 Oct 2021 09:24:53 -0700 (PDT) MIME-Version: 1.0 References: <20210727004118.2583774-1-mka@chromium.org> In-Reply-To: <20210727004118.2583774-1-mka@chromium.org> From: Dmitry Baryshkov Date: Tue, 19 Oct 2021 19:24:41 +0300 Message-ID: Subject: Re: [PATCH v15 0/6] usb: misc: Add onboard_usb_hub driver To: Matthias Kaehlcke Cc: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi , Bastien Nocera , Peter Chen , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Michal Simek , open list , Douglas Anderson , Krzysztof Kozlowski , linux-usb@vger.kernel.org, Ravi Chandra Sadineni , Stephen Boyd , Al Cooper , Andrey Zhizhikin , Andy Gross , Aswath Govindraju , Bjorn Andersson , Catalin Marinas , Dmitry Osipenko , Enric Balletbo i Serra , Fabio Estevam , =?UTF-8?Q?Guido_G=C3=BCnther?= , Jagan Teki , Nishanth Menon , Pawel Laszczak , Roger Quadros , Shawn Guo , Vinod Koul , Will Deacon , Linux ARM , "open list:DRM DRIVER FOR MSM ADRENO GPU" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211019_092456_096011_233869FC X-CRM114-Status: GOOD ( 25.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 27 Jul 2021 at 03:41, Matthias Kaehlcke wrote: > > This series adds: > - the onboard_usb_hub_driver > - glue in the xhci-plat driver to create and destroy the > onboard_usb_hub platform devices if needed > - a device tree binding for the Realtek RTS5411 USB hub controller > - device tree changes that add RTS5411 entries for the QCA SC7180 > based boards trogdor and lazor > - a couple of stubs for platform device functions to avoid > unresolved symbols with certain kernel configs > > The main issue the driver addresses is that a USB hub needs to be > powered before it can be discovered. For discrete onboard hubs (an > example for such a hub is the Realtek RTS5411) this is often solved > by supplying the hub with an 'always-on' regulator, which is kind > of a hack. Some onboard hubs may require further initialization > steps, like changing the state of a GPIO or enabling a clock, which > requires even more hacks. This driver creates a platform device > representing the hub which performs the necessary initialization. > Currently it only supports switching on a single regulator, support > for multiple regulators or other actions can be added as needed. > Different initialization sequences can be supported based on the > compatible string. I have the feeling that you might want to check if you can use pwrseq subsystem being proposed at https://lore.kernel.org/linux-arm-msm/20211006035407.1147909-1-dmitry.baryshkov@linaro.org/. It has been created for exactly the same reason of handling complex power up/down requirements in a bus-neutral way. So instead of creating an onboard-usb-hub, you might want to populate the hub node with the reference to pwrseq device and make usb core call into pwrseq. How does that sound to you? > > Besides performing the initialization the driver can be configured > to power the hub off during system suspend. This can help to extend > battery life on battery powered devices which have no requirements > to keep the hub powered during suspend. The driver can also be > configured to leave the hub powered when a wakeup capable USB device > is connected when suspending, and power it off otherwise. -- With best wishes Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel