Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1460523 > unrolled thread

Re: [PATCH v6 3/4] gpio: lp873x: Add support for General Purpose Outputs

Started byLinus Walleij <linus.walleij@linaro.org>
First post2016-08-11 15:40 +0200
Last post2016-08-11 15:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v6 3/4] gpio: lp873x: Add support for General Purpose Outputs Linus Walleij <linus.walleij@linaro.org> - 2016-08-11 15:40 +0200

#1460523 — Re: [PATCH v6 3/4] gpio: lp873x: Add support for General Purpose Outputs

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-08-11 15:40 +0200
SubjectRe: [PATCH v6 3/4] gpio: lp873x: Add support for General Purpose Outputs
Message-ID<s4Ynf-4pW-1@gated-at.bofh.it>
On Mon, Aug 8, 2016 at 7:46 AM, Keerthy <j-keerthy@ti.com> wrote:

> Add driver for lp873x PMIC family GPOs. Two GPOs are supported
> and can be configured in Open-drain output or Push-pull output.
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Keerthy <j-keerthy@ti.com>

Still looks pretty nice, just thought of some things if
you're anyway working on the code:

> +       return regmap_update_bits(gpio->lp873->regmap, LP873X_REG_GPO_CTRL,
> +                                 BIT(offset * 4), value ? BIT(offset * 4) : 0);
(...)
(...)
> +       return val & BIT(offset * 4);
(...)
> +       regmap_update_bits(gpio->lp873->regmap, LP873X_REG_GPO_CTRL,
> +                          BIT(offset * 4), value ? BIT(offset * 4) : 0);
(...)
> +               return regmap_update_bits(gpio->lp873->regmap,
> +                                         LP873X_REG_GPO_CTRL,
> +                                         BIT(offset * 4 + 2),
> +                                         BIT(offset * 4 + 2));
> +       case LINE_MODE_PUSH_PULL:
> +               return regmap_update_bits(gpio->lp873->regmap,
> +                                         LP873X_REG_GPO_CTRL,
> +                                         BIT(offset * 4 + 2), 0);

This 4 +2 etc business is a bit hard to understand, could you create
a macro with a clever name that makes it more understandable?

Yours,
Linus Walleij

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web