linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: mail@david-bauer.net
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: 74x164: add lines-initial-states property
Date: Thu, 16 Aug 2018 10:11:38 +0200	[thread overview]
Message-ID: <CACRpkdYTxvWjLizTr8Qg-FmSPjnnU+kj2+VrUUcz5F0nkhrUrg@mail.gmail.com> (raw)
In-Reply-To: <20180815201855.29738-1-mail@david-bauer.net>

Hi David,

On Wed, Aug 15, 2018 at 10:19 PM David Bauer <mail@david-bauer.net> wrote:

> This adds the ability to define the initial state of each output line on
> device probe.
>
> Signed-off-by: David Bauer <mail@david-bauer.net>

(...)
>  Optional properties:
>  - enable-gpios: GPIO connected to the OE (Output Enable) pin.
> +- lines-initial-states: Bitmask that specifies the initial state of
> +  each line. When a bit is set to zero, the corresponding output line
> +  is initialized LOW. When a bit is set to one, the corresponding
> +  output line is initialized HIGH. In case this property is not
> +  defined, all lines will be initialized as LOW.

This sounds like something that should be generic, and not use
a bitmask, but offsets. It should work even if the number of
GPIOs from the chip is > 32.

Is the usecase different from hogs?
See Documentation/devicetree/bindings/gpio.txt

There has been extensive discussion about supporting initial values
with something similar to hogs, but I haven't got anything ACKed
by the DT maintainers so it has kind of stalled.

I would make sure to both make it generic, get ACK from the DT
mainatiners, and make sure to implement it in
drivers/gpio/gpiolib-of.c and not locally in drivers.

Yours,
Linus Walleij

  reply	other threads:[~2018-08-16  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15 20:18 [PATCH] gpio: 74x164: add lines-initial-states property David Bauer
2018-08-16  8:11 ` Linus Walleij [this message]
2018-08-19 23:55   ` David Bauer
2018-08-17 15:10 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACRpkdYTxvWjLizTr8Qg-FmSPjnnU+kj2+VrUUcz5F0nkhrUrg@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@david-bauer.net \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).