[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 9 Sep 2014 09:24:59 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Alexandre Courbot <gnurou@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Ning Li <ning.li@...el.com>, Alan Cox <alan@...ux.intel.com>,
Mark Brown <broonie@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH 1/2] x86, gpio: Increase ARCH_NR_GPIOs to 512
On Mon, Sep 8, 2014 at 1:47 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:
> Some newer Intel SoCs like Braswell already have more than 256 GPIOs
> available so the default limit is exceeded. In order to support these add
> back the custom GPIO header with limit of 512 GPIOs for x86.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
Argh! This is the kind of stuff I want to get rid of ....
Preferably gpio should be a subsystem without a lot of hooks all over
the place with arch-specific modifications for this and that, including
the max number of GPIOs.
I would actually prefer if you bump the value in
include/asm-generic/gpio.h to 512 over this.
But better still, now that we have descriptors etc would be to define
some new per-arch selectable config option like
CONFIG_ONLY_DYNAMIC_GPIO that changes the GPIO
core to use something like a radix tree to store and retrieve
descriptors.
I.e. in drivers/gpio/gpiolib.c get rid of this:
static struct gpio_desc gpio_desc[ARCH_NR_GPIOS];
Replace it with a radix tree of descriptors.
This however makes it *impossible* to use things like desc_to_gpio()
and/or gpio_to_desc() so the code has to be augmented all over the
place to avoid any uses of GPIO numbers on that architecture,
but I am sure it *can* be done on pure ACPI or device tree
systems, and that's what we should aim for.
Comments?
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists