From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cstnet.cn (smtp25.cstnet.cn [159.226.251.25]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 529C252CCE9; Tue, 29 Sep 2026 15:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790694341; cv=none; b=GN5TzEjR0+iMssJolCd1Xd+ddU/nng5yw77zCaoNnO48DqE07jGazvz6mMKw8YKLI2ZJtD0ElUtD4m0wWj6OeRIT03kXQDysExygL/ktVl+G0Zz/gSRfI3teR3gQvnKg03HDiL/+ISr2z3r87tPshgubKIX4a6Bn88zRMth0GL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790694341; c=relaxed/simple; bh=NEqCnvwaAH2A7xBZN8mcKI2FnVTZaOONAq1aJbd4V8c=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=lOL6rRJ3alJYaIlMqXCnr5PdYoIf6tlZwhKcD7100r6XEIRnqBN4TJPBZNe53ahV+CB1p/sPTjHafoz3LZjm26OVMrm9a4wNJlVJmg0y5NLni98ZufvV7ylAdyKCbmLmqOGc2qaB/UR1hXBW7pTHfh+C2KBlMQt1jDE4l/updPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from edelgard.fodlan.icenowy.me (unknown [112.94.101.54]) by APP-05 (Coremail) with SMTP id zQCowAD3YTyZ07tqyZevCQ--.6680S2; Tue, 29 Sep 2026 23:04:59 +0800 (CST) Message-ID: Subject: Re: [PATCH v4 12/20] soc: starfive: Add jh7110-hdmi-subsystem driver From: Icenowy Zheng To: Michal Wilczynski , Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrzej Hajda , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lee Jones , Andy Yan , Philipp Zabel , Emil Renner Berthing , Hal Feng , Michael Turquette , Stephen Boyd , Heiko Stuebner , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Dominique Belhachemi , Brian Masney , Jerome Brunet Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mfd@lists.linux.dev, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, Marek Szyprowski , Maud Spierings , Graham Markall , Chaoyi Chen , Joshua Peisach , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= Date: Tue, 29 Sep 2026 23:04:57 +0800 In-Reply-To: <20260915-jh7110-clean-send-v4-12-f0e4fd6f2cc8@samsung.com> References: <20260915-jh7110-clean-send-v4-0-f0e4fd6f2cc8@samsung.com> <20260915-jh7110-clean-send-v4-12-f0e4fd6f2cc8@samsung.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID:zQCowAD3YTyZ07tqyZevCQ--.6680S2 X-Coremail-Antispam: 1UD129KBjvJXoW3Wr1xtFW5AFWUtw1DGFW8Crg_yoWxuF4UpF 4kJFy3CrW8JF1fArZ8Xw1UAFyrKws2va4Yk34xX3W2qr1UAryjqwn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86=99=E9=81=93=EF=BC=9A > Add the parent driver for the monolithic JH7110 HDMI IP block. >=20 > This driver binds to the starfive,jh7110-hdmi-subsystem node. It maps > the > shared register block, creates a regmap, and calls > devm_of_platform_populate() to create its hdmi_phy and > hdmi_controller > child devices, which retrieve the shared regmap from this parent. >=20 > The NoC display bus clock and reset that gate access to this region, > and > the PD_VOUT power domain it sits in, are held by the video output > subsystem parent for as long as this device exists, so there is > nothing > for this driver to bring up itself. >=20 > Co-developed-by: Dominique Belhachemi > Signed-off-by: Dominique Belhachemi > Signed-off-by: Michal Wilczynski ``` Tested-by: Icenowy Zheng ``` Thanks, Icenowy > --- > =C2=A0drivers/soc/Kconfig=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 1 + > =C2=A0drivers/soc/Makefile=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 1 + > =C2=A0drivers/soc/starfive/Kconfig=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 28 +++++++++++ > =C2=A0drivers/soc/starfive/Makefile=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 + > =C2=A0drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 > ++++++++++++++++++++++++++++ > =C2=A05 files changed, 105 insertions(+) >=20 > diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig > index > a2d65adffb8052c0ac5a6b60bf33fa9c644701bb..b3b01fc38139d98076c14f626a4 > 2ae3b7ef7c5d6 100644 > --- a/drivers/soc/Kconfig > +++ b/drivers/soc/Kconfig > @@ -24,6 +24,7 @@ source "drivers/soc/renesas/Kconfig" > =C2=A0source "drivers/soc/rockchip/Kconfig" > =C2=A0source "drivers/soc/samsung/Kconfig" > =C2=A0source "drivers/soc/sophgo/Kconfig" > +source "drivers/soc/starfive/Kconfig" > =C2=A0source "drivers/soc/sunxi/Kconfig" > =C2=A0source "drivers/soc/tegra/Kconfig" > =C2=A0source "drivers/soc/ti/Kconfig" > diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile > index > c9e689080ceb759384f690c2b65a82b3cb451c74..009f85ff891a15e0455f92c5d5a > 4059d8b1fcd3f 100644 > --- a/drivers/soc/Makefile > +++ b/drivers/soc/Makefile > @@ -30,6 +30,7 @@ obj-y +=3D renesas/ > =C2=A0obj-y +=3D rockchip/ > =C2=A0obj-$(CONFIG_SOC_SAMSUNG) +=3D samsung/ > =C2=A0obj-y +=3D sophgo/ > +obj-y +=3D starfive/ > =C2=A0obj-y +=3D sunxi/ > =C2=A0obj-$(CONFIG_ARCH_TEGRA) +=3D tegra/ > =C2=A0obj-y +=3D ti/ > diff --git a/drivers/soc/starfive/Kconfig > b/drivers/soc/starfive/Kconfig > new file mode 100644 > index > 0000000000000000000000000000000000000000..e738638ab0f755fbbabca259264 > abb56f3b6101f > --- /dev/null > +++ b/drivers/soc/starfive/Kconfig > @@ -0,0 +1,28 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +# > +# Starfive SoC drivers > +# > + > +if ARCH_STARFIVE || COMPILE_TEST > +menu "Starfive SoC drivers" > + > +config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM > + tristate "StarFive JH7110 HDMI subsystem driver" > + depends on OF > + select REGMAP_MMIO > + help > + =C2=A0 This option enables the parent driver > + =C2=A0 for the monolithic StarFive JH7110 HDMI peripheral. > + > + =C2=A0 The JH7110 HDMI IP block contains both the digital > controller > + =C2=A0 (DRM bridge) and the analog PHY (clock/phy provider) logic > within > + =C2=A0 a single shared register space. > + > + =C2=A0 This driver acts as a wrapper. Its only job is to map the > + =C2=A0 shared registers and create separate logical child devices > + =C2=A0 for the "PHY" and the "controller". This is required to > + =C2=A0 correctly manage resources and break a circular clock > dependency > + =C2=A0 between the PHY and the VOUT clock generator at probe > time. > + > +endmenu > +endif > diff --git a/drivers/soc/starfive/Makefile > b/drivers/soc/starfive/Makefile > new file mode 100644 > index > 0000000000000000000000000000000000000000..be89d8119212b7a7038817c2f0e > 8eac1984ada88 > --- /dev/null > +++ b/drivers/soc/starfive/Makefile > @@ -0,0 +1,2 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +obj-$(CONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM) +=3D jh7110-hdmi- > subsystem.o > diff --git a/drivers/soc/starfive/jh7110-hdmi-subsystem.c > b/drivers/soc/starfive/jh7110-hdmi-subsystem.c > new file mode 100644 > index > 0000000000000000000000000000000000000000..e64a22263045935ae69541cf8a1 > 44f6128170c11 > --- /dev/null > +++ b/drivers/soc/starfive/jh7110-hdmi-subsystem.c > @@ -0,0 +1,73 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Driver for the StarFive JH7110 HDMI subsystem > + * > + * Copyright (c) 2025 Samsung Electronics Co., Ltd. > + * Author: Michal Wilczynski > + * > + * This driver binds to the monolithic HDMI block and creates > separate > + * logical platform devices for the HDMI Controller (bridge) and the > + * HDMI PHY (clock/phy provider), allowing them to share a single > regmap > + * and breaking the probing circular dependency. > + */ > + > +#include > +#include > +#include > +#include > +#include > + > +static const struct regmap_config starfive_hdmi_regmap_config =3D { > + .reg_bits =3D 32, > + .val_bits =3D 8, > + .max_register =3D 0x3fff, > +}; > + > +static int starfive_hdmi_subsys_probe(struct platform_device *pdev) > +{ > + struct device *dev =3D &pdev->dev; > + struct regmap *regmap; > + void __iomem *regs; > + int ret; > + > + /* > + * The NoC display bus clock and reset that gate access to > this region, > + * and the PD_VOUT power domain it sits in, are held by the > video > + * output subsystem parent for as long as this device > exists. > + */ > + regs =3D devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(regs)) > + return PTR_ERR(regs); > + > + regmap =3D devm_regmap_init_mmio(dev, regs, > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > &starfive_hdmi_regmap_config); > + if (IS_ERR(regmap)) > + return dev_err_probe(dev, PTR_ERR(regmap), > + =C2=A0=C2=A0=C2=A0=C2=A0 "Failed to init shared > regmap\n"); > + > + ret =3D devm_of_platform_populate(dev); > + if (ret) > + return dev_err_probe(dev, ret, > + =C2=A0=C2=A0=C2=A0=C2=A0 "Failed to populate child > devices\n"); > + > + return 0; > +} > + > +static const struct of_device_id starfive_hdmi_subsys_of_match[] =3D { > + { .compatible =3D "starfive,jh7110-hdmi-subsystem", }, > + { /* sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, starfive_hdmi_subsys_of_match); > + > +static struct platform_driver starfive_hdmi_subsys_driver =3D { > + .probe =3D starfive_hdmi_subsys_probe, > + .driver =3D { > + .name =3D "starfive-hdmi-subsystem", > + .of_match_table =3D starfive_hdmi_subsys_of_match, > + }, > +}; > +module_platform_driver(starfive_hdmi_subsys_driver); > + > +MODULE_AUTHOR("Michal Wilczynski "); > +MODULE_DESCRIPTION("StarFive JH7110 HDMI subsystem Driver"); > +MODULE_LICENSE("GPL");