From patchwork Fri Mar 5 19:38:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1448184 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=IjggSM88; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4DsdNb5tdzz9sW5 for ; Sat, 6 Mar 2021 06:39:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbhCETjJ (ORCPT ); Fri, 5 Mar 2021 14:39:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbhCETjC (ORCPT ); Fri, 5 Mar 2021 14:39:02 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4359BC061760 for ; Fri, 5 Mar 2021 11:39:02 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id y67so2911549pfb.2 for ; Fri, 05 Mar 2021 11:39:02 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=scaopPjHqYyO9XqSV5iNt3e946s1X2u5SubyWS47cB4=; b=IjggSM881BXAAf+eLc0zJ73YYk8+OOKsk6V9RBdfKsr+qm1qT9hRHMZA/We0Hk+oEW KrMVbWP0T4eogX3XonoffgNVP/egSJjZO9hvXy5lt+I3tnhSVSh7He1D4fujvvICwWMY PWudEZ27lf0Yg0ZJYME88k/N0O1KZnHSiPR2s= 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=scaopPjHqYyO9XqSV5iNt3e946s1X2u5SubyWS47cB4=; b=q38gqKvljM5LJKZvnsr0Pdz2ElL9cUpKxzmI88Vf9jdwbNn7Cw1xxW9AA9MToXUxrC IZR+piDBRYVGUk/Imd+EG/8PtukcuvTx7lQ/At8GGBu5opebpgBOBiHuQ+XnS+miTX1O xLub7BJP3u7+EATeGKyOblhCOfJlm96b8j4Mq1Ui8Du9//jkmYLj0zKh2Bherv+tOPNh Ew487rhoGZPyGXDYQcvhFP0R2Dgb3zj36+es2ygewPOs90W4T5uN2469kN3TyL5mG4Ul gMGBsk3Cvx19PwUbZ+LCiCOXgL6MDqUksFOm1Jy4Gvpr9BXavNXrcQcWyT3UPuDqQjkY zeMg== X-Gm-Message-State: AOAM530zw3mNcec7gZyCaKspekuvys2U05CvtQdchxLYGTWaLIz7SP4s LGl8uECQgUCdfmYC2y1JEjjSOw== X-Google-Smtp-Source: ABdhPJz7GnJlyRiFJaqnjCYdTcllkXIGTQ6sVqFE7OVOMN9GCvX2fj+eQD9qs/8Xn6HzSgth7LfHYw== X-Received: by 2002:a65:6a48:: with SMTP id o8mr9919171pgu.424.1614973141813; Fri, 05 Mar 2021 11:39:01 -0800 (PST) Received: from localhost ([2620:15c:202:1:2878:25d1:94cb:a547]) by smtp.gmail.com with UTF8SMTPSA id w27sm3306671pfq.105.2021.03.05.11.39.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Mar 2021 11:39:01 -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 Subject: [PATCH v6 1/5] dt-bindings: usb: Add binding for Realtek RTS5411 hub controller Date: Fri, 5 Mar 2021 11:38:49 -0800 Message-Id: <20210305113832.v6.1.I248292623d3d0f6a4f0c5bc58478ca3c0062b49a@changeid> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210305193853.2040456-1-mka@chromium.org> References: <20210305193853.2040456-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 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 | 58 +++++++++++++++++++ 1 file changed, 58 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..00e9b3d44583 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml @@ -0,0 +1,58 @@ +# 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: + 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 Fri Mar 5 19:38:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1448185 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=klVphLha; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4DsdNc1JbDz9sWX for ; Sat, 6 Mar 2021 06:39:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhCETjK (ORCPT ); Fri, 5 Mar 2021 14:39:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbhCETjG (ORCPT ); Fri, 5 Mar 2021 14:39:06 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B5FC061761 for ; Fri, 5 Mar 2021 11:39:06 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id t9so2463527pjl.5 for ; Fri, 05 Mar 2021 11:39:06 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=JB6kdr5tZpshWCy8V9QYmlDg00VbremNU/eNtnae9YQ=; b=klVphLhascJXjUnHD8FEDvvYZa+HqIWAzGHfuwOX0XJPnOdtMPCk7cRWEW+CQMtQSP JK77Fs6uUJLPFWJy4wjbLYEfc+qfzUpNP/VcZlV5AzGgfCWHVy2pObQ6JLG9/q88eF0Q mJvqUNRASQntYXH2Dpzlw2B8dfQyEaexrB3Jo= 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=JB6kdr5tZpshWCy8V9QYmlDg00VbremNU/eNtnae9YQ=; b=qT397ZPvbUz+g0Ui8RHYaxsU5K+uxf4wwWVskdKpYuHKl7sgdJ1xWQLry2F7elQvH/ wuGtqqV1AK3KK/igN14mOBn9aCij3/A9SP6xVnzEZF2q/rxDDOM49cQTT+GdATuo/2f5 tG4Z1kFC1/G7wAixX0pZWTGEXxkv459UqOL8wnTsb8nTGySBTUpgbWPSee6cZ3temcMA ED51yZ9UpBMK7yeLuCMxP+4wVJ5TARgXViinY9DatzDdvSrqG9QfaqszesRUadEH+aH/ 96Us2iGA11aifGx4fqHEMf8TE2BF7RwJgtrWxqmiAeK6EDVO1gGJBkdZAlX9Hsu61Z6m 1Jnw== X-Gm-Message-State: AOAM531yqvOOlZHV++GktEoPx+/udwrb307S2HMalM72yRimdmhc1e3Z YitWuzj/h1DY6VhooZ1F7/Qt3w== X-Google-Smtp-Source: ABdhPJxna8HSJsU74R2/mecjb+RJE4MHeJcu0zzhDLZkEkzRExlGOIoPRv2UzRiNz7lyWLi302bEBQ== X-Received: by 2002:a17:90b:92:: with SMTP id bb18mr11533435pjb.40.1614973146376; Fri, 05 Mar 2021 11:39:06 -0800 (PST) Received: from localhost ([2620:15c:202:1:2878:25d1:94cb:a547]) by smtp.gmail.com with UTF8SMTPSA id y15sm3960837pgi.31.2021.03.05.11.39.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Mar 2021 11:39:06 -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 Subject: [PATCH v6 3/5] of/platform: Add stubs for of_platform_device_create/destroy() Date: Fri, 5 Mar 2021 11:38:51 -0800 Message-Id: <20210305113832.v6.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210305193853.2040456-1-mka@chromium.org> References: <20210305193853.2040456-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 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,