summary refs log tree commit diff stats
path: root/hw/sd/omap_mmc.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2025-01-28 10:45:13 +0000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-31 19:36:44 +0100
commit3102d81fc707550675be7af0c49da7c4299e9af9 (patch)
treebac9d54564b53c1cb86feb988e4cad5d9abe85a2 /hw/sd/omap_mmc.c
parent0c90811231a9afc67d5d1119d3db0dcc8552f54d (diff)
downloadfocaccia-qemu-3102d81fc707550675be7af0c49da7c4299e9af9.tar.gz
focaccia-qemu-3102d81fc707550675be7af0c49da7c4299e9af9.zip
hw/sd/omap_mmc: Use similar API for "wire up omap_clk" to other OMAP devices
The approach we've settled on for handling the omap_clk wiring for
OMAP devices converted to QDev is to have a function omap_foo_set_clk()
whose implementation just sets the field directly in the device's
state struct. (See the "TODO" comment near the top of omap.h.)
Make omap_mmc do the same.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250128104519.3981448-6-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/sd/omap_mmc.c')
-rw-r--r--hw/sd/omap_mmc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index 1bc8290f9d..c6b8cf65d7 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -583,6 +583,13 @@ static const MemoryRegionOps omap_mmc_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
+void omap_mmc_set_clk(DeviceState *dev, omap_clk clk)
+{
+    OMAPMMCState *s = OMAP_MMC(dev);
+
+    s->clk = clk;
+}
+
 DeviceState *omap_mmc_init(hwaddr base,
                            MemoryRegion *sysmem,
                            qemu_irq irq, qemu_irq dma[], omap_clk clk)
@@ -594,7 +601,7 @@ DeviceState *omap_mmc_init(hwaddr base,
     s = OMAP_MMC(dev);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
 
-    s->clk = clk;
+    omap_mmc_set_clk(dev, clk);
 
     memory_region_add_subregion(sysmem, base,
                                 sysbus_mmio_get_region(SYS_BUS_DEVICE(s), 0));