[PATCH v7 15/19] soc: starfive: Add jh7110-hdmi-subsystem driver
Michal Wilczynski
m.wilczynski at samsung.com
Fri Nov 6 05:58:49 PST 2026
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>
Tested-by: Icenowy Zheng <zhengxingda at iscas.ac.cn>
Tested-by: Byron Stanoszek <gandalf at winds.org>
Tested-by: OOHehir <oo.hehir at gmail.com>
Signed-off-by: Michal Wilczynski <m.wilczynski at samsung.com>
---
drivers/soc/starfive/Kconfig | 18 +++++++
drivers/soc/starfive/Makefile | 1 +
drivers/soc/starfive/jh7110-hdmi-subsystem.c | 72 ++++++++++++++++++++++++++++
3 files changed, 91 insertions(+)
diff --git a/drivers/soc/starfive/Kconfig b/drivers/soc/starfive/Kconfig
index 04b020083d3eecd7754bb2e2ec1b4fc8f525a344..e19994a212d4af49eaed595bab6fecc19677b2b3 100644
--- a/drivers/soc/starfive/Kconfig
+++ b/drivers/soc/starfive/Kconfig
@@ -3,4 +3,22 @@ menu "StarFive SoC (System On Chip) specific Drivers"
source "drivers/soc/starfive/socinfo/Kconfig"
+config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM
+ tristate "StarFive JH7110 HDMI subsystem driver"
+ depends on ARCH_STARFIVE || COMPILE_TEST
+ 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", which have their own clocks
+ and roles but share the register space.
+
endmenu
diff --git a/drivers/soc/starfive/Makefile b/drivers/soc/starfive/Makefile
index ca1e609b81045f5e11daf249c116b22c8dc0e4d0..36fbb6f984986e4794ffb2c6c1485b6644efc4eb 100644
--- a/drivers/soc/starfive/Makefile
+++ b/drivers/soc/starfive/Makefile
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-y += socinfo/
+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..b01dc66450f516599c013df0383e6fde987f390e
--- /dev/null
+++ b/drivers/soc/starfive/jh7110-hdmi-subsystem.c
@@ -0,0 +1,72 @@
+// 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.
+ */
+
+#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");
--
2.34.1
More information about the linux-riscv
mailing list