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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD0DBC433FE for ; Mon, 28 Nov 2022 07:02:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 80FCF8510E; Mon, 28 Nov 2022 08:02:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="Fk3bsj7V"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="U9CdtZIZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56DCE851DF; Mon, 28 Nov 2022 08:02:37 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9F929851DC for ; Mon, 28 Nov 2022 08:02:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DCAE15C00F0; Mon, 28 Nov 2022 02:02:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 28 Nov 2022 02:02:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669618952; x=1669705352; bh=Kl 6SUC4O35A2vbi51dI1fY1eh/X3tlancyHBg1mgMio=; b=Fk3bsj7Vp2rhAdc5Hr nDs6DS8sRmamUOR0c1tcDVcStqaoTRMF3STzRvYi6Q9+7AzKVA9r2uf2mHL70S8u TtBoT/hY2vfuw/Jd5ji/QWOl13Xn1Jw6lpUyNbyQ6OsPNAS5syAhaWABkxk1lsb0 uQmlyKpFMoW8g7z2Ng+wgBiCVVCrwe+cbvzrBRNrXUCOF9dMHVvk8/BbWSjgNs3f Fb8zmy/daMAOVCxO0XVnkAsKGp5ZZLXeSNdNj+2Jg2XPHp/kOqRU5QqphqW217/S rQjMfmGbr1c5WGPiaH1L+yWIqqvcs+Irj5H6ML0YJW+YJtlVY5Q51iJp1DF22uYA jWfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1669618952; x=1669705352; bh=Kl6SUC4O35A2v bi51dI1fY1eh/X3tlancyHBg1mgMio=; b=U9CdtZIZoGjvGcdGeD4n2YY6bNF5x TPBQRV5m9n6pW+gusC7sjtNU+eOZSNiu6O5dRT4A3n6QR40wpmcRhXhln9i67K+m KdGI+nPeEfIm1QMS8SGjfr+sx+I7/NDsBguwk3l7TtrGIoRLqHpJ1cQ2dQfpTBMh uEl3atFvKRUv9IxIyEe3qN9PRnhoEG1bh+JEhHFY4Wz8+5E2kxw1lNERkudC16D6 VEcKQ5dkMMDeXI6ZXyIp6t0hsRmFatRCCMOr6HLmVnht4Of0TfEJjDNUZ8anKI+Q HcSrbJAOIXdNSBybtbLU+dzFkMJSoGwcGOdsKXncFfvaJswnh63Z/rsBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedugddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Nov 2022 02:02:32 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jernej Skrabec , Anatolij Gustschin Cc: Samuel Holland , Jagan Teki , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de Subject: [PATCH 2/5] video: sunxi: dw-hdmi: Probe driver by compatible Date: Mon, 28 Nov 2022 01:02:25 -0600 Message-Id: <20221128070229.4394-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221128070229.4394-1-samuel@sholland.org> References: <20221128070229.4394-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Jernej Skrabec Currently the sunxi dw-hdmi driver is probed unconditionally, even if there is no such device. Switch the driver to probing via a compatible string. This brings many benefits; the driver is only probed when needed, and now it can read the DT node. Signed-off-by: Jernej Skrabec Signed-off-by: Samuel Holland --- drivers/video/sunxi/sunxi_dw_hdmi.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index 19ed80b48a4..e7265af7d8f 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -370,14 +370,16 @@ static const struct dm_display_ops sunxi_dw_hdmi_ops = { .mode_valid = sunxi_dw_hdmi_mode_valid, }; -U_BOOT_DRIVER(sunxi_dw_hdmi) = { - .name = "sunxi_dw_hdmi", - .id = UCLASS_DISPLAY, - .ops = &sunxi_dw_hdmi_ops, - .probe = sunxi_dw_hdmi_probe, - .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), +static const struct udevice_id sunxi_dw_hdmi_ids[] = { + { .compatible = "allwinner,sun8i-a83t-dw-hdmi" }, + { } }; -U_BOOT_DRVINFO(sunxi_dw_hdmi) = { - .name = "sunxi_dw_hdmi" +U_BOOT_DRIVER(sunxi_dw_hdmi) = { + .name = "sunxi_dw_hdmi", + .id = UCLASS_DISPLAY, + .of_match = sunxi_dw_hdmi_ids, + .probe = sunxi_dw_hdmi_probe, + .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), + .ops = &sunxi_dw_hdmi_ops, }; -- 2.37.4