From patchwork Wed May 16 10:14:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10403477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2633D601C8 for ; Wed, 16 May 2018 10:17:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 121E528863 for ; Wed, 16 May 2018 10:17:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05BA428867; Wed, 16 May 2018 10:17:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FBA728863 for ; Wed, 16 May 2018 10:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9jMi3wl+rZwVEFNlF9etoWNAlX2XBWJdQlz0ydrnYFA=; b=N5KF/l9efsagYi +2B970mDR3hAQq1xdVsIQ8Te8anKdwGmY0ud8XhMjxIVzV6BelJPYddkOrfSEajapu02lRPkxSb2a 1/SvX83K0SNb9XHth8lynZmvOenbAujPK+gnm9Z14pHvox/5SWUTnE2+6QzAc6EHsc8da0udpSg5L GwcwOsA3dvTLlZASvWfaFOmSJVaiIDf1bMZfxpb1krDphCWnDAyoVUa4u6QIwZJX2UdJj8oPWNUbx S/1OuAL0HraNcIoxefVfCBc3Yfqbk3UVt396KLAmfuBAt8gciWbcF7JGH72djWkQBiSgls1CCSiRm ZSX/FO7o3g4tZOSpnuoQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fItVB-0003v3-IZ; Wed, 16 May 2018 10:17:45 +0000 Received: from mail-he1eur01on0090.outbound.protection.outlook.com ([104.47.0.90] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fItTE-0002tR-6g; Wed, 16 May 2018 10:15:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eAqHveLBhg3gKuXdH/2foG9D2pIMvI20FTCGsTirHlo=; b=kFIeP5i9QqeECb9HXRe7zrNPxnuLruxziYKgPI/BtKEPH276tDKGqq4RX5t3p5A7EQxmPxqKbdZkXiLCLQk3v2Fd8RF4k0YGpJDlLHBMJnejAajWe1Cak0vq2zFkoodasMBvXm8A5lGoUXcLnbSQNv2Ce1gKvXkZQvofRhWDgZo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from orc.pedanet (85.226.244.23) by AM4PR0202MB2772.eurprd02.prod.outlook.com (2603:10a6:200:8c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Wed, 16 May 2018 10:15:27 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v3 01/26] drm/bridge: allow optionally specifying an owner .odev device Date: Wed, 16 May 2018 12:14:45 +0200 Message-Id: <20180516101510.13215-2-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180516101510.13215-1-peda@axentia.se> References: <20180516101510.13215-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR0102CA0013.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::26) To AM4PR0202MB2772.eurprd02.prod.outlook.com (2603:10a6:200:8c::22) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:AM4PR0202MB2772; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2772; 3:qJ8FhsPms+1FAxGebO8XyOXot2PhCD8g8jFL88JnPH2X26qg94S4gVhZY0Q1ehx7qmJl81u8LXkrEaTrTMRElhCF0Y3tXLl7R6zpRVgk18ZcSynp7VxJSMmLCjhh7GdrUevXvpFgxRnHMDOb9ln6K6GCbG+WgEIuWZPGuAnTNPYa5bC6xDOTzpHiglFlf1ppbpyfeljQL9J1uuFR6bKfF/2uqJ6fg/MLU5KX6fbSOHSA4fdUgwEObKyCjHRndLzu; 25:GbhjQX4cXpF8+RvjSOmtoquc9CDOiQZMcAwLX02UHhBldARq2eRwo8Dwc2JnSeAPfzI7KzNzlSe6RaasRw18ZteN2HzUbYUQU19CawTdqcQeL+XrLQSmA+vLflRhmFMNGPRQjtcrT6Qg/Nxs88ktFTy05nH13nDHoj92uuuZ3OBQYs+40K+kGv9orO9GLPNhw7bdjPngMEZc2YxxH4p3gPM95E2U5xXppRqqkyNb840fm7dTXeo2JlblvJcxN3HSi0ZDd9dpnM+9IOZndEFBjp9xXHb3iPhtvSho+nPUkKjuenomP/H+GXsXHo+PN9G9cPmofV7cgOhLR6xVEh00hA==; 31:fUUCCUMnJ7OevgBsKzIHsSySbwyyFRpuc3J0vNDdJWdLpmDYl44UuEKSYFqdL+bXT4BkgFp9hgMvLrH8Kp7pvFwe2fZGqyg9BmAW8Fqc/uRs1jONeRQ+IJmmciHN4TpwXtQ1pm/zyQ3wmEjRA3iISYEmk2izzNGkJLQG+CsAlJbdPmr6w+uy9JjNRYWVDASE0V4+gFkAgm0s/v2EwX1MM63YTdDe8QK+Yy7A8kIWDnM= X-MS-TrafficTypeDiagnostic: AM4PR0202MB2772: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(7411616537696); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(6043046)(201708071742011); SRVR:AM4PR0202MB2772; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0202MB2772; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2772; 4:bscQNTTaRZeYmn7gIR0bJik3H+jmcVanXB19IpZXWyqrwUe4rwFwLvdyyjzHFS3EZ/KUoU+MUYxXLZLH3rV3BYEotuoAguAZfRpR1Nl0K1Y4XzTunI5YsroFSTNU5n1Ov/VxbzzdjAmr5QJI3O4cVzfQESstpTY6Gj4mFsPzpszTDpcYBtZC/TPs3ezEl/ohaAboRSLq8FKnmSMUkjeeJXmWJ6cbCbekwTh4tdUjvlSkhbToEjNm64C880xPEysuj8rK6YS2ZjwgSlZ40It930LHOABao7bTuwrSuL+ruMN9XKGMBMTWoUQCZJV799XW X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39380400002)(39830400003)(396003)(346002)(376002)(366004)(189003)(199004)(86362001)(7416002)(25786009)(48376002)(50466002)(68736007)(36756003)(2906002)(105586002)(97736004)(6666003)(6916009)(74482002)(7406005)(2351001)(3846002)(6116002)(1076002)(478600001)(106356001)(316002)(16586007)(2361001)(7736002)(50226002)(53936002)(6512007)(305945005)(51416003)(8936002)(52116002)(8676002)(16526019)(76176011)(446003)(66066001)(5660300001)(39060400002)(54906003)(47776003)(81156014)(476003)(2616005)(956004)(81166006)(186003)(386003)(6506007)(26005)(59450400001)(4326008)(11346002)(486006)(6486002)(142923001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR0202MB2772; H:orc.pedanet; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0202MB2772; 23:M9oExva3nM9RGpXAEuEpnV2cvnw0M4vTfDK99LU?= =?us-ascii?Q?R0CnFjEniuN7iyO5hsV8ZBon4pO+1ROkLV8KM+Prb+eKn927ZpwB4qhfZUoq?= =?us-ascii?Q?wJ8kz5nV0MlSS20qIkpGodZN65umMcD0mQwsuCD1l3qHIlkfvXsFs6zpiYmD?= =?us-ascii?Q?Fe9N573oiXp+Vg2CsIBunlbn+kjv9JVkfO8rhzFnXzMlW18rFIs39BlKVThx?= =?us-ascii?Q?jRDce2W3e7raeeNJsGsKmqnGaHwnSiecLj1fh/wcLiHoD2k6Ya0auBXCBZYM?= =?us-ascii?Q?FSdfHH5Nqb8JvvrtHRrwBr+Tsk/mtetC8VMMOLJF33FOlumV4Fw7fZ+g3Zte?= =?us-ascii?Q?Yi9VbO3AELg0EnlS35WSlw5QGWZWUkKB2EDqdtAfrkckxb5ox8Fvwe/9vd2E?= =?us-ascii?Q?mSfwsvcOu7E8gKMWQv9whIfUIUJvS6Hyqebs6OlO+zcmQ41CwOftyMslGCOy?= =?us-ascii?Q?duC9z83EVUu73sfmjuPYqEm7+hwdy9f0eBF+4EhcHgup8hnpz1o8cKFzybBY?= =?us-ascii?Q?2475Xq+rRge9XBwUunfrHSqMfhx6F1cVzU7J/cYstQWZ3bC7dPc24p/HDiP7?= =?us-ascii?Q?TNw9bIFlASS2LobtV/1CUGiFgDWXmgTin7skXDMfMGnnnhgmKDFPEg6gSytj?= =?us-ascii?Q?S9M84Y+rkAqWMhpIL8TugWZG8alW5XR/33LmWwuOEBW6BHV6VUp0DDcKoE7e?= =?us-ascii?Q?/liz8adcFWeuDT2jZlqv473w3rCaadMFGw9eNylL7Wb9zn2UzIJlXlveGY/z?= =?us-ascii?Q?7liZhTeIZAbaeWoofDGhy/hyWY1drLYa539mFUSzSsFPDAkp74giWbj98w/H?= =?us-ascii?Q?q5/4pHa26nbG+ZFGKC0ixY3t3YNMAX6/siDNHb4PPKr1ijWu0v3WCpYYZCdw?= =?us-ascii?Q?sgFwV3SNZ7fcZKPdbqva4trhA+STlQE1yrNYjsKLCdUa8cGuHIo8O+os9nGc?= =?us-ascii?Q?AlA1IiCKSELjqtYSA07kEfrwZu3KmJkM+7wH07zsaB4b19nH9gW4pLq4X11w?= =?us-ascii?Q?btD08qmpP8A9vgJLtEARPdcStDD7LPYGJdz60SXDsEzADuE6QUOLyR5S44Af?= =?us-ascii?Q?KOuuynX0e98Nm3ct65pbYUpv6ytEoT8/bezvuJT+GoduNG9C601+WW6N+5E0?= =?us-ascii?Q?KZ/ad5OdgHn9yz7SSyil8dDd9BMXnDtUycaBs1+DvLtnS4/ne8CQU9s+57GZ?= =?us-ascii?Q?F1TiWF7cTH28P+3jr66XTiuIxktff6+C9X400vVXi+3d9bLQd6RnRSKAu06T?= =?us-ascii?Q?/a24BcDYEI7pHSNZYPIo1odgsjk3EzHcF4hP3yA3nUOsyX1GBxSe5kPZIRCb?= =?us-ascii?Q?n4IEvcwx0uARXTY1vNAf+WO3ouQXCC5Ou83zmNpw4ymo7xwOkgZv1a+J/roN?= =?us-asc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/Q3nhOdX6dDYtyUqP1Gzb7WqtI6r4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2772; 7:wXuFDBw7DDp7chdOaDrgZhxGndPVHswBABIA4/jRCdbO12tSp7SZE1F9FGZdC33Va0VPdrJ4BEpwUB+WJP448g46ZqzQDspLLZ3ij0Sgj37kwpwGE3MyRkb7aDW9aXoVY3P5sVoaeyBnHZgt6OyVgf0ed9gfqu36tM33DVjpKjVi3hMbR/ZevzGfIeiUJM/7SXS/Y5iak4nsil24rtSKRuZEIAeLfvZdCyKGCK/WJSEGHziWrMztkqXMPbnkVKJh X-MS-Office365-Filtering-Correlation-Id: 026c54d3-cb4d-4bce-a6ed-08d5bb15f39c X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 10:15:27.7923 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 026c54d3-cb4d-4bce-a6ed-08d5bb15f39c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0202MB2772 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180516_031544_313326_E3E12E57 X-CRM114-Status: GOOD ( 16.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martyn Welch , David Airlie , Gustavo Padovan , dri-devel@lists.freedesktop.org, Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Archit Taneja , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Kyungmin Park , Krzysztof Kozlowski , linux-rockchip@lists.infradead.org, Kukjin Kim , CK Hu , Martin Donnelly , Daniel Vetter , linux-arm-msm@vger.kernel.org, Maarten Lankhorst , Jyri Sarha , Inki Dae , Sean Paul , Matthias Brugger , Vincent Abriou , linux-arm-kernel@lists.infradead.org, Seung-Woo Kim , Sandy Huang , linux-renesas-soc@vger.kernel.org, Rob Clark , Philipp Zabel , linux-mediatek@lists.infradead.org, freedreno@lists.freedesktop.org, Peter Rosin Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Bridge drivers can now (temporarily, in a transition phase) select if they want to provide a full owner device or keep just providing an of_node. By providing a full owner device, the bridge drivers no longer need to provide an of_node since that node is available via the owner device. When all bridge drivers provide an owner device, that will become mandatory and the .of_node member will be removed. There is an interaction with the rockchip lvds driver, since that driver peeks into somewhat private parts of the bridge struct in order to find out things about the remote bridge. When there are now two ways to get to the remote bridge, the rockchip lvds driver has to adapt. That said, the correct thing to do for the rockchip lvds driver is to use some other way than DT to find things out about the remote bridge, but that is orthogonal to this patch. Reviewed-by: Andrzej Hajda Acked-by: Daniel Vetter Signed-off-by: Peter Rosin Acked-by: Heiko Stuebner --- drivers/gpu/drm/drm_bridge.c | 3 ++- drivers/gpu/drm/rockchip/rockchip_lvds.c | 4 +++- include/drm/drm_bridge.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 1638bfe9627c..3872f5379998 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -365,7 +365,8 @@ struct drm_bridge *of_drm_find_bridge(struct device_node *np) mutex_lock(&bridge_lock); list_for_each_entry(bridge, &bridge_list, list) { - if (bridge->of_node == np) { + if ((bridge->odev && bridge->odev->of_node == np) || + bridge->of_node == np) { mutex_unlock(&bridge_lock); return bridge; } diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 4bd94b167d2c..557e0079c98d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -377,8 +377,10 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master, } if (lvds->panel) remote = lvds->panel->dev->of_node; - else + else if (lvds->bridge->of_node) remote = lvds->bridge->of_node; + else + remote = lvds->bridge->odev->of_node; if (of_property_read_string(dev->of_node, "rockchip,output", &name)) /* default set it as output rgb */ lvds->output = DISPLAY_OUTPUT_RGB; diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 3270fec46979..7c17977c3537 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -254,6 +254,7 @@ struct drm_bridge_timings { /** * struct drm_bridge - central DRM bridge control structure + * @odev: device that owns the bridge * @dev: DRM device this bridge belongs to * @encoder: encoder to which this bridge is connected * @next: the next bridge in the encoder chain @@ -265,6 +266,7 @@ struct drm_bridge_timings { * @driver_private: pointer to the bridge driver's internal context */ struct drm_bridge { + struct device *odev; struct drm_device *dev; struct drm_encoder *encoder; struct drm_bridge *next;