Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2286446pxb; Fri, 5 Mar 2021 11:42:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfPELWHJcGW0wGA8Yil6+Pl5ldS+5l6/WEtC95G7r84/OpkQuvevVjwHamaDcw8E0jv6Q5 X-Received: by 2002:aa7:d954:: with SMTP id l20mr10755183eds.1.1614973361601; Fri, 05 Mar 2021 11:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614973361; cv=none; d=google.com; s=arc-20160816; b=GT3tQISMWqSGRJSCMVRUdZDK2wFFZ2RweCW8m2w5xvzVEnODtW5GBT35Y6QXj5QWOD FIv+x7yhio3iYtKO+g1Lg10lf/KVi0i5I0wPUKqWV64Y4Vsmhd5oBLhrAP+hNQwhZJTf B+A3PoCwtyDiRg4qRuTyw05JLncLuI3wzURenh6i2aDDYraqabDfHjAKsqAHf2bbMTtW gc0s8YBE1z24oFmPRImi/XcvpaQUq/I8U1MsNtvL4IIznkqo2m77utPDcYnD5r7Hpwjn K7Xcxql6GdrGN6RPgC9n3fRWFKJ5TULN/mC1XsXE2DeEBDRz3aYtEdoEH9iIizohutgr S+Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LG9oyAMtJgx3MZnF1cjNx0Z73nyJ3bl+UDBONgUWEek=; b=F724+iAt/YgB04MO13uBQmtzheuPGKvfvHiV/mxOnSTLuPuIm+yFKAti+w//dEQsUP JwhIO5tWoxdfeEK0JvyVSqd72QECgPUFanm/rxPK546V6AohP357FoPxXSKVc4OSbWjW 593I6uDg2l9Wlo5NBeDijPt1D9AeD9MZctZI3XGAQz8SOHnNUV9KCNzlPL/hlgWZehzN qOcIe7NFMkJ6dbAZlK6uMTk2wzXiA/aIBA582H22hP+z6Xom7kmNMtLTnGdFiZbLPuVv c6yLBM01sHcM1SHYjUx9/lsrGw/qFAH/SItkTEh6vm+ASX/wj5cotub0/bHUirD+6b6z qrxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ggOIM+SG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si2202867edu.9.2021.03.05.11.42.18; Fri, 05 Mar 2021 11:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ggOIM+SG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhCETjL (ORCPT + 99 others); Fri, 5 Mar 2021 14:39:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbhCETjA (ORCPT ); Fri, 5 Mar 2021 14:39:00 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD54C06175F for ; Fri, 5 Mar 2021 11:39:00 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id l18so2726511pji.3 for ; Fri, 05 Mar 2021 11:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LG9oyAMtJgx3MZnF1cjNx0Z73nyJ3bl+UDBONgUWEek=; b=ggOIM+SG40FpYO7nKWVXfsxUahWUDooTMRZxn5l7gTA+HO/Oshx+xFI2gJm8FjGFWd yMO+6a4sKQ33MZPPDgF876Qspmsq41SzfPC/U+EkXbRZT8Zkft54CY+9UkImiYl134kk OFr4e0tyCp9zZaaDPh2DcKIA2ZE1YKPtxO9Ao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LG9oyAMtJgx3MZnF1cjNx0Z73nyJ3bl+UDBONgUWEek=; b=YoerjnS4y40DzPQ3EcKu+/xMhrnYb8Nh54Ok9+Gvqj99Zw1r1yH5I1bY1o3sc5KfNs cnWOnW/n2bLJYwbu6SVdVIlVXGmFC2hiIbGWQnck8rW2R0FMPKlXMAou0VVPpuGQcYDG 1ojfReUFYbla8M+bP2CWMs1AtNJCQNK22r+i9Us7AZPZQEVTAn55rI+303p1wtEZfMQ9 NQKuc2OLpW+6nMsTC/S2UpsA+qGdoZmztuwDrmngNou4dfP6V0G0dgK6oBOqlIH2s55S kfa2h6Ikr97jxAXQ6FTuwilU1pT65qo/Gw2dVSXJpd/zdfwsaFNwD7MGfW5Xu64rf5wp kJpw== X-Gm-Message-State: AOAM531UbpM+r+FJ9SAVVfDS8UkXATpsCFe0G4SmY+vBRN8/Xn58tvli kGrUaJqjhzwZCULHe0O64VUfBA== X-Received: by 2002:a17:90a:7d05:: with SMTP id g5mr11477597pjl.173.1614973139627; Fri, 05 Mar 2021 11:38:59 -0800 (PST) Received: from localhost ([2620:15c:202:1:2878:25d1:94cb:a547]) by smtp.gmail.com with UTF8SMTPSA id o13sm3355640pfp.26.2021.03.05.11.38.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Mar 2021 11:38:59 -0800 (PST) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: Ravi Chandra Sadineni , Peter Chen , Michal Simek , Stephen Boyd , linux-kernel@vger.kernel.org, Bastien Nocera , linux-usb@vger.kernel.org, Douglas Anderson , devicetree@vger.kernel.org, Krzysztof Kozlowski , Matthias Kaehlcke , Al Cooper , "Alexander A. Klimov" , Andy Gross , Bjorn Andersson , Masahiro Yamada , Mathias Nyman , linux-arm-msm@vger.kernel.org Subject: [PATCH v6 0/5] USB: misc: Add onboard_usb_hub driver Date: Fri, 5 Mar 2021 11:38:48 -0800 Message-Id: <20210305193853.2040456-1-mka@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds: - the onboard_usb_hub_driver - glue in the xhci-plat driver to create the onboard_usb_hub platform device 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. 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. Changes in v6: - updated summary Changes in v5: - cover letter added Matthias Kaehlcke (5): dt-bindings: usb: Add binding for Realtek RTS5411 hub controller USB: misc: Add onboard_usb_hub driver of/platform: Add stubs for of_platform_device_create/destroy() usb: host: xhci-plat: Create platform device for onboard hubs in probe() arm64: dts: qcom: sc7180-trogdor: Add nodes for onboard USB hub .../sysfs-bus-platform-onboard-usb-hub | 8 + .../bindings/usb/realtek,rts5411.yaml | 58 +++ MAINTAINERS | 7 + .../boot/dts/qcom/sc7180-trogdor-lazor-r0.dts | 19 +- .../boot/dts/qcom/sc7180-trogdor-lazor-r1.dts | 11 +- .../arm64/boot/dts/qcom/sc7180-trogdor-r1.dts | 15 +- arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 21 +- drivers/usb/host/xhci-plat.c | 16 + drivers/usb/misc/Kconfig | 17 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/onboard_usb_hub.c | 415 ++++++++++++++++++ include/linux/of_platform.h | 22 +- include/linux/usb/hcd.h | 2 + include/linux/usb/onboard_hub.h | 15 + 14 files changed, 593 insertions(+), 34 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub create mode 100644 Documentation/devicetree/bindings/usb/realtek,rts5411.yaml create mode 100644 drivers/usb/misc/onboard_usb_hub.c create mode 100644 include/linux/usb/onboard_hub.h -- 2.30.1.766.gb4fecdf3b7-goog