diff mbox series

[1/5] gpio: tps65910: use regmap accessors

Message ID e3a3979657babf716e5f4072e373637ce86ad7ff.1601164493.git.mirq-linux@rere.qmqm.pl
State New
Headers show
Series tps65910: cleanup regmap use | expand

Commit Message

Michał Mirosław Sept. 26, 2020, 11:59 p.m. UTC
Use regmap accessors directly for register manipulation - removing one
layer of abstraction.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/gpio/gpio-tps65910.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Bartosz Golaszewski Sept. 28, 2020, 10:19 a.m. UTC | #1
On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> Use regmap accessors directly for register manipulation - removing one
> layer of abstraction.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>  drivers/gpio/gpio-tps65910.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
> index 0c785b0fd161..0c0b445c75c0 100644
> --- a/drivers/gpio/gpio-tps65910.c
> +++ b/drivers/gpio/gpio-tps65910.c
> @@ -28,7 +28,7 @@ static int tps65910_gpio_get(struct gpio_chip *gc, unsigned offset)
>         struct tps65910 *tps65910 = tps65910_gpio->tps65910;
>         unsigned int val;
>
> -       tps65910_reg_read(tps65910, TPS65910_GPIO0 + offset, &val);
> +       regmap_read(tps65910->regmap, TPS65910_GPIO0 + offset, &val);
>
>         if (val & GPIO_STS_MASK)
>                 return 1;
> @@ -43,10 +43,10 @@ static void tps65910_gpio_set(struct gpio_chip *gc, unsigned offset,
>         struct tps65910 *tps65910 = tps65910_gpio->tps65910;
>
>         if (value)
> -               tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
> +               regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
>                                                 GPIO_SET_MASK);
>         else
> -               tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
> +               regmap_clear_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
>                                                 GPIO_SET_MASK);
>  }
>
> @@ -59,7 +59,7 @@ static int tps65910_gpio_output(struct gpio_chip *gc, unsigned offset,
>         /* Set the initial value */
>         tps65910_gpio_set(gc, offset, value);
>
> -       return tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
> +       return regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
>                                                 GPIO_CFG_MASK);
>  }
>
> @@ -68,7 +68,7 @@ static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset)
>         struct tps65910_gpio *tps65910_gpio = gpiochip_get_data(gc);
>         struct tps65910 *tps65910 = tps65910_gpio->tps65910;
>
> -       return tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
> +       return regmap_clear_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
>                                                 GPIO_CFG_MASK);
>  }
>
> @@ -157,7 +157,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
>                 if (!pdata->en_gpio_sleep[i])
>                         continue;
>
> -               ret = tps65910_reg_set_bits(tps65910,
> +               ret = regmap_set_bits(tps65910->regmap,
>                         TPS65910_GPIO0 + i, GPIO_SLEEP_MASK);
>                 if (ret < 0)
>                         dev_warn(tps65910->dev,
> --
> 2.20.1
>

Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Linus Walleij Sept. 30, 2020, 8:44 a.m. UTC | #2
On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> Use regmap accessors directly for register manipulation - removing one
> layer of abstraction.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

I suppose it is easiest that Lee apply all patches to the MFD tree?

Yours,
Linus Walleij
Lee Jones Oct. 1, 2020, 9:01 a.m. UTC | #3
On Wed, 30 Sep 2020, Linus Walleij wrote:

> On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> 
> > Use regmap accessors directly for register manipulation - removing one
> > layer of abstraction.
> >
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> I suppose it is easiest that Lee apply all patches to the MFD tree?

Yes, that's fine.

It won't be for this release though, as we're already at -rc7.
Lee Jones Nov. 4, 2020, 2:43 p.m. UTC | #4
On Thu, 01 Oct 2020, Lee Jones wrote:

> On Wed, 30 Sep 2020, Linus Walleij wrote:
> 
> > On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> > 
> > > Use regmap accessors directly for register manipulation - removing one
> > > layer of abstraction.
> > >
> > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > 
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > 
> > I suppose it is easiest that Lee apply all patches to the MFD tree?
> 
> Yes, that's fine.

I think this patch is orthogonal right?

Not sure why it need to go in via MFD.

Is that still want you want Linus?
Michał Mirosław Nov. 5, 2020, 1:47 a.m. UTC | #5
On Wed, Nov 04, 2020 at 02:43:31PM +0000, Lee Jones wrote:
> On Thu, 01 Oct 2020, Lee Jones wrote:
> > On Wed, 30 Sep 2020, Linus Walleij wrote:
> > > On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> > > > Use regmap accessors directly for register manipulation - removing one
> > > > layer of abstraction.
> > > >
> > > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > > 
> > > I suppose it is easiest that Lee apply all patches to the MFD tree?
> > Yes, that's fine.
> I think this patch is orthogonal right?
> 
> Not sure why it need to go in via MFD.
[...]

The patch 4 assumes all previous patches are applied (or there will be
build breakage).

Best Regards
Michał Mirosław
Linus Walleij Nov. 5, 2020, 7:56 a.m. UTC | #6
On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> Use regmap accessors directly for register manipulation - removing one
> layer of abstraction.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Lee Jones Nov. 5, 2020, 8:13 a.m. UTC | #7
On Thu, 05 Nov 2020, Michał Mirosław wrote:

> On Wed, Nov 04, 2020 at 02:43:31PM +0000, Lee Jones wrote:
> > On Thu, 01 Oct 2020, Lee Jones wrote:
> > > On Wed, 30 Sep 2020, Linus Walleij wrote:
> > > > On Sun, Sep 27, 2020 at 1:59 AM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> > > > > Use regmap accessors directly for register manipulation - removing one
> > > > > layer of abstraction.
> > > > >
> > > > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > > > 
> > > > I suppose it is easiest that Lee apply all patches to the MFD tree?
> > > Yes, that's fine.
> > I think this patch is orthogonal right?
> > 
> > Not sure why it need to go in via MFD.
> [...]
> 
> The patch 4 assumes all previous patches are applied (or there will be
> build breakage).

Okay, no problem.

Linus, do you want a PR?
Linus Walleij Nov. 10, 2020, 1:37 p.m. UTC | #8
On Thu, Nov 5, 2020 at 9:13 AM Lee Jones <lee.jones@linaro.org> wrote:

> > The patch 4 assumes all previous patches are applied (or there will be

> > build breakage).

>

> Okay, no problem.

>

> Linus, do you want a PR?


Nah let's optimistically assume it's not needed. I don't see a lot
of changes around here this merge window.

Thanks for sorting out this merge!

Yours,
Linus Walleij
Lee Jones Nov. 10, 2020, 1:48 p.m. UTC | #9
On Sun, 27 Sep 2020, Michał Mirosław wrote:

> Use regmap accessors directly for register manipulation - removing one
> layer of abstraction.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>  drivers/gpio/gpio-tps65910.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index 0c785b0fd161..0c0b445c75c0 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -28,7 +28,7 @@  static int tps65910_gpio_get(struct gpio_chip *gc, unsigned offset)
 	struct tps65910 *tps65910 = tps65910_gpio->tps65910;
 	unsigned int val;
 
-	tps65910_reg_read(tps65910, TPS65910_GPIO0 + offset, &val);
+	regmap_read(tps65910->regmap, TPS65910_GPIO0 + offset, &val);
 
 	if (val & GPIO_STS_MASK)
 		return 1;
@@ -43,10 +43,10 @@  static void tps65910_gpio_set(struct gpio_chip *gc, unsigned offset,
 	struct tps65910 *tps65910 = tps65910_gpio->tps65910;
 
 	if (value)
-		tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
+		regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
 						GPIO_SET_MASK);
 	else
-		tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
+		regmap_clear_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
 						GPIO_SET_MASK);
 }
 
@@ -59,7 +59,7 @@  static int tps65910_gpio_output(struct gpio_chip *gc, unsigned offset,
 	/* Set the initial value */
 	tps65910_gpio_set(gc, offset, value);
 
-	return tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
+	return regmap_set_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
 						GPIO_CFG_MASK);
 }
 
@@ -68,7 +68,7 @@  static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset)
 	struct tps65910_gpio *tps65910_gpio = gpiochip_get_data(gc);
 	struct tps65910 *tps65910 = tps65910_gpio->tps65910;
 
-	return tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
+	return regmap_clear_bits(tps65910->regmap, TPS65910_GPIO0 + offset,
 						GPIO_CFG_MASK);
 }
 
@@ -157,7 +157,7 @@  static int tps65910_gpio_probe(struct platform_device *pdev)
 		if (!pdata->en_gpio_sleep[i])
 			continue;
 
-		ret = tps65910_reg_set_bits(tps65910,
+		ret = regmap_set_bits(tps65910->regmap,
 			TPS65910_GPIO0 + i, GPIO_SLEEP_MASK);
 		if (ret < 0)
 			dev_warn(tps65910->dev,