From patchwork Mon Apr 5 20:18:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1462533 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ivLJ4kNs; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FDhmz6l6qz9sV5 for ; Tue, 6 Apr 2021 06:18:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240693AbhDEUSa (ORCPT ); Mon, 5 Apr 2021 16:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234602AbhDEUS3 (ORCPT ); Mon, 5 Apr 2021 16:18:29 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5567BC061756 for ; Mon, 5 Apr 2021 13:18:23 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id q5so8855544pfh.10 for ; Mon, 05 Apr 2021 13:18:23 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=USPccDuBErsrLDvo9xZKt8gJcCaFBKn/zm39axGDpig=; b=ivLJ4kNskyKx3gkIq2Y10JTtg5e54/ou8XBMfsszwFNQXPnljfa4yyZVeRoGRzDekH 3SgUqx8dcQdPgszpsgfUL8hmwz+nJWc8rCE1v7DjnJW/6uvnuncVeh4F4q8MCzUse59U 31y1IQIvRFPM0Sn76meZ5DPJL5YE2S5HqOJ+A= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=USPccDuBErsrLDvo9xZKt8gJcCaFBKn/zm39axGDpig=; b=rpdMp93++70k/6Clow1+HtHV37zEnHjWdjxi+YXksyncG0Ee8/8+69Ygqzkms//0WS KzJKg3TLQ5rebGPT/STLwq0Bl8zMoJpTq1xh4EK4xTLsvrCj0j/yW1Fs0vQx0s3qXncJ ndiWMwSsrArACGGQjo50zwXRjjTNMsOydXH19ZrJNwGnNbqL2HnfrykqFL8BZtsh2/wt wxXY+Zds0Z8q0tMXfsq7y0dGD5vltXGtJLTR0mIsap8JwbXUAaOpmp2blGU7eJFz7hoc 7iN/EJ3DUp2EIHxq5jWmRGA2taOoDusiJUW4buu9DEPYTgNCbxH8r30prbxPBaMZ52v5 oMpg== X-Gm-Message-State: AOAM533OMxAK/B+QE8ZP2UHqOL1qVX9lcNlQ4reIE24B1t16FzYTykwp Wr54iG42XwR4+Np0MNhGL5Oafw== X-Google-Smtp-Source: ABdhPJx+DcDq6VtoFycad7CXCpXE557eDq6JXRjb1GikVprIVbmfbqFB/Og3krB15TwhW9gLeDKOxw== X-Received: by 2002:a63:338e:: with SMTP id z136mr24333155pgz.115.1617653902952; Mon, 05 Apr 2021 13:18:22 -0700 (PDT) Received: from localhost ([2620:15c:202:201:455e:b8cf:5939:67da]) by smtp.gmail.com with UTF8SMTPSA id v14sm263916pju.19.2021.04.05.13.18.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Apr 2021 13:18:22 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Douglas Anderson , Peter Chen , Michal Simek , linux-usb@vger.kernel.org, Ravi Chandra Sadineni , Bastien Nocera , devicetree@vger.kernel.org, Stephen Boyd , Matthias Kaehlcke Subject: [PATCH v6 1/5] dt-bindings: usb: Add binding for Realtek RTS5411 hub controller Date: Mon, 5 Apr 2021 13:18:13 -0700 Message-Id: <20210405124900.v6.1.I248292623d3d0f6a4f0c5bc58478ca3c0062b49a@changeid> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog In-Reply-To: <20210405201817.3977893-1-mka@chromium.org> References: <20210405201817.3977893-1-mka@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Realtek RTS5411 is a USB 3.0 hub controller with 4 ports. This initial version of the binding only describes USB related aspects of the RTS5411, it does not cover the option of connecting the controller as an i2c slave. Signed-off-by: Matthias Kaehlcke --- Changes in v7: - added type ref for 'companion-hub' property Changes in v6: - Realtek binding instead of generic onboard_usb_hub - added 'companion-hub' property - added reference to 'usb-device.yaml' - 'fixed' indentation of compatible entries to keep yamllint happy - added 'additionalProperties' entry - updated commit message Changes in v5: - updated 'title' - only use standard USB compatible strings - deleted 'usb_hub' node - renamed 'usb_controller' node to 'usb-controller' - removed labels from USB nodes - added 'vdd-supply' to USB nodes Changes in v4: - none Changes in v3: - updated commit message - removed recursive reference to $self - adjusted 'compatible' definition to support multiple entries - changed USB controller phandle to be a node Changes in v2: - removed 'wakeup-source' and 'power-off-in-suspend' properties - consistently use spaces for indentation in example .../bindings/usb/realtek,rts5411.yaml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/realtek,rts5411.yaml diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml new file mode 100644 index 000000000000..b59001972749 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/realtek,rts5411.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Binding for the Realtek RTS5411 USB 3.0 hub controller + +maintainers: + - Matthias Kaehlcke + +allOf: + - $ref: usb-device.yaml# + +properties: + compatible: + items: + - enum: + - usbbda,5411 + - usbbda,411 + + vdd-supply: + description: + phandle to the regulator that provides power to the hub. + + companion-hub: + $ref: '/schemas/types.yaml#/definitions/phandle' + description: + phandle to the companion hub on the controller. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + usb-controller { + dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + /* 2.0 hub on port 1 */ + hub_2_0: hub@1 { + compatible = "usbbda,5411"; + reg = <1>; + vdd-supply = <&pp3300_hub>; + companion-hub = <&hub_3_0>; + }; + + /* 3.0 hub on port 2 */ + hub_3_0: hub@2 { + compatible = "usbbda,411"; + reg = <2>; + vdd-supply = <&pp3300_hub>; + companion-hub = <&hub_2_0>; + }; + }; From patchwork Mon Apr 5 20:18:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1462534 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=VebF3LDO; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FDhnB0wW5z9sW1 for ; Tue, 6 Apr 2021 06:18:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240830AbhDEUSj (ORCPT ); Mon, 5 Apr 2021 16:18:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240732AbhDEUSe (ORCPT ); Mon, 5 Apr 2021 16:18:34 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5062FC061794 for ; Mon, 5 Apr 2021 13:18:26 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 11so7164734pfn.9 for ; Mon, 05 Apr 2021 13:18:26 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=jVCJ0h/Oodi5krhaNgbRSg1bVB0ggAGmgl9KPrweYRY=; b=VebF3LDONKvgIEyHo9JHSQJzVCYhsgDgCAFBvVTD3kvr6SZJEeQ9jvzOYAAPnvpGch q16mU+mCYWifD0LCNYMEcy6sI0qr/rn6ROG6XZ5aO3F3WzG845mmWXjA2HDhVSkltctk EY7adXH+SmbY0XbXYuhilhaiY1KR2zLY0Oei0= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jVCJ0h/Oodi5krhaNgbRSg1bVB0ggAGmgl9KPrweYRY=; b=G+fIgw4hdZ2xAqceIlt61OVot+/dN0YzBTq6eY/u9oXSU4iNmtZg0TjdpdFodnj7Xf lAjfqWZFJjf3KEaVIqKNgTYgkUqvORxJSSqZoAjiJn5YB18YwJ2ZatWEL8VLHIVgb3Gm 3KANmbfPQO7MFAoPMhfq/x/W22g43yHLooTUGkb3htVaAHymiGtZfxm4JLq/5QQ9SCiz e6OyS36lc9N7C3Y9tmgrK8GeeG7Cmf0yLpul0jE49rgXWH5Tfp6LhfCsInjEi+6az6gt +mlh/vT3+MGyTkntICim3lI4XAJWA9YJ78/UU7Va1HrnwY8XGw75gpSkY/aXLd5lAIXS IDXg== X-Gm-Message-State: AOAM530/DMlhpfYmpr2voJNorFsfMo6hUTHLYcVxc8eyeBPh+g/V+cFJ k91MLmGYYdKBFf7/KWeXHoVGYA== X-Google-Smtp-Source: ABdhPJzfHLnsjpDXtr2ZY/KN+TgPTBgD97zLSg4ORWVSK4yCXQSOJTBimehNjtIdiNms3qRpBLlAJQ== X-Received: by 2002:a62:168b:0:b029:20d:69a5:189 with SMTP id 133-20020a62168b0000b029020d69a50189mr24898325pfw.57.1617653905887; Mon, 05 Apr 2021 13:18:25 -0700 (PDT) Received: from localhost ([2620:15c:202:201:455e:b8cf:5939:67da]) by smtp.gmail.com with UTF8SMTPSA id c72sm16639069pfb.165.2021.04.05.13.18.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Apr 2021 13:18:25 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Douglas Anderson , Peter Chen , Michal Simek , linux-usb@vger.kernel.org, Ravi Chandra Sadineni , Bastien Nocera , devicetree@vger.kernel.org, Stephen Boyd , Matthias Kaehlcke Subject: [PATCH v6 3/5] of/platform: Add stubs for of_platform_device_create/destroy() Date: Mon, 5 Apr 2021 13:18:15 -0700 Message-Id: <20210405124900.v6.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog In-Reply-To: <20210405201817.3977893-1-mka@chromium.org> References: <20210405201817.3977893-1-mka@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Code for platform_device_create() and of_platform_device_create() is only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved symbols when CONFIG_OF_ADDRESS is not set. Signed-off-by: Matthias Kaehlcke --- Changes in v7: - none Changes in v6: - patch added to the series include/linux/of_platform.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 84a966623e78..d15b6cd5e1c3 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -61,16 +61,18 @@ static inline struct platform_device *of_find_device_by_node(struct device_node } #endif +extern int of_platform_bus_probe(struct device_node *root, + const struct of_device_id *matches, + struct device *parent); + +#ifdef CONFIG_OF_ADDRESS /* Platform devices and busses creation */ extern struct platform_device *of_platform_device_create(struct device_node *np, const char *bus_id, struct device *parent); extern int of_platform_device_destroy(struct device *dev, void *data); -extern int of_platform_bus_probe(struct device_node *root, - const struct of_device_id *matches, - struct device *parent); -#ifdef CONFIG_OF_ADDRESS + extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, @@ -84,6 +86,18 @@ extern int devm_of_platform_populate(struct device *dev); extern void devm_of_platform_depopulate(struct device *dev); #else +/* Platform devices and busses creation */ +static inline struct platform_device *of_platform_device_create(struct device_node *np, + const char *bus_id, + struct device *parent) +{ + return NULL; +} +static inline int of_platform_device_destroy(struct device *dev, void *data) +{ + return -ENODEV; +} + static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup,