linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rhyland Klein <rklein@nvidia.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	Chris Ball <cjb@laptop.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alex Courbot <acourbot@nvidia.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	Rob Landley <rob@landley.net>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00
Date: Wed, 27 Nov 2013 11:47:16 -0500	[thread overview]
Message-ID: <52962214.9030203@nvidia.com> (raw)
In-Reply-To: <1385460350-17543-2-git-send-email-mika.westerberg@linux.intel.com>

On 11/26/2013 5:05 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.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Tested-by: Stephen Warren <swarren@nvidia.com>
> ---
>  arch/arm/mach-tegra/board-paz00.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
> index 06f024070dab..a309795da665 100644
> --- a/arch/arm/mach-tegra/board-paz00.c
> +++ b/arch/arm/mach-tegra/board-paz00.c
> @@ -18,6 +18,7 @@
>   */
>  
>  #include <linux/platform_device.h>
> +#include <linux/gpio/driver.h>
>  #include <linux/rfkill-gpio.h>
>  #include "board.h"
>  
> @@ -36,7 +37,13 @@ static struct platform_device wifi_rfkill_device = {
>  	},
>  };
>  
> +static struct gpiod_lookup wifi_gpio_lookup[] = {
> +	GPIO_LOOKUP_IDX("tegra-gpio", 25, "rfkill_gpio", NULL, 0, 0),
> +	GPIO_LOOKUP_IDX("tegra-gpio", 85, "rfkill_gpio", NULL, 1, 0),
> +};

I wouldn't think this table would match for the gpios as the driver
currently is. From what I see, the driver calls into gpiod_get_index,
which will try 1 of 3 ways of getting the gpios:

of-enabled: of_find_gpio
	- which I believe wouldn't work for paz00, since rfkill
	  doesn't support dt?
acpi: acpi_find_gpio
	- I assume this does work, but I didn't dive into it
gpiod lookup table: gpiod_find
	- I think this is the path we expect to be taken, given the addition of
the lookup table here, but I don't think it would actually match.
Looking at the code for gpiod_find, it seems like it would try to match
the con_id, but would fail. Patch 2/6 is passing the reset_name and
shutdown_name for the con_ids, which isn't what is registered in this
table.

Shouldn't it look more like this?

+static struct gpiod_lookup wifi_gpio_lookup[] = {
+	GPIO_LOOKUP_IDX("tegra-gpio", 25, "rfkill_gpio_reset", NULL, 0, 0),
+	GPIO_LOOKUP_IDX("tegra-gpio", 85, "rfkill_gpio_shutdown", NULL, 1, 0),
+};

Sorry if I am missing something...

-rhyland

-- 
nvpublic

  parent reply	other threads:[~2013-11-27 16:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 10:05 [PATCH v3 0/6] gpio / ACPI: convert users to gpiod_* and drop acpi_gpio.h Mika Westerberg
2013-11-26 10:05 ` [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00 Mika Westerberg
2013-11-26 20:33   ` Stephen Warren
2013-11-27  2:28     ` Alex Courbot
2013-11-27 16:47   ` Rhyland Klein [this message]
2013-11-28  2:47     ` Alexandre Courbot
2013-11-28  9:09       ` Marc Dietrich
2013-11-28  9:32         ` Thierry Reding
2013-11-28 10:20           ` Marc Dietrich
2013-11-28 11:06             ` Thierry Reding
2013-11-28 12:54               ` Marc Dietrich
2013-11-29 11:03                 ` Thierry Reding
2013-11-26 10:05 ` [PATCH v3 2/6] net: rfkill: gpio: convert to descriptor-based GPIO interface Mika Westerberg
2013-11-27  2:30   ` Alex Courbot
2013-12-11 12:00   ` Linus Walleij
2013-12-23 10:54     ` Mika Westerberg
2013-12-23 21:14       ` Johannes Berg
2014-01-07 17:43         ` Linus Walleij
2013-11-26 10:05 ` [PATCH v3 3/6] mmc: sdhci-acpi: convert to use GPIO descriptor API Mika Westerberg
2014-01-07 17:47   ` Linus Walleij
2013-11-26 10:05 ` [PATCH v3 4/6] gpio / ACPI: register to ACPI events automatically Mika Westerberg
2014-01-07 17:50   ` Linus Walleij
2014-01-08 10:22     ` Mika Westerberg
2013-11-26 10:05 ` [PATCH v3 5/6] gpio / ACPI: get rid of acpi_gpio.h Mika Westerberg
2013-11-28 14:41   ` Linus Walleij
2013-11-26 10:05 ` [PATCH v3 6/6] Documentation / ACPI: update to GPIO descriptor API Mika Westerberg
2013-11-28 14:36 ` [PATCH v3 0/6] gpio / ACPI: convert users to gpiod_* and drop acpi_gpio.h Linus Walleij
2013-11-28 17:04   ` Mika Westerberg

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=52962214.9030203@nvidia.com \
    --to=rklein@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=adrian.hunter@intel.com \
    --cc=cjb@laptop.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=rob@landley.net \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).