2023-02-16 22:32:27

by Aidan MacDonald

[permalink] [raw]
Subject: [PATCH v1 1/2] regmap-irq: Remove unused type_invert flag

type_invert is deprecated and no longer used; it can now be removed.

Signed-off-by: Aidan MacDonald <[email protected]>
---
drivers/base/regmap/regmap-irq.c | 11 ++---------
include/linux/regmap.h | 3 ---
2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index a8f185430a07..e3092f522107 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);
@@ -1028,9 +1024,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/include/linux/regmap.h b/include/linux/regmap.h
index a3bc695bcca0..2114679729ce 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1547,8 +1547,6 @@ struct regmap_irq_chip_data;
* @ack_invert: Inverted ack register: cleared bits for ack.
* @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.
- * @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
* the hardware provides separate bits for rising/falling edge
* or low/high level interrupts and they should be combined into
@@ -1625,7 +1623,6 @@ struct regmap_irq_chip {
unsigned int clear_ack:1;
unsigned int wake_invert:1;
unsigned int runtime_pm:1;
- unsigned int type_invert:1;
unsigned int type_in_mask:1;
unsigned int clear_on_unmask:1;
unsigned int not_fixed_stride:1;
--
2.39.2



2023-02-16 22:32:33

by Aidan MacDonald

[permalink] [raw]
Subject: [PATCH v1 2/2] regmap-irq: Remove unused mask_invert flag

mask_invert is deprecated and no longer used; it can now be removed.

Signed-off-by: Aidan MacDonald <[email protected]>
---
drivers/base/regmap/regmap-irq.c | 14 --------------
include/linux/regmap.h | 4 ----
2 files changed, 18 deletions(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index e3092f522107..8c903b8c9714 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -878,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 {
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 2114679729ce..4b9ec1eb5235 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1532,9 +1532,6 @@ struct regmap_irq_chip_data;
* @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.
* @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
* both @mask_base and @unmask_base. If false, mask and unmask bits are
* inverted (which is deprecated behavior); if true, bits will not be
@@ -1616,7 +1613,6 @@ struct regmap_irq_chip {
const unsigned int *config_base;
unsigned int irq_reg_stride;
unsigned int init_ack_masked:1;
- unsigned int mask_invert:1;
unsigned int mask_unmask_non_inverted:1;
unsigned int use_ack:1;
unsigned int ack_invert:1;
--
2.39.2


2023-02-17 02:15:09

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v1 1/2] regmap-irq: Remove unused type_invert flag

On Thu, 16 Feb 2023 22:31:59 +0000, Aidan MacDonald wrote:
> type_invert is deprecated and no longer used; it can now be removed.
>
>

Applied to

broonie/regmap.git for-next

Thanks!

[1/2] regmap-irq: Remove unused type_invert flag
commit: 483e6ea1b35aaeffd9b6e6e660d756be49c2a9f5
[2/2] regmap-irq: Remove unused mask_invert flag
commit: c74e7af1245b2073930afc9a2a340d91e08f0f14

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark