if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_I2C_BLOCK)) return -EOPNOTSUPP;
if (id)
name = id->name; else return -ENODEV;
regmap = devm_regmap_init_i2c(client, &mpu3050_i2c_regmap_config); if (IS_ERR(regmap)) {
dev_err(&client->dev, "Failed to register i2c regmap: %pe\n",
regmap); return PTR_ERR(regmap);
}
ret = mpu3050_common_probe(&client->dev, regmap, client->irq, name); if (ret) return ret;
/* The main driver is up, now register the I2C mux */
mpu3050 = iio_priv(dev_get_drvdata(&client->dev));
mpu3050->i2cmux = i2c_mux_alloc(client->adapter, &client->dev,
1, 0, I2C_MUX_LOCKED | I2C_MUX_GATE,
mpu3050_i2c_bypass_select,
mpu3050_i2c_bypass_deselect); /* Just fail the mux, there is no point in killing the driver */ if (!mpu3050->i2cmux)
dev_err(&client->dev, "failed to allocate I2C mux\n"); else {
mpu3050->i2cmux->priv = mpu3050; /* Ignore failure, not critical */
i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0);
}
if (mpu3050->i2cmux)
i2c_mux_del_adapters(mpu3050->i2cmux);
mpu3050_common_remove(&client->dev);
}
/* * device id table is used to identify what device can be * supported by this driver
*/ staticconststruct i2c_device_id mpu3050_i2c_id[] = {
{ "mpu3050" },
{ }
};
MODULE_DEVICE_TABLE(i2c, mpu3050_i2c_id);
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.