Lines Matching +full:num +full:- +full:addresses

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2015-2016 Russell King
14 #include <linux/mdio/mdio-i2c.h>
19 * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is
21 * addresses 16 and 17. Disallow access to these "phy" addresses.
35 struct i2c_adapter *i2c = bus->priv; in i2c_mii_read_default()
53 msgs[0].len = p - addr; in i2c_mii_read_default()
70 struct i2c_adapter *i2c = bus->priv; in i2c_mii_write_default()
89 msg.len = p - data; in i2c_mii_write_default()
102 * ------- ---- -------- -----------
122 int num) in __i2c_transfer_err() argument
126 ret = __i2c_transfer(i2c, msgs, num); in __i2c_transfer_err()
129 else if (ret != num) in __i2c_transfer_err()
130 return -EIO; in __i2c_transfer_err()
181 * unfortunately tests show that this does not work :-( Changed SFP_PAGE does
185 struct i2c_msg *msgs, int num) in i2c_transfer_rollball() argument
193 ret = __i2c_rollball_get_page(i2c, msgs->addr, &saved_page); in i2c_transfer_rollball()
198 ret = __i2c_rollball_set_page(i2c, msgs->addr, SFP_PAGE_ROLLBALL_MDIO); in i2c_transfer_rollball()
203 ret = __i2c_transfer_err(i2c, msgs, num); in i2c_transfer_rollball()
208 ret = __i2c_rollball_set_page(i2c, msgs->addr, saved_page); in i2c_transfer_rollball()
219 struct i2c_adapter *i2c = bus->priv; in i2c_rollball_mii_poll()
252 } while (i-- > 0); in i2c_rollball_mii_poll()
254 dev_dbg(&bus->dev, "poll timed out\n"); in i2c_rollball_mii_poll()
256 return -ETIMEDOUT; in i2c_rollball_mii_poll()
262 struct i2c_adapter *i2c = bus->priv; in i2c_rollball_mii_cmd()
289 return -EOPNOTSUPP; in i2c_mii_read_rollball()
306 if (ret == -ETIMEDOUT) in i2c_mii_read_rollball()
323 return -EOPNOTSUPP; in i2c_mii_write_rollball()
369 return -EIO; in i2c_mii_init_rollball()
381 return ERR_PTR(-EINVAL); in mdio_i2c_alloc()
385 return ERR_PTR(-ENOMEM); in mdio_i2c_alloc()
387 snprintf(mii->id, MII_BUS_ID_SIZE, "i2c:%s", dev_name(parent)); in mdio_i2c_alloc()
388 mii->parent = parent; in mdio_i2c_alloc()
389 mii->priv = i2c; in mdio_i2c_alloc()
402 mii->read = i2c_mii_read_rollball; in mdio_i2c_alloc()
403 mii->write = i2c_mii_write_rollball; in mdio_i2c_alloc()
406 mii->read = i2c_mii_read_default; in mdio_i2c_alloc()
407 mii->write = i2c_mii_write_default; in mdio_i2c_alloc()