From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 6/8] drm: Allow DSI devices to be registered before the host registers. Date: Fri, 14 Jul 2017 15:58:43 -0700 Message-ID: <87vamu7hi4.fsf@eliezer.anholt.net> References: <20170627195839.3338-1-eric@anholt.net> <20170627195839.3338-7-eric@anholt.net> <6fbaa797-1040-48e8-c361-dad4363cd30d@codeaurora.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1783086332==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id 3CF0C6E8C2 for ; Fri, 14 Jul 2017 22:58:46 +0000 (UTC) In-Reply-To: <6fbaa797-1040-48e8-c361-dad4363cd30d@codeaurora.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Archit Taneja , dri-devel@lists.freedesktop.org, Andrzej Hajda , Laurent Pinchart , Thierry Reding Cc: Boris Brezillon , linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --===============1783086332== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Archit Taneja writes: > On 06/28/2017 01:28 AM, Eric Anholt wrote: >> When a mipi_dsi_host is registered, the DT is walked to find any child >> nodes with compatible strings. Those get registered as DSI devices, >> and most DSI panel drivers are mipi_dsi_drivers that attach to those nod= es. >>=20 >> There is one special case currently, the adv7533 bridge, where the >> bridge probes on I2C, and during the bridge attach step it looks up >> the mipi_dsi_host and registers the mipi_dsi_device (for its own stub >> mipi_dsi_driver). >>=20 >> For the Raspberry Pi panel, though, we also need to attach on I2C (our >> control bus), but don't have a bridge driver. The lack of a bridge's >> attach() step like adv7533 uses means that we aren't able to delay the >> mipi_dsi_device creation until the mipi_dsi_host is present. >>=20 >> To fix this, we extend mipi_dsi_device_register_full() to allow being >> called with a NULL host, which puts the device on a queue waiting for >> a host to appear. When a new host is registered, we fill in the host >> value and finish the device creation process. > > This is quite a nice idea. The only bothering thing is the info.of_node u= sage > varies between child nodes (mipi_dsi_devs) and non-child nodes (i2c contr= ol > bus). > > For DSI children expressed in DT, the of_node in info holds the DT node > corresponding to the DSI child itself. For non-DT ones, this patch assumes > that info.of_node stores the DSI host DT node. I think it should be okay = as > long as we mention the usage in a comment somewhere. The other option is = to > have a new info.host_node field to keep a track of the host DT node. I think maybe you misread the patch? We're using of_get_parent(dsi->dev.node), which came from info->node, to compare to host->dev->of_node(). --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAllpTKMACgkQtdYpNtH8 nuijYRAAk5vVfq6nOjMMbLSK23/66wXTG+nYuhwW+DhAuyi/HPeNtCb42LuQze8t CGCXnQKKPfusDw8fWY0620L4ioQ0BpFewakomlbE3czsY5BKUzrJAKwLw4paKU6z Qmxd1fv3LjlW/3wiAaawSoIrmqAlUNv7HA6QZo+Tpn5IMMiBGpuaaOfISngI7r4/ /k23lH51kFZ1dmqE2kMVt8IEv23KywhZBB//deRARMMSP3RJGie9jLUE2x0ZUyCQ LOVPtN3vKmMoUqEQRVuV49hGpMalf0QslkgeHGCzAWS+o45aYTcHM5FT0z//jdUz iebNRwHKazxs+7DXgJf0i5HyA5eF7D54oIW//qHTBHy+S9Xh6Np4/2rUf167O3ZS soGyNsGXQX7jiMZ48cwe46XgBB8jcATnxSsKbmWapcha4Ncbmp5eSgK8IXvt8T0A zuLx88UF+Ra177cGPVKmNdqwzyKlKK/6WiSNs2foXseV5c3oPLwCE20gg6Xf4FY6 MBwOCRwpIbc2LXtfph3iD4iQjw1V43rLMNiZ3IOqICSkSG7v/GCCLxygNQcQ4wK2 4fJadqr5o82HEvzMnpNkq941slc7h5hVKeUZTf0Cf3I3b/cfzm1y/CN6vMcV0Enr 62Y1/jPimqLCs0t6mlBcdhnqdVXDitUhLlg0ubvJPN5Rq41HGJ4= =KELX -----END PGP SIGNATURE----- --=-=-=-- --===============1783086332== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1783086332==--