Lines Matching refs:sw_dev
32 struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx; in lan9303_mdio_write() local
35 mutex_lock(&sw_dev->device->bus->mdio_lock); in lan9303_mdio_write()
36 lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff); in lan9303_mdio_write()
37 lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff); in lan9303_mdio_write()
38 mutex_unlock(&sw_dev->device->bus->mdio_lock); in lan9303_mdio_write()
50 struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx; in lan9303_mdio_read() local
53 mutex_lock(&sw_dev->device->bus->mdio_lock); in lan9303_mdio_read()
54 *val = lan9303_mdio_real_read(sw_dev->device, reg); in lan9303_mdio_read()
55 *val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16); in lan9303_mdio_read()
56 mutex_unlock(&sw_dev->device->bus->mdio_lock); in lan9303_mdio_read()
64 struct lan9303_mdio *sw_dev = dev_get_drvdata(chip->dev); in lan9303_mdio_phy_write() local
66 return mdiobus_write_nested(sw_dev->device->bus, phy, reg, val); in lan9303_mdio_phy_write()
71 struct lan9303_mdio *sw_dev = dev_get_drvdata(chip->dev); in lan9303_mdio_phy_read() local
73 return mdiobus_read_nested(sw_dev->device->bus, phy, reg); in lan9303_mdio_phy_read()
101 struct lan9303_mdio *sw_dev; in lan9303_mdio_probe() local
104 sw_dev = devm_kzalloc(&mdiodev->dev, sizeof(struct lan9303_mdio), in lan9303_mdio_probe()
106 if (!sw_dev) in lan9303_mdio_probe()
109 sw_dev->chip.regmap = devm_regmap_init(&mdiodev->dev, NULL, sw_dev, in lan9303_mdio_probe()
111 if (IS_ERR(sw_dev->chip.regmap)) { in lan9303_mdio_probe()
112 ret = PTR_ERR(sw_dev->chip.regmap); in lan9303_mdio_probe()
118 sw_dev->device = mdiodev; in lan9303_mdio_probe()
119 dev_set_drvdata(&mdiodev->dev, sw_dev); in lan9303_mdio_probe()
120 sw_dev->chip.dev = &mdiodev->dev; in lan9303_mdio_probe()
122 sw_dev->chip.ops = &lan9303_mdio_phy_ops; in lan9303_mdio_probe()
124 ret = lan9303_probe(&sw_dev->chip, mdiodev->dev.of_node); in lan9303_mdio_probe()
135 struct lan9303_mdio *sw_dev = dev_get_drvdata(&mdiodev->dev); in lan9303_mdio_remove() local
137 if (!sw_dev) in lan9303_mdio_remove()
140 lan9303_remove(&sw_dev->chip); in lan9303_mdio_remove()