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: 10380639 X-Patchwork-Delegate: agross@codeaurora.org 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 D99576038F for ; Fri, 4 May 2018 14:06:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B833229472 for ; Fri, 4 May 2018 14:06:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC41829474; Fri, 4 May 2018 14:06:27 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D92E29472 for ; Fri, 4 May 2018 14:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751339AbeEDNwr (ORCPT ); Fri, 4 May 2018 09:52:47 -0400 Received: from mail-eopbgr20127.outbound.protection.outlook.com ([40.107.2.127]:53376 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750820AbeEDNwn (ORCPT ); Fri, 4 May 2018 09:52:43 -0400 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 Cc: Peter Rosin , Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Peter Senna Tschudin , Martin Donnelly , Martyn Welch , Gustavo Padovan , Maarten Lankhorst , Sean Paul , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Kukjin Kim , Krzysztof Kozlowski , CK Hu , Philipp Zabel , Matthias Brugger , Rob Clark , Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Benjamin Gaignard , Vincent Abriou , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Jyri Sarha , Daniel Vetter 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?DVJK1yfDRSd94AV7KjBiVdXn66/D5U+4FFWZx9FfEyXFNTOcYuAg3B5XeyI3?= =?us-ascii?Q?djpmwKUVWPo9ww6/q90XazI7EkivcwMdj3/oP5wtfTAB4u5nFaJuGwB+r5iX?= =?us-ascii?Q?yJBDP21pq1gWAq5c94WzCdSwBanQF7w2ue9DHLBiffV7cJ9kbKGt//crbXbh?= =?us-ascii?Q?5VAlvbCE7dkHB6uTHZiMirtkzp6mPX7RNBR/DUBEbTnHnEjtlRRyKOkAddqW?= =?us-ascii?Q?UYiYuEtP97OqadrDJklYdURIV2kU9rVicFNdXue4BBVoNNi9bR7m+GAhD639?= =?us-ascii?Q?Fm3jKfF9UjzhipRdFDb2cDTyoIn87DMry0txAroWsdNuUYSulUrlqGSoSOiU?= =?us-ascii?Q?aUcDsHr8VEAR2oK47LqoZEDG3LYb60KzUbdlXf2HMOeZ1i3ViuLCxThzESCx?= =?us-ascii?Q?T/hQw0GozR10XDmnxZZxO1tK5ewVNLY2MoB7yAZbXHnUFQMfIHlIYbj94Fae?= =?us-ascii?Q?Qk+eIMiuv72fROFM6PFnBhydEdZiiuSA3cW+hiiGaZ4vm//HjFEUfKDK7evD?= =?us-ascii?Q?hB6vv81lBYS8v4lnqb7s9Tj41vKwkj1XyiLevKC2uJWgZro2qlX5Ymsygppv?= =?us-ascii?Q?zALcJJpSkeCDWeHaowWHcz7PinGzSra7ZESqVUHqBDcHVmE+hFsqGiSQFXSS?= =?us-ascii?Q?j6sTxvMeeGwfTZAHerNgrY4b7WPEaPKfCTz5hbFyb+Z00NYGGRuasQWwo7+D?= =?us-ascii?Q?Nb4xOS+R9D+98ROZoxSrpiqOiH4A3WdihA986seaIWgxknbYNDPhh951uhRb?= =?us-ascii?Q?vcz6JysSLrQsDIcuU3NsWC8D7ZKCfqH2Hz4urajZ+7qTg0ghTCTNXWLqDb8+?= =?us-ascii?Q?l7YleTT2vsuoJHFAyNy3P/esQVIAqJiVl1qMynu/Uj6FkGk7ZC/NB6heJzbT?= =?us-ascii?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:cvV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fxIV+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 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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;