LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Vitaly Bordug <vitb@kernel.crashing.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	devicetree-discuss <devicetree-discuss@lists.ozlabs.org>
Subject: Re: some questions [gpio]
Date: Wed, 9 Sep 2009 11:10:27 -0600	[thread overview]
Message-ID: <fa686aa40909091010x10e406e2ia7a19c54865e0853@mail.gmail.com> (raw)
In-Reply-To: <20090909155053.7b79f4d3@vitb-lp>

(Added devicetree and linuxppc-dev to cc: list)

On Wed, Sep 9, 2009 at 5:50 AM, Vitaly Bordug<vitb@kernel.crashing.org> wrote:
> Hi Grant,
>
> Remember I was asking some time ago about multiple gpio chips per
> device node to enable sint gpio on 52xx?
>
> I need an advice again: adding multiple chips is OK but it stores
> address of the of_gpio_chip or smth like that in device_node->data.
> And that is used in routine that grabs all data from gpios<>. Hereby
> to implement multiple chips, I'd need to store in device_node ->data
> ponter to the array of gpio_chips, and to store actual amount of those
> chips somewhere, + study of_get_gpio_flags() to traverse several
> gpio_chips. That way, gpio_cells would be 3. Seems a little overkill...

Hmmm.  Refactoring the existing binding in non-backwards compatible
ways is not okay.  gpio_cells cannot be changed from 2 to 3 without
breaking existing users.

> Maybe it would be better to split away gpio_sint stuff?

I don't like it much since it kind of is one block of registers.
However, a binding change must be made regardless because the current
binding has no method of describing the sint pins (or the output-only
pins for that matter).  That leaves 2 options that I see:

1) Add a new node for the sint register range in the GPIO standard
registers block.
2) add some kind of offset to the 1st cell in the gpio property.  (ie.
0-0x20 for simple GPIOs, 0x200-0x207 for interrupt gpios, and
0x100-0x107 for output only gpios)

I'll ignore which approach is easier to implement currently in Linux
and try to focus on what the best binding would be.  Option 2 looks
pretty ugly and non-intuitive to me.  The only advantage there is it
keeps things described as a single block in the mpc5200 user manual
all in one node.  However, I think the clarity of option 1 wins out,
especially considering that there isn't currently any code that tries
to describe the sint pins in the device tree, so it has a smaller
likelyhood of causing breakage.

... so it would seem that my opinion on this matter is now the exact
opposite from the last time I talked to you now that I've actually
looked at the binding.  :-)

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

           reply	other threads:[~2009-09-09 17:10 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20090909155053.7b79f4d3@vitb-lp>]

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=fa686aa40909091010x10e406e2ia7a19c54865e0853@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=vitb@kernel.crashing.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