From patchwork Thu Jun 27 15:18:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Redfearn X-Patchwork-Id: 11019859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8733314BB for ; Thu, 27 Jun 2019 15:18:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 797DB28B3C for ; Thu, 27 Jun 2019 15:18:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D8D428BD7; Thu, 27 Jun 2019 15:18:13 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D1CD28BD4 for ; Thu, 27 Jun 2019 15:18:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D59C66E4F4; Thu, 27 Jun 2019 15:18:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from rfout1.hes.trendmicro.com (rfout1.hes.trendmicro.com [54.193.4.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id D59CC6E4F4 for ; Thu, 27 Jun 2019 15:18:07 +0000 (UTC) Received: from 0.0.0.0_hes.trendmicro.com (unknown [10.64.14.197]) by rfout1.hes.trendmicro.com (Postfix) with ESMTPS id 9F6871126363 for ; Thu, 27 Jun 2019 15:18:07 +0000 (UTC) Received: from 0.0.0.0_hes.trendmicro.com (unknown [10.64.10.30]) by rout1.hes.trendmicro.com (Postfix) with SMTP id 0CD9FEFC080; Thu, 27 Jun 2019 15:18:07 +0000 (UTC) Received: from IND01-MA1-obe.outbound.protection.outlook.com (unknown [104.47.100.52]) by relay1.hes.trendmicro.com (TrendMicro Hosted Email Security) with ESMTPS id 678F4AFA018; Thu, 27 Jun 2019 15:18:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=testarcselector01; d=microsoft.com; cv=none; b=H9GT1ItdO636RMkqpwHFDYeMQxYbHfDsOlTRQmZN6KdoxlN1qti1zddwCFHfAJcjuFibmrKOwOaNzqgcLdsERhNEzJfiQES8UynvF6Oc2C4TgiQU+dLdf7UAQiZ67EF+RG3oJH8DFqgHEjPlu9ACV+kHTgmSDsZ95DDrbLbjCdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=testarcselector01; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tZY/k8UR77eYZU6JIYfLuzj484cpYuiXBWFLAl4Ce6I=; b=jgeuFBsK+kfgOyI0y+4kk+bDUfrlWXad1JNTYUpqEwIYr5yUaDGZxLv/fULeV8BzG8wreZ6/xdZnw3YDZHpN0SqW6T8Wwj/m8bgiHVCwJPFKDqSOQNMJ03vB7SvAs+aXN/WjBh5r5fi6VjKM+iq6nmvWu+OUCX4RN/viGfDGVKM= ARC-Authentication-Results: i=1; test.office365.com 1;spf=none;dmarc=none;dkim=none;arc=none Received: from BMXPR01MB0759.INDPRD01.PROD.OUTLOOK.COM (10.174.217.139) by BMXPR01MB3030.INDPRD01.PROD.OUTLOOK.COM (52.133.134.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Thu, 27 Jun 2019 15:18:00 +0000 Received: from BMXPR01MB0759.INDPRD01.PROD.OUTLOOK.COM ([fe80::9bc:4b68:1344:f1ce]) by BMXPR01MB0759.INDPRD01.PROD.OUTLOOK.COM ([fe80::9bc:4b68:1344:f1ce%7]) with mapi id 15.20.2008.018; Thu, 27 Jun 2019 15:18:00 +0000 From: Matt Redfearn To: Archit Taneja , Andrzej Hajda , Laurent Pinchart , Neil Armstrong , Jonas Karlman , Jernej Skrabec , Thierry Reding Subject: [PATCH v2] drm/bridge: adv7511: Attach to DSI host at probe time Thread-Topic: [PATCH v2] drm/bridge: adv7511: Attach to DSI host at probe time Thread-Index: AQHVLPuBf6e2UB9VrkOb0fCrDf7+Wg== Date: Thu, 27 Jun 2019 15:18:00 +0000 Message-ID: <20190627151740.2277-1-matt.redfearn@thinci.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0446.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::26) To BMXPR01MB0759.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:13::11) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [87.242.198.86] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 07a2561c-f303-4854-261a-08d6fb12a425 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BMXPR01MB3030; x-ms-traffictypediagnostic: BMXPR01MB3030: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 008184426E x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400004)(136003)(346002)(376002)(396003)(366004)(189003)(199004)(66066001)(4326008)(71190400001)(71200400001)(25786009)(305945005)(186003)(54906003)(81166006)(8936002)(6506007)(66556008)(386003)(1076003)(64756008)(66476007)(8676002)(478600001)(68736007)(50226002)(81156014)(26005)(66446008)(52116002)(2616005)(486006)(476003)(5660300002)(73956011)(66946007)(6512007)(7736002)(53936002)(3846002)(110136005)(5024004)(36756003)(102836004)(14444005)(6116002)(6436002)(256004)(99286004)(2906002)(6486002)(316002)(7416002)(14454004); DIR:OUT; SFP:1102; SCL:1; SRVR:BMXPR01MB3030; H:BMXPR01MB0759.INDPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: thinci.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: axy6Oh24s/HWfx1tjHD84Ge8x/lhsq/Si8VC+o1eLwLyXWW12pBPzjDJXDMsfVPD+SyWq4vK496ZNHQOqzoPeO/wDOhoIdKH2FkXIM8Ysllzy4gJcrPzHpVSMOQgzsiqCVo6xSJo6yTyrlV/dc8ojCZfJ2kFFT9J1KoAVudmzPQG0Xi0KdBqamPqT8a11u/QZPUEtjiPSSM+50LHG0IUwG9CNjALuryTk1NWhfUQLYVIEXg+yBNiJfkXkCYYlfsI9xAvdkL40+ZN34lXB0nKYxNp3Y+emdO9hNLM/V7xa336WLPTCyWaZWomZJUye1HkGbbDa3Iku7C05sI0ZibrI1aW/vDOlShogovYS9YXabuM3c9XHL61YnKFhc2zUa58PHX4CO5yFvQRnIRN5SXyhI02YZGuZhmh1WKCSb/K9K4= MIME-Version: 1.0 X-OriginatorOrg: thinci.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07a2561c-f303-4854-261a-08d6fb12a425 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2019 15:18:00.3296 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9d1c3c89-8615-4064-88a7-bb1a8537c779 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: matthew.redfearn@thinci.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BMXPR01MB3030 X-TMASE-Version: StarCloud-1.3-8.2.1013-24722.000 X-TMASE-Result: 10--2.485800-4.000000 X-TMASE-MatchedRID: zQoDEar/LDjabBVcqlDcF0OLK43kW8U2XGjQf7uckKtSMUnCl2ZytCAC Ytpe6t5bLU30xMI04OOpQXNdjc3qgVdXhVJKmheRB89GKHo03nY5lSSSzBNFmPkuQv9PIVnNCuo xZM5aA8MRsDs7NFENSPFzX2yG+axfgJawayKJkD8sWKt1qrD4oUtc8DbogbSE31GU/N5W5BB4pq O87q5acOFHPH5lCktzviTqhu0vM00DB9NQYvNufm6HurDH4PpPc8WBPuRcugDJZP0jINAqUKPFj JEFr+olUkOfGeXobzQ1NebtJxIilNLvsKjhs0ldC24oEZ6SpSmb4wHqRpnaDrT7TEI5CSZDM7Ky rst+Onx+mRD0to5VPYTzHHaGd4K9M8+iDpAkUYPTpamMhVjlNOxKrs7JVGG2hkIeTok3OE3HJde LBZpAwANZw39tzKOjg1QYrp1kjWz/pvgJGwohuvlyhYNumVjFZyMWcibO/JI= X-TM-Deliver-Signature: 54BDCC41FEC3250CB5E933A2685106EF X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thinciit.onmicrosoft.com; s=selector2-thinciit-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tZY/k8UR77eYZU6JIYfLuzj484cpYuiXBWFLAl4Ce6I=; b=iaICKttnQsxBX4qnHZCiZi3n/e6VZAcZ5TCoKdR7Vga26AKzRnUe/mcW9euFGIPqTeHsHjaRMscnFlGgXf3PrOqFVDicUGBQZowwQWu0svaF+tlrF9oseA6yIn2iIX9ujZ9RmDbGJT7Nhiy7Fcj8GYO7IaVyFnkinknt9yVImu0= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matthew.redfearn@thinci.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , "linux-kernel@vger.kernel.org" , Matthew Redfearn , Sean Paul , "dri-devel@lists.freedesktop.org" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In contrast to all of the DSI panel drivers in drivers/gpu/drm/panel which attach to the DSI host via mipi_dsi_attach() at probe time, the ADV7533 bridge device does not. Instead it defers this to the point that the upstream device connects to its bridge via drm_bridge_attach(). The generic Synopsys MIPI DSI host driver does not register it's own drm_bridge until the MIPI DSI has attached. But it does not call drm_bridge_attach() on the downstream device until the upstream device has attached. This leads to a chicken and the egg failure and the DRM pipeline does not complete. Since all other mipi_dsi_device drivers call mipi_dsi_attach() in probe(), make the adv7533 mipi_dsi_device do the same. This ensures that the Synopsys MIPI DSI host registers it's bridge such that it is available for the upstream device to connect to. Signed-off-by: Matt Redfearn --- Changes in v2: Cleanup if adv7533_attach_dsi fails. drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index e7ddd3e3db9..807827bd910 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -874,9 +874,6 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) &adv7511_connector_helper_funcs); drm_connector_attach_encoder(&adv->connector, bridge->encoder); - if (adv->type == ADV7533) - ret = adv7533_attach_dsi(adv); - if (adv->i2c_main->irq) regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), ADV7511_INT0_HPD); @@ -1222,8 +1219,17 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) drm_bridge_add(&adv7511->bridge); adv7511_audio_init(dev, adv7511); + + if (adv7511->type == ADV7533) { + ret = adv7533_attach_dsi(adv7511); + if (ret) + goto err_remove_bridge; + } + return 0; +err_remove_bridge: + drm_bridge_remove(&adv7511->bridge); err_unregister_cec: i2c_unregister_device(adv7511->i2c_cec); if (adv7511->cec_clk)