2022-11-27 07:32:33

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH] mfd: axp20x: adapt to newly refactored unmask_base in regmap-irq

The mask_base and unmask_base fields in a regmap-irq description is
recently refactored to be orthogonal and mask_inverted property is
deprecated. The new semantics of unmask_base just fits AXP PMICs.

Specify enabling registers as unmask_base and drop mask_inverted
property to adapt to the new interface.

Signed-off-by: Icenowy Zheng <[email protected]>
---
drivers/mfd/axp20x.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 88a212a8168c..6e6b5dbab098 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -506,8 +506,7 @@ static const struct regmap_irq_chip axp152_regmap_irq_chip = {
.name = "axp152_irq_chip",
.status_base = AXP152_IRQ1_STATE,
.ack_base = AXP152_IRQ1_STATE,
- .mask_base = AXP152_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP152_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp152_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp152_regmap_irqs),
@@ -518,8 +517,7 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
.name = "axp20x_irq_chip",
.status_base = AXP20X_IRQ1_STATE,
.ack_base = AXP20X_IRQ1_STATE,
- .mask_base = AXP20X_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP20X_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp20x_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp20x_regmap_irqs),
@@ -531,8 +529,7 @@ static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
.name = "axp22x_irq_chip",
.status_base = AXP20X_IRQ1_STATE,
.ack_base = AXP20X_IRQ1_STATE,
- .mask_base = AXP20X_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP20X_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp22x_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp22x_regmap_irqs),
@@ -543,8 +540,7 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = {
.name = "axp288_irq_chip",
.status_base = AXP20X_IRQ1_STATE,
.ack_base = AXP20X_IRQ1_STATE,
- .mask_base = AXP20X_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP20X_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp288_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp288_regmap_irqs),
@@ -556,8 +552,7 @@ static const struct regmap_irq_chip axp803_regmap_irq_chip = {
.name = "axp803",
.status_base = AXP20X_IRQ1_STATE,
.ack_base = AXP20X_IRQ1_STATE,
- .mask_base = AXP20X_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP20X_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp803_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp803_regmap_irqs),
@@ -568,8 +563,7 @@ static const struct regmap_irq_chip axp806_regmap_irq_chip = {
.name = "axp806",
.status_base = AXP20X_IRQ1_STATE,
.ack_base = AXP20X_IRQ1_STATE,
- .mask_base = AXP20X_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP20X_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp806_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp806_regmap_irqs),
@@ -580,8 +574,7 @@ static const struct regmap_irq_chip axp809_regmap_irq_chip = {
.name = "axp809",
.status_base = AXP20X_IRQ1_STATE,
.ack_base = AXP20X_IRQ1_STATE,
- .mask_base = AXP20X_IRQ1_EN,
- .mask_invert = true,
+ .unmask_base = AXP20X_IRQ1_EN,
.init_ack_masked = true,
.irqs = axp809_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp809_regmap_irqs),
--
2.37.1


2022-11-30 07:04:29

by Samuel Holland

[permalink] [raw]
Subject: Re: [PATCH] mfd: axp20x: adapt to newly refactored unmask_base in regmap-irq

Hi Icenowy,

On 11/27/22 01:23, Icenowy Zheng wrote:
> The mask_base and unmask_base fields in a regmap-irq description is
> recently refactored to be orthogonal and mask_inverted property is
> deprecated. The new semantics of unmask_base just fits AXP PMICs.
>
> Specify enabling registers as unmask_base and drop mask_inverted
> property to adapt to the new interface.
>
> Signed-off-by: Icenowy Zheng <[email protected]>

An equivalent patch was already merged:

https://lore.kernel.org/lkml/[email protected]/

