Unverified Commit 1c96a2f6 authored by David Frey's avatar David Frey Committed by Mark Brown
Browse files

regmap: split up regmap_config.use_single_rw



Split regmap_config.use_single_rw into use_single_read and
use_single_write. This change enables drivers of devices which only
support bulk operations in one direction to use the regmap_bulk_*()
functions for both directions and have their bulk operation split into
single operations only when necessary.

Update all struct regmap_config instances where use_single_rw==true to
instead set both use_single_read and use_single_write. No attempt was
made to evaluate whether it is possible to set only one of
use_single_read or use_single_write.

Signed-off-by: default avatarDavid Frey <dpfrey@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9ad8eb01
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -762,8 +762,8 @@ struct regmap *__regmap_init(struct device *dev,
		map->reg_stride_order = ilog2(map->reg_stride);
	else
		map->reg_stride_order = -1;
	map->use_single_read = config->use_single_rw || !bus || !bus->read;
	map->use_single_write = config->use_single_rw || !bus || !bus->write;
	map->use_single_read = config->use_single_read || !bus || !bus->read;
	map->use_single_write = config->use_single_write || !bus || !bus->write;
	map->can_multi_write = config->can_multi_write && bus && bus->write;
	if (bus) {
		map->max_raw_read = bus->max_raw_read;
+2 −1
Original line number Diff line number Diff line
@@ -599,7 +599,8 @@ static const struct regmap_config s10_sdram_regmap_cfg = {
	.volatile_reg = s10_sdram_volatile_reg,
	.reg_read = s10_protected_reg_read,
	.reg_write = s10_protected_reg_write,
	.use_single_rw = true,
	.use_single_read = true,
	.use_single_write = true,
};

static int altr_s10_sdram_probe(struct platform_device *pdev)
+2 −1
Original line number Diff line number Diff line
@@ -254,7 +254,8 @@ static const struct regmap_config lm75_regmap_config = {
	.volatile_reg = lm75_is_volatile_reg,
	.val_format_endian = REGMAP_ENDIAN_BIG,
	.cache_type = REGCACHE_RBTREE,
	.use_single_rw = true,
	.use_single_read = true,
	.use_single_write = true,
};

static void lm75_remove(void *data)
+2 −1
Original line number Diff line number Diff line
@@ -541,7 +541,8 @@ static const struct regmap_config lm95245_regmap_config = {
	.writeable_reg = lm95245_is_writeable_reg,
	.volatile_reg = lm95245_is_volatile_reg,
	.cache_type = REGCACHE_RBTREE,
	.use_single_rw = true,
	.use_single_read = true,
	.use_single_write = true,
};

static const u32 lm95245_chip_config[] = {
+2 −1
Original line number Diff line number Diff line
@@ -212,7 +212,8 @@ static const struct regmap_config tmp102_regmap_config = {
	.volatile_reg = tmp102_is_volatile_reg,
	.val_format_endian = REGMAP_ENDIAN_BIG,
	.cache_type = REGCACHE_RBTREE,
	.use_single_rw = true,
	.use_single_read = true,
	.use_single_write = true,
};

static int tmp102_probe(struct i2c_client *client,
Loading