Commit 603ac530 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 064d7dcf 40f4b058
...@@ -189,10 +189,6 @@ static void regmap_irq_sync_unlock(struct irq_data *data) ...@@ -189,10 +189,6 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
if (!d->type_buf_def[i]) if (!d->type_buf_def[i])
continue; continue;
reg = d->get_irq_reg(d, d->chip->type_base, i); 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, ret = regmap_update_bits(d->map, reg,
d->type_buf_def[i], d->type_buf[i]); d->type_buf_def[i], d->type_buf[i]);
if (ret != 0) if (ret != 0)
...@@ -882,20 +878,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, ...@@ -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"); 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->mask_base = chip->unmask_base;
d->unmask_base = chip->mask_base; d->unmask_base = chip->mask_base;
} else { } else {
...@@ -1028,9 +1010,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, ...@@ -1028,9 +1010,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
ret = regmap_read(map, reg, &d->type_buf_def[i]); 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) { if (ret) {
dev_err(map->dev, "Failed to get type defaults at 0x%x: %d\n", dev_err(map->dev, "Failed to get type defaults at 0x%x: %d\n",
reg, ret); reg, ret);
......
...@@ -1942,6 +1942,8 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg, ...@@ -1942,6 +1942,8 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg,
{ {
struct regmap *map = context; struct regmap *map = context;
reg += map->reg_base;
reg >>= map->format.reg_downshift;
return map->bus->reg_write(map->bus_context, reg, val); 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, ...@@ -2840,6 +2842,8 @@ static int _regmap_bus_reg_read(void *context, unsigned int reg,
{ {
struct regmap *map = context; struct regmap *map = context;
reg += map->reg_base;
reg >>= map->format.reg_downshift;
return map->bus->reg_read(map->bus_context, reg, val); 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, ...@@ -3231,6 +3235,8 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
*change = false; *change = false;
if (regmap_volatile(map, reg) && map->reg_update_bits) { 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); ret = map->reg_update_bits(map->bus_context, reg, mask, val);
if (ret == 0 && change) if (ret == 0 && change)
*change = true; *change = true;
......
...@@ -520,6 +520,7 @@ typedef void (*regmap_hw_free_context)(void *context); ...@@ -520,6 +520,7 @@ typedef void (*regmap_hw_free_context)(void *context);
* to perform locking. This field is ignored if custom lock/unlock * to perform locking. This field is ignored if custom lock/unlock
* functions are used (see fields lock/unlock of * functions are used (see fields lock/unlock of
* struct regmap_config). * struct regmap_config).
* @free_on_exit: kfree this on exit of regmap
* @write: Write operation. * @write: Write operation.
* @gather_write: Write operation with split register/value, return -ENOTSUPP * @gather_write: Write operation with split register/value, return -ENOTSUPP
* if not implemented on a given device. * if not implemented on a given device.
...@@ -548,10 +549,10 @@ typedef void (*regmap_hw_free_context)(void *context); ...@@ -548,10 +549,10 @@ typedef void (*regmap_hw_free_context)(void *context);
* DEFAULT, BIG is assumed. * DEFAULT, BIG is assumed.
* @max_raw_read: Max raw read size that can be used on the bus. * @max_raw_read: Max raw read size that can be used on the bus.
* @max_raw_write: Max raw write size that can be used on the bus. * @max_raw_write: Max raw write size that can be used on the bus.
* @free_on_exit: kfree this on exit of regmap
*/ */
struct regmap_bus { struct regmap_bus {
bool fast_io; bool fast_io;
bool free_on_exit;
regmap_hw_write write; regmap_hw_write write;
regmap_hw_gather_write gather_write; regmap_hw_gather_write gather_write;
regmap_hw_async_write async_write; regmap_hw_async_write async_write;
...@@ -568,7 +569,6 @@ struct regmap_bus { ...@@ -568,7 +569,6 @@ struct regmap_bus {
enum regmap_endian val_format_endian_default; enum regmap_endian val_format_endian_default;
size_t max_raw_read; size_t max_raw_read;
size_t max_raw_write; size_t max_raw_write;
bool free_on_exit;
}; };
/* /*
...@@ -1540,9 +1540,6 @@ struct regmap_irq_chip_data; ...@@ -1540,9 +1540,6 @@ struct regmap_irq_chip_data;
* @config_base: Base address for IRQ type config regs. If null unsupported. * @config_base: Base address for IRQ type config regs. If null unsupported.
* @irq_reg_stride: Stride to use for chips where registers are not contiguous. * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
* @init_ack_masked: Ack all masked interrupts once during initalization. * @init_ack_masked: Ack all masked interrupts once during initalization.
* @mask_invert: Inverted mask register: cleared bits are masked out.
* Deprecated; prefer describing an inverted mask register as
* an unmask register.
* @mask_unmask_non_inverted: Controls mask bit inversion for chips that set * @mask_unmask_non_inverted: Controls mask bit inversion for chips that set
* both @mask_base and @unmask_base. If false, mask and unmask bits are * both @mask_base and @unmask_base. If false, mask and unmask bits are
* inverted (which is deprecated behavior); if true, bits will not be * inverted (which is deprecated behavior); if true, bits will not be
...@@ -1555,8 +1552,6 @@ struct regmap_irq_chip_data; ...@@ -1555,8 +1552,6 @@ struct regmap_irq_chip_data;
* @ack_invert: Inverted ack register: cleared bits for ack. * @ack_invert: Inverted ack register: cleared bits for ack.
* @clear_ack: Use this to set 1 and 0 or vice-versa to clear interrupts. * @clear_ack: Use this to set 1 and 0 or vice-versa to clear interrupts.
* @wake_invert: Inverted wake register: cleared bits are wake enabled. * @wake_invert: Inverted wake register: cleared bits are wake enabled.
* @type_invert: Invert the type flags. Deprecated, use config registers
* instead.
* @type_in_mask: Use the mask registers for controlling irq type. Use this if * @type_in_mask: Use the mask registers for controlling irq type. Use this if
* the hardware provides separate bits for rising/falling edge * the hardware provides separate bits for rising/falling edge
* or low/high level interrupts and they should be combined into * or low/high level interrupts and they should be combined into
...@@ -1626,14 +1621,12 @@ struct regmap_irq_chip { ...@@ -1626,14 +1621,12 @@ struct regmap_irq_chip {
const unsigned int *config_base; const unsigned int *config_base;
unsigned int irq_reg_stride; unsigned int irq_reg_stride;
unsigned int init_ack_masked:1; unsigned int init_ack_masked:1;
unsigned int mask_invert:1;
unsigned int mask_unmask_non_inverted:1; unsigned int mask_unmask_non_inverted:1;
unsigned int use_ack:1; unsigned int use_ack:1;
unsigned int ack_invert:1; unsigned int ack_invert:1;
unsigned int clear_ack:1; unsigned int clear_ack:1;
unsigned int wake_invert:1; unsigned int wake_invert:1;
unsigned int runtime_pm:1; unsigned int runtime_pm:1;
unsigned int type_invert:1;
unsigned int type_in_mask:1; unsigned int type_in_mask:1;
unsigned int clear_on_unmask:1; unsigned int clear_on_unmask:1;
unsigned int not_fixed_stride:1; unsigned int not_fixed_stride:1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment