From: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Alan Tull <atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>,
Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 1/2] gpio: dwapb: Use human understandable gpio numbering.
Date: Thu, 02 Jul 2015 17:54:29 +0200 [thread overview]
Message-ID: <55955EB5.4090400@linutronix.de> (raw)
In-Reply-To: <20150702152147.GA10111-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
On 07/02/2015 05:21 PM, Richard Cochran wrote:
> On Thu, Jul 02, 2015 at 04:30:47PM +0200, Sebastian Andrzej Siewior wrote:
>> On 07/02/2015 04:26 PM, Richard Cochran wrote:
>>> On Thu, Jul 02, 2015 at 09:36:22AM +0200, Sebastian Andrzej Siewior wrote:
>>>> If you are in a specific SoC you could do
>>>> base = of_alias_get_id(np, "gpio") * num_of_gpio_per_chip
>>>> and get consistent numbers / sane.
>>>
>>> And what about /sys/class/gpio ?
>>
>> What about it?
>
> The poor users of that interface cannot use "of_alias_get_id" as you suggest.
You do that in the driver. The only problem with that is that the
synopsys controller can have between one and four banks and a bank can
have 1-32 GPIOs if I remember correctly. That means you can't have a
static number of GPIOs like others do.
Therefore I think a starting property is the only way and I would
prefer a generic one.
What confuses me a little: Why is there a snps,nr-gpios property?
Doesn't the snps' IP-Core expose this information?
> Thanks,
> Richard
>
Sebastian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] gpio: dwapb: Use human understandable gpio numbering.
Date: Thu, 02 Jul 2015 17:54:29 +0200 [thread overview]
Message-ID: <55955EB5.4090400@linutronix.de> (raw)
In-Reply-To: <20150702152147.GA10111@localhost.localdomain>
On 07/02/2015 05:21 PM, Richard Cochran wrote:
> On Thu, Jul 02, 2015 at 04:30:47PM +0200, Sebastian Andrzej Siewior wrote:
>> On 07/02/2015 04:26 PM, Richard Cochran wrote:
>>> On Thu, Jul 02, 2015 at 09:36:22AM +0200, Sebastian Andrzej Siewior wrote:
>>>> If you are in a specific SoC you could do
>>>> base = of_alias_get_id(np, "gpio") * num_of_gpio_per_chip
>>>> and get consistent numbers / sane.
>>>
>>> And what about /sys/class/gpio ?
>>
>> What about it?
>
> The poor users of that interface cannot use "of_alias_get_id" as you suggest.
You do that in the driver. The only problem with that is that the
synopsys controller can have between one and four banks and a bank can
have 1-32 GPIOs if I remember correctly. That means you can't have a
static number of GPIOs like others do.
Therefore I think a starting property is the only way and I would
prefer a generic one.
What confuses me a little: Why is there a snps,nr-gpios property?
Doesn't the snps' IP-Core expose this information?
> Thanks,
> Richard
>
Sebastian
next prev parent reply other threads:[~2015-07-02 15:54 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 19:34 [PATCH 0/2] gpio: dwapb: allow sane gpio numbering Richard Cochran
2015-07-01 19:34 ` Richard Cochran
2015-07-01 19:34 ` [PATCH 1/2] gpio: dwapb: Use human understandable " Richard Cochran
2015-07-01 19:34 ` Richard Cochran
2015-07-02 7:05 ` Michael van der Westhuizen
2015-07-02 7:05 ` Michael van der Westhuizen
2015-07-02 14:20 ` Richard Cochran
2015-07-02 14:20 ` Richard Cochran
[not found] ` <20150702142058.GA9349-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-07-16 7:57 ` Linus Walleij
2015-07-16 7:57 ` Linus Walleij
2015-07-16 8:18 ` Michael van der Westhuizen
2015-07-16 8:18 ` Michael van der Westhuizen
2015-07-16 18:19 ` Richard Cochran
2015-07-16 18:19 ` Richard Cochran
2015-07-03 9:13 ` Richard Cochran
2015-07-03 9:13 ` Richard Cochran
2015-07-03 9:18 ` Michael van der Westhuizen
2015-07-03 9:18 ` Michael van der Westhuizen
[not found] ` <C1BD6DA3-F32E-4CAD-8DA9-6F74A7966DBE-XrNoQAPr3WXM9gW82pYGhQ@public.gmane.org>
2015-07-03 10:36 ` Richard Cochran
2015-07-03 10:36 ` Richard Cochran
2015-07-03 10:55 ` Russell King - ARM Linux
2015-07-03 10:55 ` Russell King - ARM Linux
2015-07-16 7:52 ` Linus Walleij
2015-07-16 7:52 ` Linus Walleij
2015-07-16 8:16 ` Michael van der Westhuizen
2015-07-16 8:16 ` Michael van der Westhuizen
2015-07-02 7:36 ` Sebastian Andrzej Siewior
2015-07-02 7:36 ` Sebastian Andrzej Siewior
2015-07-02 14:26 ` Richard Cochran
2015-07-02 14:26 ` Richard Cochran
2015-07-02 14:30 ` Sebastian Andrzej Siewior
2015-07-02 14:30 ` Sebastian Andrzej Siewior
[not found] ` <55954B17.3020303-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2015-07-02 15:21 ` Richard Cochran
2015-07-02 15:21 ` Richard Cochran
[not found] ` <20150702152147.GA10111-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-07-02 15:54 ` Sebastian Andrzej Siewior [this message]
2015-07-02 15:54 ` Sebastian Andrzej Siewior
2015-07-02 16:02 ` Michael van der Westhuizen
2015-07-02 16:02 ` Michael van der Westhuizen
2015-07-03 13:30 ` Michael van der Westhuizen
2015-07-03 13:30 ` Michael van der Westhuizen
[not found] ` <d6b5ce85a17164970d454583560e07f7aed7b8ca.1435777856.git.rcochran-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2015-07-16 7:50 ` Linus Walleij
2015-07-16 7:50 ` Linus Walleij
2015-07-16 17:10 ` Richard Cochran
2015-07-16 17:10 ` Richard Cochran
2015-07-16 17:19 ` Richard Cochran
2015-07-16 17:19 ` Richard Cochran
2015-07-27 10:19 ` Linus Walleij
2015-07-27 10:19 ` Linus Walleij
2015-07-27 11:28 ` Richard Cochran
2015-07-27 11:28 ` Richard Cochran
2015-07-27 12:26 ` Sebastian Andrzej Siewior
2015-07-27 12:26 ` Sebastian Andrzej Siewior
[not found] ` <cover.1435777856.git.rcochran-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2015-07-01 19:34 ` [PATCH 2/2] arm: dts: socfpga: Provide the gpio numbers in the controller nodes Richard Cochran
2015-07-01 19:34 ` Richard Cochran
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=55955EB5.4090400@linutronix.de \
--to=bigeasy-hfztesqfncyowbw4kg4ksq@public.gmane.org \
--cc=atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.