[PATCH v4 12/20] soc: starfive: Add jh7110-hdmi-subsystem driver

Icenowy Zheng zhengxingda at iscas.ac.cn
Tue Sep 29 08:04:57 PDT 2026


在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
> Add the parent driver for the monolithic JH7110 HDMI IP block.
> 
> 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.
> 
> 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.
> 
> Co-developed-by: Dominique Belhachemi <db at domibel.de>
> Signed-off-by: Dominique Belhachemi <db at domibel.de>
> Signed-off-by: Michal Wilczynski <m.wilczynski at samsung.com>

```
Tested-by: Icenowy Zheng <zhengxingda at iscas.ac.cn>
```

Thanks,
Icenowy

> ---
>  drivers/soc/Kconfig                          |  1 +
>  drivers/soc/Makefile                         |  1 +
>  drivers/soc/starfive/Kconfig                 | 28 +++++++++++
>  drivers/soc/starfive/Makefile                |  2 +
>  drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73
> ++++++++++++++++++++++++++++
>  5 files changed, 105 insertions(+)
> 
> 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"
>  source "drivers/soc/rockchip/Kconfig"
>  source "drivers/soc/samsung/Kconfig"
>  source "drivers/soc/sophgo/Kconfig"
> +source "drivers/soc/starfive/Kconfig"
>  source "drivers/soc/sunxi/Kconfig"
>  source "drivers/soc/tegra/Kconfig"
>  source "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				+= renesas/
>  obj-y				+= rockchip/
>  obj-$(CONFIG_SOC_SAMSUNG)	+= samsung/
>  obj-y				+= sophgo/
> +obj-y				+= starfive/
>  obj-y				+= sunxi/
>  obj-$(CONFIG_ARCH_TEGRA)	+= tegra/
>  obj-y				+= 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
> +	  This option enables the parent driver
> +	  for the monolithic StarFive JH7110 HDMI peripheral.
> +
> +	  The JH7110 HDMI IP block contains both the digital
> controller
> +	  (DRM bridge) and the analog PHY (clock/phy provider) logic
> within
> +	  a single shared register space.
> +
> +	  This driver acts as a wrapper. Its only job is to map the
> +	  shared registers and create separate logical child devices
> +	  for the "PHY" and the "controller". This is required to
> +	  correctly manage resources and break a circular clock
> dependency
> +	  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) += 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 <m.wilczynski at samsung.com>
> + *
> + * 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 <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +
> +static const struct regmap_config starfive_hdmi_regmap_config = {
> +	.reg_bits = 32,
> +	.val_bits = 8,
> +	.max_register = 0x3fff,
> +};
> +
> +static int starfive_hdmi_subsys_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &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 = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
> +
> +	regmap = devm_regmap_init_mmio(dev, regs,
> +				      
> &starfive_hdmi_regmap_config);
> +	if (IS_ERR(regmap))
> +		return dev_err_probe(dev, PTR_ERR(regmap),
> +				     "Failed to init shared
> regmap\n");
> +
> +	ret = devm_of_platform_populate(dev);
> +	if (ret)
> +		return dev_err_probe(dev, ret,
> +				     "Failed to populate child
> devices\n");
> +
> +	return 0;
> +}
> +
> +static const struct of_device_id starfive_hdmi_subsys_of_match[] = {
> +	{ .compatible = "starfive,jh7110-hdmi-subsystem", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, starfive_hdmi_subsys_of_match);
> +
> +static struct platform_driver starfive_hdmi_subsys_driver = {
> +	.probe = starfive_hdmi_subsys_probe,
> +	.driver = {
> +		.name = "starfive-hdmi-subsystem",
> +		.of_match_table = starfive_hdmi_subsys_of_match,
> +	},
> +};
> +module_platform_driver(starfive_hdmi_subsys_driver);
> +
> +MODULE_AUTHOR("Michal Wilczynski <m.wilczynski at samsung.com>");
> +MODULE_DESCRIPTION("StarFive JH7110 HDMI subsystem Driver");
> +MODULE_LICENSE("GPL");




More information about the Linux-rockchip mailing list