From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 733F3606A31C for ; Fri, 30 Oct 2026 18:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EcEcuRRu; dkim=pass (2048-bit key, unprotected) header.d=sntech.de header.i=@sntech.de header.a=rsa-sha256 header.s=gloria202408 header.b=jCwZPf+Y DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=9gfQkCnTfkug6p4HXHCVXaX3Q+suBlhnBegGYXjv1IY=; b=EcEcuRRugM+aY+1UOkMelrh/KE ktVA8BbbrfOZVS84N2PGGU1idMLMLnjJWWxJ6Vgkt1TjiI3h0z43l67iM4Wrd20KaY4Q2huoqsBss StoXs1xl39e5IKpeOUo94oBPEbuz1m+V4+k89m9vQhGIU7SfpnwgwKahQXNH16EgsEQmK6IpDXeB5 7awcpnNCAEBSvGIlUchksngpBMzlYcdo9kDDBFGa9jlptj9b8i+qKMam1f0n4+UwpTm9u2hipQ02u OSBgmmajpkWG3OlVuaoU6pk1C3KnWQX1Snx7bLPGm5KmiR0agj2xhrDHpKIfK+0d/Ed4MptNdvrmU /2GycvMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMqvU-0000000CLOz-3YsO; Fri, 30 Oct 2026 18:02:04 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMqvR-0000000CLOB-0llM; Fri, 30 Oct 2026 18:02:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sntech.de; s=gloria202408; h=Content-Type:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Reply-To; bh=9gfQkCnTfkug6p4HXHCVXaX3Q+suBlhnBegGYXjv1IY=; b=jCwZPf+YIAUctffkKF7pw1WOTQ CqyoI3bprXm02g6eVWMZAP2o9CQVig+ZDJuoNwBP1DxIkVbxMu2P/p4tXuxMKYc4Ct92k59PUjQcu p9M0fxe+NKOPyBTiu4qZ2BMXCD5QeYqAOL4k5RyLDO01SzgGowPpWRasZrVz0wa/3JwDJ69OQ5HjO 4UM6+54lKVKYP6PTNYFyIhj0lDGZ7WeJFcJ+JWU2yRWfB/ufDvxDvH0vcmrgyj7hjhi7+KK0AishG 9nt0DMnXu14dtZMGcnL5n4WhtagwmsKlCTgUsCSliSuChpiCIPJYQEQsCDmoc4yHiNsX+FkeeXrRO 6c6ajRIw==; From: Heiko Stuebner To: Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Andrzej Hajda , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , Emil Renner Berthing , Hal Feng , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Dominique Belhachemi , Andy Yan , David Airlie , Simona Vetter , Yakir Yang , Dmitry Baryshkov , Michal Wilczynski , Conor Dooley , William Qiu , Xingyu Wu , Sandy Huang , Manivannan Sadhasivam , Michal Wilczynski Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, Marek Szyprowski , Maud Spierings , Graham Markall , Icenowy Zheng , Chaoyi Chen , Joshua Peisach , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Byron Stanoszek , OOHehir Subject: Re: [PATCH v6 09/18] drm/bridge: inno-hdmi: Allow the register map to come from a parent Date: Fri, 30 Oct 2026 19:01:08 +0100 Message-ID: <3194397.687JKscXgg@phil> In-Reply-To: <20261029-jh7110-clean-send-v6-9-759594e43acf@samsung.com> References: <20261029-jh7110-clean-send-v6-0-759594e43acf@samsung.com> <20261029-jh7110-clean-send-v6-9-759594e43acf@samsung.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261030_110201_230905_817BE213 X-CRM114-Status: GOOD ( 23.76 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Am Donnerstag, 29. Oktober 2026, 08:53:43 Mitteleurop=C3=A4ische Normalzeit= schrieb Michal Wilczynski: > On some SoCs the HDMI controller does not own its register window. The > StarFive JH7110 documents one 64 KB block, u0_hdmitx, that holds both > the controller and the PHY, so the parent device maps it and owns the > regmap while the two children share it. >=20 > Use a regmap supplied by the parent device when there is one, and keep > mapping our own resource when there is not, so platforms that own their > register window are unaffected. >=20 > Reviewed-by: Joshua Peisach > Tested-by: Byron Stanoszek > Tested-by: OOHehir > Signed-off-by: Michal Wilczynski > --- > drivers/gpu/drm/bridge/inno-hdmi.c | 31 ++++++++++++++++++++++++++++--- > 1 file changed, 28 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/= inno-hdmi.c > index 222f6522844ee60ae9a07ab2dcca748dbf7403e4..a8905bf627a224d7e39185141= 95f1810164dc26f 100644 > --- a/drivers/gpu/drm/bridge/inno-hdmi.c > +++ b/drivers/gpu/drm/bridge/inno-hdmi.c > @@ -397,6 +397,7 @@ struct inno_hdmi { > struct clk *pclk; > struct clk *refclk; > void __iomem *regs; > + struct regmap *regmap; > struct regmap *grf; > =20 > struct inno_hdmi_i2c *i2c; > @@ -470,11 +471,25 @@ static int inno_hdmi_find_phy_config(struct inno_hd= mi *hdmi, > =20 > static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset) > { > + u32 val; > + > + if (hdmi->regmap) { > + if (regmap_read(hdmi->regmap, offset * 4, &val)) > + return 0; > + > + return val; > + } > + > return readl_relaxed(hdmi->regs + (offset) * 0x04); > } > =20 > static inline void hdmi_writeb(struct inno_hdmi *hdmi, u16 offset, u32 v= al) > { > + if (hdmi->regmap) { > + regmap_write(hdmi->regmap, offset * 4, val); > + return; > + } > + > writel_relaxed(val, hdmi->regs + (offset) * 0x04); > } > =20 > @@ -1101,9 +1116,19 @@ struct inno_hdmi *inno_hdmi_probe(struct platform_= device *pdev, > hdmi->dev =3D dev; > hdmi->plat_data =3D plat_data; > =20 > - hdmi->regs =3D devm_platform_ioremap_resource(pdev, 0); > - if (IS_ERR(hdmi->regs)) > - return ERR_CAST(hdmi->regs); > + /* > + * On platforms where the controller shares a register space with > + * other blocks, the parent owns the regmap. Fall back to mapping > + * our own resource where it does not. > + */ > + if (dev->parent) > + hdmi->regmap =3D dev_get_regmap(dev->parent, NULL); > + > + if (!hdmi->regmap) { > + hdmi->regs =3D devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(hdmi->regs)) > + return ERR_CAST(hdmi->regs); > + } why can't you just also use a mmio regmap here? Because with this change the driver now has 2 competing register interfaces and you need those conditionals all the time. Just convert the existing user to also use a regmap please. Heiko