[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131122101803.GG2281@intel.com>
Date: Fri, 22 Nov 2013 12:18:03 +0200
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: linux-acpi@...r.kernel.org,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Linus Walleij <linus.walleij@...aro.org>,
Chris Ball <cjb@...top.org>,
Johannes Berg <johannes@...solutions.net>,
Rhyland Klein <rklein@...dia.com>,
Alexandre Courbot <acourbot@...dia.com>,
Mathias Nyman <mathias.nyman@...ux.intel.com>,
Rob Landley <rob@...dley.net>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] mmc: sdhci-acpi: covert to use GPIO descriptor API
On Fri, Nov 22, 2013 at 10:53:18AM +0200, Adrian Hunter wrote:
> On 21/11/13 16:45, Mika Westerberg wrote:
> > The new descriptor based GPIO interface is now the recommend and more safer
>
> "recommend and more safer" -> "recommended and safer"
OK.
>
> > way of using GPIOs from device drivers. Convert the ACPI SDHCI driver to
> > use that interface.
> >
> > Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> > ---
> > drivers/mmc/host/sdhci-acpi.c | 26 ++++++++++----------------
> > 1 file changed, 10 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> > index ef19874fcd1f..379ddfe14bc7 100644
> > --- a/drivers/mmc/host/sdhci-acpi.c
> > +++ b/drivers/mmc/host/sdhci-acpi.c
> > @@ -31,10 +31,9 @@
> > #include <linux/bitops.h>
> > #include <linux/types.h>
> > #include <linux/err.h>
> > -#include <linux/gpio.h>
> > +#include <linux/gpio/consumer.h>
> > #include <linux/interrupt.h>
> > #include <linux/acpi.h>
> > -#include <linux/acpi_gpio.h>
> > #include <linux/pm.h>
> > #include <linux/pm_runtime.h>
> > #include <linux/delay.h>
> > @@ -199,22 +198,19 @@ static irqreturn_t sdhci_acpi_sd_cd(int irq, void *dev_id)
> > return IRQ_HANDLED;
> > }
> >
> > -static int sdhci_acpi_add_own_cd(struct device *dev, int gpio,
> > - struct mmc_host *mmc)
> > +static int sdhci_acpi_add_own_cd(struct device *dev, struct mmc_host *mmc)
> > {
> > + struct gpio_desc *desc;
> > unsigned long flags;
> > int err, irq;
> >
> > - if (gpio < 0) {
> > - err = gpio;
> > + desc = devm_gpiod_get_index(dev, NULL, 0);
>
> I notice that:
>
> devm_gpio_request_one(.., label)
> -> gpio_request_one(..., label)
> -> gpiod_request(..., label)
>
> but:
>
> devm_gpiod_get_index(..., con_id, ...)
> -> gpiod_get_index(..., con_id, ...)
> -> gpiod_request(..., con_id)
>
> which suggests that 'con_id' is equivalent to 'label'.
> i.e. "sd_cd". Is it?
Indeed, it is. Even though ACPI doesn't use con_id for lookup gpiolib uses
it as a label once the GPIO descriptor is found.
I'll change that from NULL to "sd_cd".
--
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