lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbFHbxcKHC827A1v8q1JPFk8jZsbJEHFpXi1Ddz054Xdw@mail.gmail.com>
Date:	Thu, 11 Aug 2016 15:30:54 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Keerthy <j-keerthy@...com>
Cc:	Mark Brown <broonie@...nel.org>, Lee Jones <lee.jones@...aro.org>,
	Tony Lindgren <tony@...mide.com>,
	Alexandre Courbot <gnurou@...il.com>,
	Linux-OMAP <linux-omap@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	Rob Herring <robh+dt@...nel.org>
Subject: Re: [PATCH v6 3/4] gpio: lp873x: Add support for General Purpose Outputs

On Mon, Aug 8, 2016 at 7:46 AM, Keerthy <j-keerthy@...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@...aro.org>
> Signed-off-by: Keerthy <j-keerthy@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