Re: [PATCH v2 2/7] ARM: tegra: add gpiod_lookup table for paz00

Stephen Warren
2013-11-22T18:40:18Z

On 11/22/2013 05:14 AM, Mika Westerberg wrote:
> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>
> This makes it possible to request the gpio descriptors in
> rfkill-gpio driver regardless of the platform.

Patches 1-3,
Tested-by: Stephen Warren <swarren@nvidia.com>

All the testing I did was to "cat /sys/kernel/debug/gpios" to make sure
those two GPIOs had been correctly acquired by the driver, and that they
changed state as expected via the command-line "rfkill {un,}block" commands.

However, please note that I had to apply a couple fixes to the gpiolib
core to get this working:

1)

To solve the following build warning:

> In file included from arch/arm/mach-tegra/board-paz00.c:21:0:
> include/linux/gpio/driver.h:102:17: warning: ‘struct of_phandle_args’ declared inside parameter list [enabled by default]
> include/linux/gpio/driver.h:102:17: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

I applied:

> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index 82eac610ce1a..5133cf29803a 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -5,6 +5,7 @@
>
> struct device;
> struct gpio_desc;
> +struct of_phandle_args;
> struct seq_file;
>
> /**

2)

In order to get the GPIO lookups from the rfkill driver working, I applied:

> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index ac53a9593662..b73c39f99858 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2368,7 +2368,7 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
> continue;
> }
>
> - if (chip->ngpio >= p->chip_hwnum) {
> + if (chip->ngpio <= p->chip_hwnum) {
> dev_warn(dev, "GPIO chip %s has %d GPIOs\n",
> chip->label, chip->ngpio);
> continue;