Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp768504pxy; Wed, 28 Apr 2021 13:54:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3cdioxN7d0/jdW1TgvcYorfWaZ8GthhJ8S5J+MjitlWv/JYrmX+Fn020Qm9Ui9b8mBoiF X-Received: by 2002:a17:907:9691:: with SMTP id hd17mr19781325ejc.67.1619643260779; Wed, 28 Apr 2021 13:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643260; cv=none; d=google.com; s=arc-20160816; b=yBJQrDdhFp0kbPVGBqk1mXqfOc31uJ3OtjFXVqXy8vMrqg5gllKVeX8Sdl1lqcYlOh iW32XoTwHrWsMgfr5tG2X/hDscXnYG7EMQffCdHhglvo5uZHvAcniW97Qfldux/zEQIp 6+hl7RkQyjrYMtDPu1SikZSkgvvLkzO/xL2S4C7iqDCnyqC4vlo16EwiBtzPxtlUPN8f RmEqne7CaiR+OUUvw3WGjM8Noe+qxNVT9rTaSpFaXjvQfgA720KOauLWwKK+BFtgBuzC tJn0Wl2h0rJYeNTgcZwiH1jU712PWWbLI+kN/+GV3f/7bIpIyUdqFWb7XfbhDuiRa1+j 8mxA== 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=iWgNLmw8XtUSWX3nXJqs3Lo41Zd8P550K3mKVLVvnf8=; b=Mw8G90pO7UWSg3Y9m21zTcPpgqBu5axO9ZQ6e4DpkuK+5Ty9Er0WbzMMi9IMHoRabW 2FWLIXo2cvvxxI1TOjgn5rdvyNaa/5+MuyyicjatHr/dsLltPN6ojFQKPJNyLv9YfjtI Gg63FQESxt16dtmlRoiv2iVJLArZuTVJn5vT6gfv3JO4aShi9ZTtvsSCHdRioT/DkvS6 Fe9WKeFe7z9Y03VTig8vf0UojPUIJujoZyhA4/C67wlW50bY/pgUZllmcz0KKWXWaCT9 ONnX728o4KP+IxBwbm1vW4iwbpJSGyLFmL1jSXx4rgdpQjJPCfxRx22Iz8KSSvRXdOaU O+5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Uk1O0Bgp; 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 i6si823712edv.142.2021.04.28.13.53.57; Wed, 28 Apr 2021 13:54:20 -0700 (PDT) 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=Uk1O0Bgp; 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 S243686AbhD1Sm1 (ORCPT + 99 others); Wed, 28 Apr 2021 14:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243659AbhD1SmZ (ORCPT ); Wed, 28 Apr 2021 14:42:25 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E5DC06138A for ; Wed, 28 Apr 2021 11:41:38 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so9610305pjv.1 for ; Wed, 28 Apr 2021 11:41:38 -0700 (PDT) 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=iWgNLmw8XtUSWX3nXJqs3Lo41Zd8P550K3mKVLVvnf8=; b=Uk1O0BgpnTa9THucVlNuUG2BFbxA/bUsmYfV78MZ2gAji7wuv0Maln71M/8n3/Poie l4ijDJL55PVr0jf3oaNpMKTJKe5FCpfeoNIm0iVaYOcusDLB7qEB0WnnMOpdaFxLXdA2 VfdZEDwS78h/+cG/79kcQ3YxoT/NBXH5dgKUU= 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=iWgNLmw8XtUSWX3nXJqs3Lo41Zd8P550K3mKVLVvnf8=; b=oQyr9JSlYVO5/LTePJ+fzUzPpKYXiTaJ0qBQAtlKhIvzfi5eV4yhs7lp9ik7HQZrEA 7adWF0pHVt0HVVnNSQh3sqbC0/8pFQ+TeTHciCBsO3WxVhHepH7Ejqhq0QgV4kw4FLcU Cx6N2bCo96phA4c6WjODUEOl1gowY2n7Q51tbuj62vu8BZLq6TLbEZ2Wh8ZVR3yCCf51 SMBGOUZNEklaf5u3/lCiowvVYEeBlTDr48BbzWAL5fJeS5XS7c9C97IjQykQidg9RZZI 2Lne6g2cf+3kK/2bSIbq6O+iWZrurn9vTr0ovQ+1NCTkmm+6+l2PLygOBfU15/q04XEf 2BwQ== X-Gm-Message-State: AOAM533XNEWq8UNmbFC748Ayv6VfufAQraMxbjdiHoyR57vWdZpXw5OM 3JPcVgpYAYC1fMa+NNgULRwU9A== X-Received: by 2002:a17:902:aa98:b029:ec:a55f:f4bc with SMTP id d24-20020a170902aa98b02900eca55ff4bcmr31879072plr.82.1619635298324; Wed, 28 Apr 2021 11:41:38 -0700 (PDT) Received: from localhost ([2620:15c:202:201:4c1a:a0a7:2b43:81b0]) by smtp.gmail.com with UTF8SMTPSA id c13sm5257874pjv.21.2021.04.28.11.41.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Apr 2021 11:41:37 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: linux-kernel@vger.kernel.org, Ravi Chandra Sadineni , Michal Simek , Bastien Nocera , linux-usb@vger.kernel.org, Douglas Anderson , Krzysztof Kozlowski , Stephen Boyd , devicetree@vger.kernel.org, Peter Chen , Matthias Kaehlcke , Al Cooper , "Alexander A. Klimov" , Andy Gross , Bjorn Andersson , Masahiro Yamada , Mathias Nyman , linux-arm-msm@vger.kernel.org Subject: [PATCH v8 0/5] USB: misc: Add onboard_usb_hub driver Date: Wed, 28 Apr 2021 11:41:27 -0700 Message-Id: <20210428184132.2184997-1-mka@chromium.org> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-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. (no changes since v7) Changes in v7: - updated DT binding - series rebased on qcom/arm64-for-5.13 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 | 62 +++ 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 | 19 +- 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, 599 insertions(+), 36 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.31.1.498.g6c1eba8ee3d-goog