> ---
> drivers/mfd/axp20x.c | 21 +++++++--------------
> 1 file changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 88a212a8168c..6e6b5dbab098 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -506,8 +506,7 @@ static const struct regmap_irq_chip axp152_regmap_irq_chip = {
> .name = "axp152_irq_chip",
> .status_base = AXP152_IRQ1_STATE,
> .ack_base = AXP152_IRQ1_STATE,
> - .mask_base = AXP152_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP152_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp152_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp152_regmap_irqs),
> @@ -518,8 +517,7 @@ static const struct regmap_irq_chip axp20x_regmap_irq_chip = {
> .name = "axp20x_irq_chip",
> .status_base = AXP20X_IRQ1_STATE,
> .ack_base = AXP20X_IRQ1_STATE,
> - .mask_base = AXP20X_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP20X_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp20x_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp20x_regmap_irqs),
> @@ -531,8 +529,7 @@ static const struct regmap_irq_chip axp22x_regmap_irq_chip = {
> .name = "axp22x_irq_chip",
> .status_base = AXP20X_IRQ1_STATE,
> .ack_base = AXP20X_IRQ1_STATE,
> - .mask_base = AXP20X_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP20X_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp22x_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp22x_regmap_irqs),
> @@ -543,8 +540,7 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = {
> .name = "axp288_irq_chip",
> .status_base = AXP20X_IRQ1_STATE,
> .ack_base = AXP20X_IRQ1_STATE,
> - .mask_base = AXP20X_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP20X_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp288_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp288_regmap_irqs),
> @@ -556,8 +552,7 @@ static const struct regmap_irq_chip axp803_regmap_irq_chip = {
> .name = "axp803",
> .status_base = AXP20X_IRQ1_STATE,
> .ack_base = AXP20X_IRQ1_STATE,
> - .mask_base = AXP20X_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP20X_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp803_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp803_regmap_irqs),
> @@ -568,8 +563,7 @@ static const struct regmap_irq_chip axp806_regmap_irq_chip = {
> .name = "axp806",
> .status_base = AXP20X_IRQ1_STATE,
> .ack_base = AXP20X_IRQ1_STATE,
> - .mask_base = AXP20X_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP20X_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp806_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp806_regmap_irqs),
> @@ -580,8 +574,7 @@ static const struct regmap_irq_chip axp809_regmap_irq_chip = {
> .name = "axp809",
> .status_base = AXP20X_IRQ1_STATE,
> .ack_base = AXP20X_IRQ1_STATE,
> - .mask_base = AXP20X_IRQ1_EN,
> - .mask_invert = true,
> + .unmask_base = AXP20X_IRQ1_EN,
> .init_ack_masked = true,
> .irqs = axp809_regmap_irqs,
> .num_irqs = ARRAY_SIZE(axp809_regmap_irqs),

2022-11-30 07:26:37

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [PATCH] mfd: axp20x: adapt to newly refactored unmask_base in regmap-irq

在 2022-11-30星期三的 00:33 -0600,Samuel Holland写道:
> Hi Icenowy,
>
> On 11/27/22 01:23, Icenowy Zheng wrote:
> > The mask_base and unmask_base fields in a regmap-irq description is
> > recently refactored to be orthogonal and mask_inverted property is
> > deprecated. The new semantics of unmask_base just fits AXP PMICs.
> >
> > Specify enabling registers as unmask_base and drop mask_inverted
> > property to adapt to the new interface.
> >
> > Signed-off-by: Icenowy Zheng <[email protected]>
>
> An equivalent patch was already merged:
>
> https://lore.kernel.org/lkml/[email protected]/

I am sorry for only checking torvalds/master before sending this patch.

>
> > ---
> >  drivers/mfd/axp20x.c | 21 +++++++--------------
> >  1 file changed, 7 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> > index 88a212a8168c..6e6b5dbab098 100644
> > --- a/drivers/mfd/axp20x.c
> > +++ b/drivers/mfd/axp20x.c
> > @@ -506,8 +506,7 @@ static const struct regmap_irq_chip
> > axp152_regmap_irq_chip = {
> >         .name                   = "axp152_irq_chip",
> >         .status_base            = AXP152_IRQ1_STATE,
> >         .ack_base               = AXP152_IRQ1_STATE,
> > -       .mask_base              = AXP152_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP152_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp152_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp152_regmap_irqs),
> > @@ -518,8 +517,7 @@ static const struct regmap_irq_chip
> > axp20x_regmap_irq_chip = {
> >         .name                   = "axp20x_irq_chip",
> >         .status_base            = AXP20X_IRQ1_STATE,
> >         .ack_base               = AXP20X_IRQ1_STATE,
> > -       .mask_base              = AXP20X_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP20X_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp20x_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp20x_regmap_irqs),
> > @@ -531,8 +529,7 @@ static const struct regmap_irq_chip
> > axp22x_regmap_irq_chip = {
> >         .name                   = "axp22x_irq_chip",
> >         .status_base            = AXP20X_IRQ1_STATE,
> >         .ack_base               = AXP20X_IRQ1_STATE,
> > -       .mask_base              = AXP20X_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP20X_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp22x_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp22x_regmap_irqs),
> > @@ -543,8 +540,7 @@ static const struct regmap_irq_chip
> > axp288_regmap_irq_chip = {
> >         .name                   = "axp288_irq_chip",
> >         .status_base            = AXP20X_IRQ1_STATE,
> >         .ack_base               = AXP20X_IRQ1_STATE,
> > -       .mask_base              = AXP20X_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP20X_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp288_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp288_regmap_irqs),
> > @@ -556,8 +552,7 @@ static const struct regmap_irq_chip
> > axp803_regmap_irq_chip = {
> >         .name                   = "axp803",
> >         .status_base            = AXP20X_IRQ1_STATE,
> >         .ack_base               = AXP20X_IRQ1_STATE,
> > -       .mask_base              = AXP20X_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP20X_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp803_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp803_regmap_irqs),
> > @@ -568,8 +563,7 @@ static const struct regmap_irq_chip
> > axp806_regmap_irq_chip = {
> >         .name                   = "axp806",
> >         .status_base            = AXP20X_IRQ1_STATE,
> >         .ack_base               = AXP20X_IRQ1_STATE,
> > -       .mask_base              = AXP20X_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP20X_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp806_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp806_regmap_irqs),
> > @@ -580,8 +574,7 @@ static const struct regmap_irq_chip
> > axp809_regmap_irq_chip = {
> >         .name                   = "axp809",
> >         .status_base            = AXP20X_IRQ1_STATE,
> >         .ack_base               = AXP20X_IRQ1_STATE,
> > -       .mask_base              = AXP20X_IRQ1_EN,
> > -       .mask_invert            = true,
> > +       .unmask_base            = AXP20X_IRQ1_EN,
> >         .init_ack_masked        = true,
> >         .irqs                   = axp809_regmap_irqs,
> >         .num_irqs               = ARRAY_SIZE(axp809_regmap_irqs),
>