Lines Matching defs:reg
16 /* Generate phy-addr and -reg from the input address */
25 static void lan9303_mdio_real_write(struct mdio_device *mdio, int reg, u16 val)
27 mdio->bus->write(mdio->bus, PHY_ADDR(reg), PHY_REG(reg), val);
30 static int lan9303_mdio_write(void *ctx, uint32_t reg, uint32_t val)
34 reg <<= 2; /* reg num to offset */
36 lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff);
37 lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff);
43 static u16 lan9303_mdio_real_read(struct mdio_device *mdio, int reg)
45 return mdio->bus->read(mdio->bus, PHY_ADDR(reg), PHY_REG(reg));
48 static int lan9303_mdio_read(void *ctx, uint32_t reg, uint32_t *val)
52 reg <<= 2; /* reg num to offset */
54 *val = lan9303_mdio_real_read(sw_dev->device, reg);
55 *val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16);
61 static int lan9303_mdio_phy_write(struct lan9303 *chip, int phy, int reg,
66 return mdiobus_write_nested(sw_dev->device->bus, phy, reg, val);
69 static int lan9303_mdio_phy_read(struct lan9303 *chip, int phy, int reg)
73 return mdiobus_read_nested(sw_dev->device->bus, phy, reg);