*参照元 [#a10101ad] #backlinks *説明 [#h9be1b93] -パス: [[linux-4.4.1/]] -パス: [[linux-4.4.1/drivers/base/regmap/regmap-i2c.c]] -FIXME: これは何? --説明 **引数 [#of61f5ac] - -struct i2c_client *i2c -- --[[linux-4.4.1/i2c_client]] -const struct regmap_config *config -- --[[linux-4.4.1/regmap_config]] **返り値 [#ib6fc795] - -const struct regmap_bus * -- --[[linux-4.4.1/regmap_bus]] **参考 [#p8ccb8bd] *実装 [#we947bd5] static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c, const struct regmap_config *config) { if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return ®map_i2c; - --[[linux-4.4.1/i2c_check_functionality()]] --[[linux-4.4.1/regmap_i2c(global)]] else if (config->reg_bits == 8 && i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) return ®map_i2c_smbus_i2c_block; - --[[linux-4.4.1/regmap_i2c_smbus_i2c_block(global)]] else if (config->val_bits == 16 && config->reg_bits == 8 && i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_WORD_DATA)) switch (regmap_get_val_endian(&i2c->dev, NULL, config)) { case REGMAP_ENDIAN_LITTLE: return ®map_smbus_word; case REGMAP_ENDIAN_BIG: return ®map_smbus_word_swapped; default: /* everything else is not supported */ break; } - --[[linux-4.4.1/regmap_get_val_endian()]] --[[linux-4.4.1/regmap_smbus_word(global)]] --[[linux-4.4.1/regmap_smbus_word_swapped(global)]] else if (config->val_bits == 8 && config->reg_bits == 8 && i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return ®map_smbus_byte; - --[[linux-4.4.1/regmap_smbus_byte(global)]] return ERR_PTR(-ENOTSUPP); - --[[linux-4.4.1/ERR_PTR()]] } *コメント [#a4cde4f0]