From patchwork Wed Jun 23 18:41:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1496253 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=cZZzfHZ1; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4G9Btk16ckz9sV8 for ; Thu, 24 Jun 2021 04:41:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbhFWSnu (ORCPT ); Wed, 23 Jun 2021 14:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbhFWSnt (ORCPT ); Wed, 23 Jun 2021 14:43:49 -0400 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 271D5C06175F for ; Wed, 23 Jun 2021 11:41:32 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id bb10-20020a17090b008ab029016eef083425so4351453pjb.5 for ; Wed, 23 Jun 2021 11:41:32 -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=VGosW2rs/EYJqX206hFqsFUIaq3gYBNN1MYzGGDuweM=; b=cZZzfHZ1xLi6jZvJq3l3fBargO4auHk9zd4F5k+s2G0TWZ7tG3q3KKotis2D+9uwW4 5bAowKW0LUigr5fGIsS4uFAA0TP02rlErDFMYGcwuyMlEvI8COwOHiRcxbV6tdmU74M6 pQQYH0asKuXP1DNB5ky3Na8AJHxygFp5Uotpo= 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=VGosW2rs/EYJqX206hFqsFUIaq3gYBNN1MYzGGDuweM=; b=kN3oKcG3PTRqwaEAf1FEn4TOryTutE0G84bU6W+dax89E8iOHhc00alskilEEzdOqW YD3ls/cug4r6MNUy+L97eUEBSs4WGYS/esKbnaGrIs5w44o+3sbax3nGIJXT+JKu84B2 lHm+FvJ0N9xH9uYdb5gtHVil+VgXxbOYxoOQIIrC8bnFOLieK8N4BTB0w8cdEjTNcs4q hta2UFoJ+bfkkNMoczAooYq/YHTY/ZunR1I1YczD4pov51y01a/WTOYeyb4PXp9TjxcV fHW70sQCyrnnJApY9HnRPiGMimOG1VL0vePzfmPUyhzNgam18sdqO3pE3zoRNBh5KpaQ PMKA== X-Gm-Message-State: AOAM5323VoDkozKOKMJr8QynLEaMbO6S1WikAxZ31CtrZ/xH4EPrDMQL 5o/zYrTnfDZjoXDam9JD4JoW3A== X-Google-Smtp-Source: ABdhPJzI1Dv+BsMm+DAAlHpJN160SV9S+rOgzZripmsdD+vEnHbxJgnuqlht17w0Mh64R19/AsCtHA== X-Received: by 2002:a17:902:c412:b029:127:958e:79c3 with SMTP id k18-20020a170902c412b0290127958e79c3mr735086plk.27.1624473691648; Wed, 23 Jun 2021 11:41:31 -0700 (PDT) Received: from localhost ([2620:15c:202:201:d440:232:5e25:41f4]) by smtp.gmail.com with UTF8SMTPSA id h11sm512363pgq.68.2021.06.23.11.41.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 11:41:31 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Simek , Krzysztof Kozlowski , Peter Chen , Bastien Nocera , Stephen Boyd , Douglas Anderson , Ravi Chandra Sadineni , Matthias Kaehlcke , Rob Herring Subject: [PATCH v13 1/7] dt-bindings: usb: Add binding for Realtek RTS5411 hub controller Date: Wed, 23 Jun 2021 11:41:17 -0700 Message-Id: <20210623114025.v13.1.I248292623d3d0f6a4f0c5bc58478ca3c0062b49a@changeid> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog In-Reply-To: <20210623184124.3504047-1-mka@chromium.org> References: <20210623184124.3504047-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 Reviewed-by: Rob Herring --- Changes in v13: - none Changes in v12: - none Changes in v11: - none Changes in v10: - none Changes in v9: - added Rob's 'Reviewed-by' tag Changes in v8: - added entry for 'reg' - marked 'companion-hub' as required - changed node name of USB controller to 'usb' 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 | 62 +++++++++++++++++++ 1 file changed, 62 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..04ee255eb4f0 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml @@ -0,0 +1,62 @@ +# 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 + + reg: true + + 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: + - companion-hub + - compatible + - reg + +additionalProperties: false + +examples: + - | + usb { + 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 Wed Jun 23 18:41:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 1496255 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=EWbeAUec; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4G9Btt3DVzz9sCD for ; Thu, 24 Jun 2021 04:41:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbhFWSn6 (ORCPT ); Wed, 23 Jun 2021 14:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbhFWSnz (ORCPT ); Wed, 23 Jun 2021 14:43:55 -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 DEC36C061767 for ; Wed, 23 Jun 2021 11:41:36 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id i6so3062108pfq.1 for ; Wed, 23 Jun 2021 11:41:36 -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=rn+jkfBaHm09mGok+nONlCf30mFoynV+UZRNUFIhdDU=; b=EWbeAUecEk+oAWVdmnDXSx6cxVTC7chbrqCDPHXIqIhqFaWpmeNgdS2LWt+EowzFgU Cd9HLSv0TK9hCOEt6vc8cqr02Ae5off+o+jwUt2Q+4J2Sf7nkXiOlWuyhLJHw+Ne2W9J 3sPjZjZxrYjC+SB2wUIVG1hUKRtWr/iG74jzo= 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=rn+jkfBaHm09mGok+nONlCf30mFoynV+UZRNUFIhdDU=; b=bhuT60K8bM7+H6yc0V84rG/PsdEQRsF985xIkCXcG7x9+K7zJS42hAfETv9BKjoXsC Wd/52Bjh0z0VoAG6NilhkFnHw6kuFjEqFj2PKoZ13TOLUGZ3YcAoB3VLu4dhS9N8C7hK ePFNJuPQFjysOkvys7lo+wK2bLNwgCqeeClAatQ2VvD3H4gxHTD9pfNLamY+wAVAEEmL h3EQ5peBylFrBhB19P81tjyDb/QQe8fdbRPfscT/BKqsH2EnPco0aJFp9aHsQKBnDfwY VsN0DpYPl5Y1JIhvVs2qjV++Vxlu1tv7J/FqmSeHQnXXfSPfn9BJ3QMn/3UIwuZA+QhX +hIQ== X-Gm-Message-State: AOAM530mFhp7j88wMehd73sRm9jUhRxXV0Cd5zIPK+xenNjXYoGidY8P 6FOFKWWZn7v7wS4hbJeCMbzOkA== X-Google-Smtp-Source: ABdhPJxluqoKhGoaQ5Nzb/twHA1HowJf4YE6OPec4fU9XXSsaEQSW23fWGK3GkBG7MCd/T6c5phf8Q== X-Received: by 2002:a63:e343:: with SMTP id o3mr798626pgj.416.1624473696437; Wed, 23 Jun 2021 11:41:36 -0700 (PDT) Received: from localhost ([2620:15c:202:201:d440:232:5e25:41f4]) by smtp.gmail.com with UTF8SMTPSA id m2sm528262pgv.40.2021.06.23.11.41.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 11:41:36 -0700 (PDT) From: Matthias Kaehlcke To: Greg Kroah-Hartman , Alan Stern , Rob Herring , Frank Rowand , Mathias Nyman , Felipe Balbi Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Simek , Krzysztof Kozlowski , Peter Chen , Bastien Nocera , Stephen Boyd , Douglas Anderson , Ravi Chandra Sadineni , Matthias Kaehlcke , Rob Herring Subject: [PATCH v13 3/7] of/platform: Add stubs for of_platform_device_create/destroy() Date: Wed, 23 Jun 2021 11:41:19 -0700 Message-Id: <20210623114025.v13.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog In-Reply-To: <20210623184124.3504047-1-mka@chromium.org> References: <20210623184124.3504047-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_destroy() 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 Acked-by: Rob Herring --- Changes in v13: - none Changes in v12: - none Changes in v11: - none Changes in v10: - none Changes in v9: - added Rob's 'Acked-by' tag Changes in v8: - fixed C&P error in commit message 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,