From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] ARM: hip04: set ARCH_NR_GPIO to 128
Date: Mon, 01 Dec 2014 15:47:03 +0100 [thread overview]
Message-ID: <2571535.P78Okb1jGf@wuerfel> (raw)
In-Reply-To: <CACRpkdb1nZN-vOXLC-QFUAT9wDGM2Nm5YeH0qY_u2JV9toOaVg@mail.gmail.com>
On Monday 01 December 2014 15:04:49 Linus Walleij wrote:
> On Sat, Nov 29, 2014 at 8:11 AM, Zhou Wang <wangzhou.bry@gmail.com> wrote:
> > On 2014?11?28? 17:33, Arnd Bergmann wrote:
> >> On Friday 28 November 2014 14:29:47 Zhou Wang wrote:
>
> >>> default 264 if MACH_H4700
> >>> + default 128 if ARCH_HIP04
> >>> default 0
> >>> help
> >>> Maximum number of GPIOs in the system.
> >>>
> >>
> >> If I remember correctly, you don't actually need to set this if all gpio
> >> clients are using the new gpio descriptor interfaces instead of gpio
> >> numbers. Would that work for you? You'd have to know which devices
> >
> > If I don't set this, it will use the default ARCH_NR_GPIO(512), then
> > the range of GPIO number will be 384~511 which is very strange to users,
> > because Hip04 based machines can only support 128 GPIOs.
>
> That is a totally different problem.
>
> Not that these numbers have ever been stable...
Right, in particular, it would be different between hisi_defconfig
and multi_v7_defconfig.
> Think of a patch to gpiochip_find_base() in
> drivers/gpio/gpiolib.c to fix this so that numbers are
> assigned a better way rather than doing
> random hacks with numbers like this.
Maybe we can find the highest number that is ever allocated
statically by any driver (since it's all from source code), and do
the dynamic allocations forward from that number instead of allocating
backward?
Or could we try to find the drivers that use DT /and/ allocate a static
number and then see if we can avoid the need for static numbers for
those?
Arnd
next prev parent reply other threads:[~2014-12-01 14:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-28 6:29 [PATCH v3 0/2] ARM: hip04: add GPIO support Zhou Wang
2014-11-28 6:29 ` [PATCH v3 1/2] ARM: hip04: set ARCH_NR_GPIO to 128 Zhou Wang
2014-11-28 9:33 ` Arnd Bergmann
2014-11-28 15:54 ` Linus Walleij
2014-11-28 21:16 ` Arnd Bergmann
2014-11-29 7:14 ` Alexandre Courbot
2014-11-29 7:22 ` Zhou Wang
2014-11-29 7:11 ` Zhou Wang
2014-12-01 14:04 ` Linus Walleij
2014-12-01 14:47 ` Arnd Bergmann [this message]
2014-12-02 6:43 ` Zhou Wang
2014-12-02 8:42 ` Arnd Bergmann
2014-12-04 6:49 ` Zhou Wang
2014-11-28 6:29 ` [PATCH v3 2/2] ARM: dts: hip04: add GPIO pieces Zhou Wang
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=2571535.P78Okb1jGf@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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