diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-22 10:42:55 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-22 10:42:55 -0800 |
commit | 603ac530f13506e6ce5db4ab953ede4d292c5327 (patch) | |
tree | 31e3edcc0a310b1fb23db3c8dd465bbe60b0fa47 /drivers | |
parent | 064d7dcf51a82b480e953a15cca47e5df0426502 (diff) | |
parent | 40f4b05868101e047a8502ebb94f05312186421b (diff) |
Merge tag 'regmap-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap updates from Mark Brown:
"A quiet release for regmap: we've seen several cleanups, an update for
a change in the MDIO APIs and one small fix"
* tag 'regmap-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
regmap-irq: Remove unused mask_invert flag
regmap-irq: Remove unused type_invert flag
regmap: Reorder fields in 'struct regmap_bus' to save some memory
regmap: apply reg_base and reg_downshift for single register ops
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 25 | ||||
-rw-r--r-- | drivers/base/regmap/regmap.c | 6 |
2 files changed, 8 insertions, 23 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index a8f185430a07..8c903b8c9714 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -189,12 +189,8 @@ static void regmap_irq_sync_unlock(struct irq_data *data) if (!d->type_buf_def[i]) continue; reg = d->get_irq_reg(d, d->chip->type_base, i); - if (d->chip->type_invert) - ret = regmap_update_bits(d->map, reg, - d->type_buf_def[i], ~d->type_buf[i]); - else - ret = regmap_update_bits(d->map, reg, - d->type_buf_def[i], d->type_buf[i]); + ret = regmap_update_bits(d->map, reg, + d->type_buf_def[i], d->type_buf[i]); if (ret != 0) dev_err(d->map->dev, "Failed to sync type in %x\n", reg); @@ -882,20 +878,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, */ dev_warn(map->dev, "mask_base and unmask_base are inverted, please fix it"); - /* Might as well warn about mask_invert while we're at it... */ - if (chip->mask_invert) - dev_warn(map->dev, "mask_invert=true ignored"); - - d->mask_base = chip->unmask_base; - d->unmask_base = chip->mask_base; - } else if (chip->mask_invert) { - /* - * Swap the roles of mask_base and unmask_base if the bits are - * inverted. This is deprecated, drivers should use unmask_base - * directly. - */ - dev_warn(map->dev, "mask_invert=true is deprecated; please switch to unmask_base"); - d->mask_base = chip->unmask_base; d->unmask_base = chip->mask_base; } else { @@ -1028,9 +1010,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, ret = regmap_read(map, reg, &d->type_buf_def[i]); - if (d->chip->type_invert) - d->type_buf_def[i] = ~d->type_buf_def[i]; - if (ret) { dev_err(map->dev, "Failed to get type defaults at 0x%x: %d\n", reg, ret); diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index d12d669157f2..d2a54eb0efd9 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1942,6 +1942,8 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg, { struct regmap *map = context; + reg += map->reg_base; + reg >>= map->format.reg_downshift; return map->bus->reg_write(map->bus_context, reg, val); } @@ -2840,6 +2842,8 @@ static int _regmap_bus_reg_read(void *context, unsigned int reg, { struct regmap *map = context; + reg += map->reg_base; + reg >>= map->format.reg_downshift; return map->bus->reg_read(map->bus_context, reg, val); } @@ -3231,6 +3235,8 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg, *change = false; if (regmap_volatile(map, reg) && map->reg_update_bits) { + reg += map->reg_base; + reg >>= map->format.reg_downshift; ret = map->reg_update_bits(map->bus_context, reg, mask, val); if (ret == 0 && change) *change = true; |