Lines Matching defs:slave

273 /* SMBus slave GW. */
279 /* SMBus slave Finite State Machine (FSM). */
287 /* SMBus slave GW control bits offset in MLXBF_I2C_SMBUS_SLAVE_GW[31:19]. */
297 /* SMBus slave GW Data descriptor. */
301 /* SMbus slave configuration registers. */
358 u8 slave;
435 struct i2c_client *slave;
671 static int mlxbf_i2c_smbus_enable(struct mlxbf_i2c_priv *priv, u8 slave,
684 command |= rol32(slave, MLXBF_I2C_MASTER_SLV_ADDR_SHIFT);
716 u8 slave, flags, addr;
731 slave = request->slave & GENMASK(6, 0);
732 addr = slave << 1;
793 data_len = write_len + 1; /* Add one byte of the slave address. */
795 * Note that data_len cannot be 0. Indeed, the slave address byte
802 ret = mlxbf_i2c_smbus_enable(priv, slave, write_len, block_en,
809 /* Write slave address to Master GW data descriptor. */
812 ret = mlxbf_i2c_smbus_enable(priv, slave, read_len, block_en,
1568 * Read the slave registers. There are 4 * 32-bit slave registers.
1569 * Each slave register can hold up to 4 * 8-bit slave configuration
1576 * Each register holds 4 slave addresses. So, we have to keep
1585 * Mark the first available slave address slot, i.e. its
1587 * later on to register our slave.
1597 * Parse slave address bytes and check whether the
1598 * slave address already exists and it's enabled,
1612 /* Exit the loop if the slave address is found. */
1618 return -EINVAL; /* No room for a new slave address. */
1623 /* Set the slave address. */
1629 /* Enable the slave address and update the register. */
1641 struct i2c_client *client = priv->slave;
1651 * Read the slave registers. There are 4 * 32-bit slave registers.
1652 * Each slave register can hold up to 4 * 8-bit slave configuration
1664 * Each register holds 4 slave addresses. So, we have to keep
1673 * Parse slave address bytes and check whether the
1674 * slave address already exists.
1686 /* Exit the loop if the slave address is found. */
1694 /* Cleanup the slave address slot. */
1792 * Enable slave cause interrupt bits. Drive
1866 struct i2c_client *slave = priv->slave;
1870 if (!slave)
1879 * be located in the first data descriptor register of the slave GW.
1880 * These bytes are the slave address byte and the internal register
1896 /* Check whether it's our slave address. */
1897 if (slave->addr != addr)
1903 * Indeed, most slave devices would expect the internal address
1904 * following the slave address byte. So, write that byte first,
1908 i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
1910 ret = i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED,
1912 i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
1924 i2c_slave_event(slave, I2C_SLAVE_READ_REQUESTED, &value);
1928 i2c_slave_event(slave, I2C_SLAVE_READ_PROCESSED, &value);
1932 i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
1970 struct i2c_client *slave = priv->slave;
1974 if (!slave)
1981 /* Check whether its our slave address. */
1983 if (slave->addr != addr)
1987 * Notify the slave backend; another I2C master wants to write data
1988 * to us. This event is sent once the slave address and the write bit
1991 i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value);
1993 /* Send the received data to the slave backend. */
1996 ret = i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED,
2003 i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
2025 * - Send data and release slave GW.
2040 * slave, if the higher 8 bits are sent then the slave expect N bytes
2048 * For now, the slave supports 128 bytes transfer. Discard remaining
2050 * MLXBF_I2C_SLAVE_DATA_DESC_SIZE, i.e, the actual size of the slave
2079 request.slave = addr;
2087 dev_dbg(&adap->dev, "smbus quick, slave 0x%02x\n", addr);
2094 dev_dbg(&adap->dev, "smbus %s byte, slave 0x%02x.\n",
2101 dev_dbg(&adap->dev, "smbus %s byte data at 0x%02x, slave 0x%02x.\n",
2108 dev_dbg(&adap->dev, "smbus %s word data at 0x%02x, slave 0x%02x.\n",
2116 dev_dbg(&adap->dev, "i2c %s block data, %d bytes at 0x%02x, slave 0x%02x.\n",
2124 dev_dbg(&adap->dev, "smbus %s block data, %d bytes at 0x%02x, slave 0x%02x.\n",
2131 dev_dbg(&adap->dev, "process call, wr/rd at 0x%02x, slave 0x%02x.\n",
2140 dev_dbg(&adap->dev, "block process call, wr/rd %d bytes, slave 0x%02x.\n",
2155 static int mlxbf_i2c_reg_slave(struct i2c_client *slave)
2157 struct mlxbf_i2c_priv *priv = i2c_get_adapdata(slave->adapter);
2160 if (priv->slave)
2167 if (slave->flags & (I2C_CLIENT_TEN | I2C_CLIENT_PEC))
2170 ret = mlxbf_slave_enable(priv, slave->addr);
2174 priv->slave = slave;
2179 static int mlxbf_i2c_unreg_slave(struct i2c_client *slave)
2181 struct mlxbf_i2c_priv *priv = i2c_get_adapdata(slave->adapter);
2184 WARN_ON(!priv->slave);
2186 /* Unregister slave, i.e. disable the slave address in hardware. */
2191 priv->slave = NULL;
2355 dev_err(dev, "Cannot fetch cause slave resource info");