Lines Matching +full:mdio +full:- +full:parent +full:- +full:bus
1 // SPDX-License-Identifier: GPL-2.0
3 * MDIO I2C bridge
5 * Copyright (C) 2015-2016 Russell King
13 #include <linux/mdio/mdio-i2c.h>
17 * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is
31 static int i2c_mii_read(struct mii_bus *bus, int phy_id, int reg) in i2c_mii_read() argument
33 struct i2c_adapter *i2c = bus->priv; in i2c_mii_read()
51 msgs[0].len = p - addr; in i2c_mii_read()
65 static int i2c_mii_write(struct mii_bus *bus, int phy_id, int reg, u16 val) in i2c_mii_write() argument
67 struct i2c_adapter *i2c = bus->priv; in i2c_mii_write()
86 msg.len = p - data; in i2c_mii_write()
94 struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c) in mdio_i2c_alloc() argument
99 return ERR_PTR(-EINVAL); in mdio_i2c_alloc()
103 return ERR_PTR(-ENOMEM); in mdio_i2c_alloc()
105 snprintf(mii->id, MII_BUS_ID_SIZE, "i2c:%s", dev_name(parent)); in mdio_i2c_alloc()
106 mii->parent = parent; in mdio_i2c_alloc()
107 mii->read = i2c_mii_read; in mdio_i2c_alloc()
108 mii->write = i2c_mii_write; in mdio_i2c_alloc()
109 mii->priv = i2c; in mdio_i2c_alloc()
116 MODULE_DESCRIPTION("MDIO I2C bridge library");