diff options
author | Roger Quadros <rogerq@kernel.org> | 2024-09-18 16:49:21 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-09-20 09:09:42 -0600 |
commit | 8e7a7ffec6711069e2c0032574d93f75cf0ab454 (patch) | |
tree | 8213e664fae365d9f7cc02cbad6881d975192a28 | |
parent | c97ada2dc66934ee00a7a03d9ed078bdfb7b4039 (diff) | |
download | u-boot-8e7a7ffec6711069e2c0032574d93f75cf0ab454.tar.gz u-boot-8e7a7ffec6711069e2c0032574d93f75cf0ab454.tar.bz2 u-boot-8e7a7ffec6711069e2c0032574d93f75cf0ab454.zip |
mux: mmio: Support "reg-mux" compatible
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>
-rw-r--r-- | drivers/mux/mmio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c index e1125458a6..e06f4462b5 100644 --- a/drivers/mux/mmio.c +++ b/drivers/mux/mmio.c @@ -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), ®map); + if (IS_ERR(regmap)) { ret = PTR_ERR(regmap); dev_err(dev, "failed to get regmap: %d\n", ret); |