]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mux: mmio: Support "reg-mux" compatible
authorRoger Quadros <rogerq@kernel.org>
Wed, 18 Sep 2024 13:49:21 +0000 (16:49 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 20 Sep 2024 15:09:42 +0000 (09:09 -0600)
With "reg-mux" compatible the driver no longer expects the parent
device to be a syscon type. It uses it's own regmux.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
drivers/mux/mmio.c

index e1125458a629f5bccea8335b5a9b2236922a8e27..e06f4462b5ab86e9b6db832047ff966555be1e56 100644 (file)
@@ -31,6 +31,7 @@ static const struct mux_control_ops mux_mmio_ops = {
 
 static const struct udevice_id mmio_mux_of_match[] = {
        { .compatible = "mmio-mux" },
+       { .compatible = "reg-mux" },
        { /* sentinel */ },
 };
 
@@ -45,7 +46,11 @@ static int mmio_mux_probe(struct udevice *dev)
        int ret;
        int i;
 
-       regmap = syscon_node_to_regmap(dev_ofnode(dev->parent));
+       if (ofnode_device_is_compatible(dev_ofnode(dev), "mmio-mux"))
+               regmap = syscon_node_to_regmap(dev_ofnode(dev->parent));
+       else
+               regmap_init_mem(dev_ofnode(dev), &regmap);
+
        if (IS_ERR(regmap)) {
                ret = PTR_ERR(regmap);
                dev_err(dev, "failed to get regmap: %d\n", ret);