From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 418F8C433EF for ; Wed, 29 Sep 2021 14:30:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F0B361425 for ; Wed, 29 Sep 2021 14:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243639AbhI2Oce convert rfc822-to-8bit (ORCPT ); Wed, 29 Sep 2021 10:32:34 -0400 Received: from aposti.net ([89.234.176.197]:43458 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245167AbhI2Oce (ORCPT ); Wed, 29 Sep 2021 10:32:34 -0400 Date: Wed, 29 Sep 2021 15:30:31 +0100 From: Paul Cercueil Subject: Re: [PATCH v4 02/10] drm/ingenic: Add support for JZ4780 and HDMI output To: "H. Nikolaus Schaller" Cc: Rob Herring , Mark Rutland , Thomas Bogendoerfer , Geert Uytterhoeven , Kees Cook , "Eric W. Biederman" , Miquel Raynal , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Ezequiel Garcia , Harry Wentland , Sam Ravnborg , Maxime Ripard , Hans Verkuil , Liam Girdwood , Mark Brown , Paul Boddie , devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, Jonas Karlman , dri-devel@lists.freedesktop.org Message-Id: In-Reply-To: <17BF1D7A-2057-448B-9FD2-907DE0EFD281@goldelico.com> References: <68cca888be1894ce45f1a93cfabeb5aa1f88c20a.1632761067.git.hns@goldelico.com> <1E10A04A-4A78-4B47-B0FB-1E8C99456DA1@goldelico.com> <17BF1D7A-2057-448B-9FD2-907DE0EFD281@goldelico.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi, Le mar., sept. 28 2021 at 14:06:03 +0200, H. Nikolaus Schaller a écrit : > Hi Paul, > >> Am 28.09.2021 um 12:21 schrieb H. Nikolaus Schaller >> : >> >>>> @@ -1492,10 +1555,16 @@ static int ingenic_drm_init(void) >>>> { >>>> int err; >>>> + if (IS_ENABLED(CONFIG_DRM_INGENIC_DW_HDMI)) { >>>> + err = platform_driver_register(ingenic_dw_hdmi_driver_ptr); >>>> + if (err) >>>> + return err; >>>> + } >>> >>> I don't see why you need to register the ingenic-dw-hdmi driver >>> here. Just register it in the ingenic-dw-hdmi driver. >> >> Ok, I never though about this (as the code was not from me). We >> apparently just followed the IPU code pattern (learning by example). >> >> It indeed looks not necessary and would also avoid the >> ingenic_dw_hdmi_driver_ptr dependency. >> >> But: what is ingenic_ipu_driver_ptr then good for? >> It's done this way because ingenic-drm-drv.c and ingenic-ipu.c are both compiled within the same module ingenic-drm. I'm not sure this is still required, maybe ingenic-ipu.c can be its own module now. >> >> If we can get rid of this as well, we can drop patch 1/10 >> ("drm/ingenic: Fix drm_init error path if IPU was registered") >> completely. > > A quick test shows that it *is* required. At least if I configure > everything as modules. > But like you I can't explain why. Well, a quick test here shows that it is not required, at least when configuring with everything built-in. -Paul > Well, just a very rough idea (may be wrong): the bridge chain is not > like an i2c bus and > clients are not automatically loaded/probed if linked in the device > tree. Therefore the > consumer (ingenic_drm_drv) must register the "clients" like IPU and > HDMI. > > BR, > Nikolaus >