Lines Matching +full:ipq8064 +full:- +full:mdio
1 // SPDX-License-Identifier: GPL-2.0
2 /* Qualcomm IPQ8064 MDIO interface driver
47 return regmap_read_poll_timeout(priv->base, MII_ADDR_REG_ADDR, busy, in ipq8064_mdio_wait_busy()
56 struct ipq8064_mdio *priv = bus->priv; in ipq8064_mdio_read()
62 return -EOPNOTSUPP; in ipq8064_mdio_read()
67 regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr); in ipq8064_mdio_read()
74 regmap_read(priv->base, MII_DATA_REG_ADDR, &ret_val); in ipq8064_mdio_read()
82 struct ipq8064_mdio *priv = bus->priv; in ipq8064_mdio_write()
86 return -EOPNOTSUPP; in ipq8064_mdio_write()
88 regmap_write(priv->base, MII_DATA_REG_ADDR, data); in ipq8064_mdio_write()
93 regmap_write(priv->base, MII_ADDR_REG_ADDR, miiaddr); in ipq8064_mdio_write()
102 struct device_node *np = pdev->dev.of_node; in ipq8064_mdio_probe()
107 bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); in ipq8064_mdio_probe()
109 return -ENOMEM; in ipq8064_mdio_probe()
111 bus->name = "ipq8064_mdio_bus"; in ipq8064_mdio_probe()
112 bus->read = ipq8064_mdio_read; in ipq8064_mdio_probe()
113 bus->write = ipq8064_mdio_write; in ipq8064_mdio_probe()
114 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev)); in ipq8064_mdio_probe()
115 bus->parent = &pdev->dev; in ipq8064_mdio_probe()
117 priv = bus->priv; in ipq8064_mdio_probe()
118 priv->base = device_node_to_regmap(np); in ipq8064_mdio_probe()
119 if (IS_ERR(priv->base)) { in ipq8064_mdio_probe()
120 if (priv->base == ERR_PTR(-EPROBE_DEFER)) in ipq8064_mdio_probe()
121 return -EPROBE_DEFER; in ipq8064_mdio_probe()
123 dev_err(&pdev->dev, "error getting device regmap, error=%pe\n", in ipq8064_mdio_probe()
124 priv->base); in ipq8064_mdio_probe()
125 return PTR_ERR(priv->base); in ipq8064_mdio_probe()
147 { .compatible = "qcom,ipq8064-mdio" },
156 .name = "ipq8064-mdio",
163 MODULE_DESCRIPTION("Qualcomm IPQ8064 MDIO interface driver");