From patchwork Fri May 4 13:51:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10380497 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 9BEF86038F for ; Fri, 4 May 2018 13:53:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A9812944D for ; Fri, 4 May 2018 13:53:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EC1D29455; Fri, 4 May 2018 13:53:55 +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 ECBA72944D for ; Fri, 4 May 2018 13:53:54 +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=I6r3awQQgVRePLDKVPm82S14hgylgBaHl/5Vdiztw9o=; b=cUuC3kRRVuofMR UPjSJYqbILR3fwsHCBtA9JRC+CIO+VSa/4ifX9d+zU1jpaT//3fCMDpgwu5d+kxOSeCf9V75T/1a6 pJ+2x2ZicW4UmXs/0ciYRza2mJPwVixk8Y1xcjPkOdS9RYw6BUJTBrHzilcHLDzuyXtWWz5IiKTXZ ZvaDnvMBugtKgqZkGLPsLCMmGOtQIaR48nW0K5BXB+ol+0tSGQy3+GofYa4D7o51cqGSzlvDY0f9x SNOgFFRcSCi4g4LWbu/lwbn47gM/UBcj8OLR4hiXl+zUks5YaHXAuh7qymzY6hFMdKPOhbd8kjdOF yEGSuES2PU7++xzVCdiw==; 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 1fEb9i-0007r5-6i; Fri, 04 May 2018 13:53:50 +0000 Received: from mail-eopbgr20129.outbound.protection.outlook.com ([40.107.2.129] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEb8i-0007LM-2m; Fri, 04 May 2018 13:52:49 +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; bh=CvqvyD6wDrF3miBWBTc4cFTAU7AWYJ0wvCNS9XD0awE=; b=VWEZ5jDaIckS16D4eJUMN59g0kVWDIG7/ZeWLEVfIdozAP2kdBxwWBqF/6rE5yba3XTphV894PTIejTBAdkudDSxKO2WTcL0Qd0yCJoof09k1Y+ja+S5opZ1F/YPIjrbrMZexkRsTuv2uaO3Vk2SR8M+2zBT6AVgH7K0kBoHUL8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from orc.pedanet (85.226.244.23) by AM4PR0202MB2769.eurprd02.prod.outlook.com (2603:10a6:200:8c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.735.16; Fri, 4 May 2018 13:52:35 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v2 01/26] drm/bridge: allow optionally specifying an owner .odev device Date: Fri, 4 May 2018 15:51:47 +0200 Message-Id: <20180504135212.26977-2-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180504135212.26977-1-peda@axentia.se> References: <20180504135212.26977-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: DB6PR0202CA0039.eurprd02.prod.outlook.com (2603:10a6:4:a5::25) To AM4PR0202MB2769.eurprd02.prod.outlook.com (2603:10a6:200:8c::19) 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:AM4PR0202MB2769; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2769; 3:H+5QNHtChiE3Syr/VsQsJ7T+wwyuJ5QohlsXYY+QZV+xBTbFHYNRtqW7AtcXWCc4pd+UXOmBTq+DZBhWv0z7jXOG96fWerrZxuEMFL8EZi7ulu+rk59C2fJ+IsJzDYNgTTDZRhFn3CU8j3g+Ae4reFs4vv5QKtPNqPlEOt6YlPPnYF/ls2BNng2O5DdVtPiZxMH65GSwvueWlP4skr8wHrAlVkbTxhPnsXf+9E5yVOYZoao0RsyAAWC0KHGqoUIx; 25:MLi72VILmD8eWm/3Qd2SiPJ+yXMzriVDRHXzvmG/DpzB+pcBHFtCFVNup7mxofyeEAifwvGwfBP4TUKZXkVMzvvaZ4DBLk+TMNuMyLZt5fUlWz7yKqRHg2X1Pv0gUYe5kKL9Lt3SJaX1dE+I5diD+Lg/XteqToO4Zc6hc3UY1NGkzPM8Dd6di39bVmHeiUBiuk92flsmk/tb5/axPTLVcSAO84+pMeX69Et8NaaaajR/Fh+JGfcKdJqaXQUIU9hr7GUbktxo8BJCFEOkaYBQw/t5RBFOh4NN7mz+ZEIKITqqRownWrFAPr9MYKHqbGhBuZiLhUTRh5m0PW6jO8g6lg==; 31:25CSF8RTfp8HpeqXKsHSO0E/RSG1OZPtT8b8PPH+U3o/sORFd0iamaTb4SRkyFevlotQwSL2d4XEMT8URhkfTw1YH20ycHJVFGcKA7OCrIl2gP/dawyKWCYWDzqZksHBwkGZjsdzWj9zOq+UnHDv36Aov4DHLxmrnhIm3vXaZNBFIyWnf3vriMx47ZGW3m+pCdyjRQmUlp4jT278F30uNeDuJVguaWR1bdgqGL4qrwc= X-MS-TrafficTypeDiagnostic: AM4PR0202MB2769: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(6072148)(201708071742011); SRVR:AM4PR0202MB2769; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0202MB2769; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2769; 4:pOwN7Mb9hIXBm6q1WdzZk9Mft52nRMHHUP3Y124bZ0+psNzaT+tvA0CarP6nMkHVWVFNvJJvfXvZWIW3WoSgI6F3kQzi+Lqs4Aysyg+4FjZDjRd3Z+BHmA/XvqVLPufD3ZhcB59C7iG8Xh6yaM1VWP0PfYmgCAm1cTdzBuCJoHp1b2qeWVSqI20IcABIQoRqGEFHA/FbMB6rCCuS1RcmxkoakH1qarGQZKGwrOEWb/MvjfdALDjZyrRd9KsIZeWYfVQABVOB2BwLTMZKlyDNsQ== X-Forefront-PRVS: 06628F7CA4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(39830400003)(39380400002)(376002)(346002)(396003)(199004)(189003)(52116002)(386003)(50466002)(305945005)(6506007)(54906003)(74482002)(316002)(68736007)(5660300001)(16586007)(6666003)(50226002)(7736002)(8936002)(81166006)(8676002)(97736004)(6916009)(1076002)(48376002)(2906002)(2351001)(2361001)(16526019)(81156014)(39060400002)(76176011)(4326008)(86362001)(6486002)(6116002)(3846002)(53936002)(106356001)(478600001)(11346002)(486006)(446003)(36756003)(25786009)(51416003)(476003)(7406005)(956004)(105586002)(2616005)(7416002)(66066001)(6512007)(59450400001)(186003)(26005)(47776003)(142923001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR0202MB2769; H:orc.pedanet; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0202MB2769; 23:9NXL9olYUqApj+BnplsHimEpYRk4Cgs6FLkuStm?= =?us-ascii?Q?yjwYVE7nzLhESrHUlVWSUv/6SAm3n2g1XD+F4idWURiGI5mHxCrbPFss1oua?= =?us-ascii?Q?rYaBg93t/la6X9ZjGqY7k8RffapT7augRTatY1t7uS/uxaB2qxyZZwzZqZ03?= =?us-ascii?Q?LGXtD7zhOOKipoF6e0qzLXYAwCia0EgtS0Y9ffCYs2l1hOeJ+D9qEJ2T+8Ke?= =?us-ascii?Q?vGtYQP2kroQxqDba4WyHdjNEzz2n7zca+7IYr0F0YLbJr6V15VJ3ADC2OWSu?= =?us-ascii?Q?T6hfrO771tjemVpENZCLjvl7t+ba5Eu5rZrjK42HONUOXcze6M4ZxPTFeTrF?= =?us-ascii?Q?ZcA36mc/hMjzcjvbl3DZx51ARCAM173+9b8EvhJ93BN51AxqnDr4s11WMWiR?= =?us-ascii?Q?5PtumYgFt+EZ/YXRkfXukABy1NRvaSpG/oFJdhfwfPb5aqfOXtibx+pddQE4?= =?us-ascii?Q?VsvCcMs3/KNK3kld8GaEspTzrojeOlsB/c/2dKZ5dTTD/gIF5fTvpwdALqaV?= =?us-ascii?Q?DVJK1yfDRSd94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ii?Q?U6Z5ZS/3tFQ=3D=3D?= X-Microsoft-Antispam-Message-Info: o/ZhVM16oFk4RNweJCvMN2k1QkTMOcStvmyQgjOvWlld5/+b8YkINTD1/kmqgu+pyzfkXend0c+SOyAR1KTTBr7REJTiecuASa04W8Ei9nY5wdnipaED2d3oTHc16vyEcClUlXqHV2ubDo+6YH+JSWcs25xVBYiRsEmzt4jZIjJhe5HQuCBGu000sLe4yHR/ X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2769; 6:cvVW4v8OcALSwvEe7X6hGmep6hl3sfxm/CjeC4D2MbJ5C51IMUL3koVPVQ1cXm8PJDSiId+8jCSC5tFF4/9LBaq026FY+qKddjB0j+vS3LDIpsylEieiakGAlcSWGUIzKk3u2/EDuTEqEeZ8T20Ckt60Gv8dXmbMrvLdyov0Dau7ltPySUYbsIqQE6d96cBLIEECJfnYAJZvAwrVPwPN+PER1d+s+C+/ggq9H0qcPl536vKjsq7LWIOP2x2WwUReO5Hfy7vFx4F8tGKc0uZl90H5+DexKiSkk6nsZxgpaeAk2/Bu0ZMh8SegWBuZQXtFr4LuJFOuGVYpntbVMxm3Ip8X3/Pr9g6Ips2WD/zFAgZv6GD55UvomGy2g8wymqIabGTDOOhjOEOC/XVtvVLKTGPjmoA5w9oqcjyXf6y8EyqKgtEiyHXSyMkdUETei5zDfqxBAQIkyf3OslisH8txDA==; 5:is/78EhGZkxsKmOZZ/FcleFkEXYXsD9gpHzyeZFXXOnGp5euzUGX30qH7JizDoc223718vv58FjIqFiAZ5CKp9yL8INWh8dr0zBCBh93unZrTLm/4kpXtCNeQYWn78z5NF/dMsBsX9Htg1W08Brfdc4On1/Fs//2nH5gtNrAfSc=; 24:zC+kjIuWPhW7MmB6AFP+rSR36/wMP78QKTYQMp9P+1EUK+oVB7S3a6aswSYiWqgecZvKfcEzK5nMd1rZMDvwFb0L2Gl8BYJYOZVIF7ooLDE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0202MB2769; 7:ENlR0cndxYH58G/K+YxSE0Z+UINtQWBo665A+1BPj7GK+rR/R/c6Y/PCbqaovxgm+ZTwiYq8RjDT5L+B3GeSAkbMJafIJr6ftfGb40V2xrtIWNnE3D7ogJoAa+38pDc+GpVtNCtobz+LlTF0bHKfdN0Trsz55KuVsXpgs977qit9hmcYgqZogrhkTYnrmnCxRYYOe4K7VYJaw30KMrjewTVLUSAPeeXgaTNJjD4Li2TrPlD3gJVKnzRA5pfxIV+A X-MS-Office365-Filtering-Correlation-Id: 61a3c41b-8970-46e0-a392-08d5b1c64be9 X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2018 13:52:35.5308 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61a3c41b-8970-46e0-a392-08d5b1c64be9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0202MB2769 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180504_065248_165765_DF535AF0 X-CRM114-Status: GOOD ( 14.73 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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 , Peter Senna Tschudin , 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-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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. Signed-off-by: Peter Rosin --- 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;