Commit 5d23bb5f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull regmap updates from Mark Brown:
 "The main change here is Marek's addition of bulk read/write callbacks
  for individual regmaps, we've supported single register operations for
  a while but there's enough hardware out there which can use bulk
  equivalents to make it worthwhile"

* tag 'regmap-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: Add missing map->bus check
  regmap: Add bulk read/write callbacks into regmap_config
  regmap: cache: set max_register with reg_stride
  regmap: Constify static regmap_bus structs
parents 638971b7 5c422f0b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -110,6 +110,10 @@ struct regmap {
	int (*reg_write)(void *context, unsigned int reg, unsigned int val);
	int (*reg_update_bits)(void *context, unsigned int reg,
			       unsigned int mask, unsigned int val);
	/* Bulk read/write */
	int (*read)(void *context, const void *reg_buf, size_t reg_size,
		    void *val_buf, size_t val_size);
	int (*write)(void *context, const void *data, size_t count);

	bool defer_caching;

+2 −2
Original line number Diff line number Diff line
@@ -183,8 +183,8 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
			return 0;
	}

	if (!map->max_register)
		map->max_register = map->num_reg_defaults_raw;
	if (!map->max_register && map->num_reg_defaults_raw)
		map->max_register = (map->num_reg_defaults_raw  - 1) * map->reg_stride;

	if (map->cache_ops->init) {
		dev_dbg(map->dev, "Initializing %s cache\n",
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static int regmap_i3c_read(void *context,
	return i3c_device_do_priv_xfers(i3c, xfers, 2);
}

static struct regmap_bus regmap_i3c = {
static const struct regmap_bus regmap_i3c = {
	.write = regmap_i3c_write,
	.read = regmap_i3c_read,
};
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ static int regmap_sccb_write(void *context, unsigned int reg, unsigned int val)
	return i2c_smbus_write_byte_data(i2c, reg, val);
}

static struct regmap_bus regmap_sccb_bus = {
static const struct regmap_bus regmap_sccb_bus = {
	.reg_write = regmap_sccb_write,
	.reg_read = regmap_sccb_read,
};
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static int regmap_sdw_mbq_read(void *context, unsigned int reg, unsigned int *va
	return 0;
}

static struct regmap_bus regmap_sdw_mbq = {
static const struct regmap_bus regmap_sdw_mbq = {
	.reg_read = regmap_sdw_mbq_read,
	.reg_write = regmap_sdw_mbq_write,
	.reg_format_endian_default = REGMAP_ENDIAN_LITTLE,
Loading