/* Write to mux register. Don't use i2c_transfer() and i2c_smbus_xfer() * for this as they will try to lock adapter a second time.
*/ staticint mlxcpld_mux_reg_write(struct i2c_adapter *adap, struct mlxcpld_mux *mux, u32 val)
{ struct i2c_client *client = mux->client; union i2c_smbus_data data; struct i2c_msg msg;
u8 buf[3];
/* Only select the channel if its different from the last channel */ if (mux->last_val != regval) {
err = mlxcpld_mux_reg_write(muxc->parent, mux, regval);
mux->last_val = err < 0 ? -1 : regval;
}
platform_set_drvdata(pdev, muxc);
data = i2c_mux_priv(muxc);
data->client = client;
memcpy(&data->pdata, pdata, sizeof(*pdata));
data->last_val = -1; /* force the first selection */
/* Create an adapter for each channel. */ for (num = 0; num < pdata->num_adaps; num++) {
err = i2c_mux_add_adapter(muxc, 0, pdata->chan_ids[num]); if (err) goto virt_reg_failed;
}
/* Notify caller when all channels' adapters are created. */ if (pdata->completion_notify)
pdata->completion_notify(pdata->handle, muxc->parent, muxc->adapter);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.