mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 23:41:50 +00:00
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>
This commit is contained in:
parent
c97ada2dc6
commit
8e7a7ffec6
1 changed files with 6 additions and 1 deletions
|
@ -31,6 +31,7 @@ static const struct mux_control_ops mux_mmio_ops = {
|
||||||
|
|
||||||
static const struct udevice_id mmio_mux_of_match[] = {
|
static const struct udevice_id mmio_mux_of_match[] = {
|
||||||
{ .compatible = "mmio-mux" },
|
{ .compatible = "mmio-mux" },
|
||||||
|
{ .compatible = "reg-mux" },
|
||||||
{ /* sentinel */ },
|
{ /* sentinel */ },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,7 +46,11 @@ static int mmio_mux_probe(struct udevice *dev)
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (ofnode_device_is_compatible(dev_ofnode(dev), "mmio-mux"))
|
||||||
regmap = syscon_node_to_regmap(dev_ofnode(dev->parent));
|
regmap = syscon_node_to_regmap(dev_ofnode(dev->parent));
|
||||||
|
else
|
||||||
|
regmap_init_mem(dev_ofnode(dev), ®map);
|
||||||
|
|
||||||
if (IS_ERR(regmap)) {
|
if (IS_ERR(regmap)) {
|
||||||
ret = PTR_ERR(regmap);
|
ret = PTR_ERR(regmap);
|
||||||
dev_err(dev, "failed to get regmap: %d\n", ret);
|
dev_err(dev, "failed to get regmap: %d\n", ret);
|
||||||
|
|
Loading…
Add table
Reference in a new issue