public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
@ 2010-12-12 13:19 Mark Brown
  2010-12-12 16:33 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mark Brown @ 2010-12-12 13:19 UTC (permalink / raw)
  To: Andrew Morton, Mike Frysinger, Michael Hennerich, Grant Likely
  Cc: linux-kernel, Paul Mundt, Mark Brown

The genirq core is being updated to pass struct irq_data to irq_chip
operations instead of an irq number. Update the ADP5588 GPIO driver to
the new API.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/gpio/adp5588-gpio.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/gpio/adp5588-gpio.c b/drivers/gpio/adp5588-gpio.c
index 0871f78..a8c1e58 100644
--- a/drivers/gpio/adp5588-gpio.c
+++ b/drivers/gpio/adp5588-gpio.c
@@ -146,9 +146,9 @@ static int adp5588_gpio_to_irq(struct gpio_chip *chip, unsigned off)
 	return dev->irq_base + off;
 }
 
-static void adp5588_irq_bus_lock(unsigned int irq)
+static void adp5588_irq_bus_lock(struct irq_data *data)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
 	mutex_lock(&dev->irq_lock);
 }
 
@@ -160,9 +160,9 @@ static void adp5588_irq_bus_lock(unsigned int irq)
   * and unlocks the bus.
   */
 
-static void adp5588_irq_bus_sync_unlock(unsigned int irq)
+static void adp5588_irq_bus_sync_unlock(struct irq_data *data)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
 	int i;
 
 	for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++)
@@ -175,31 +175,31 @@ static void adp5588_irq_bus_sync_unlock(unsigned int irq)
 	mutex_unlock(&dev->irq_lock);
 }
 
-static void adp5588_irq_mask(unsigned int irq)
+static void adp5588_irq_mask(struct irq_data *data)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
-	unsigned gpio = irq - dev->irq_base;
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
+	unsigned gpio = data->irq - dev->irq_base;
 
 	dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio);
 }
 
-static void adp5588_irq_unmask(unsigned int irq)
+static void adp5588_irq_unmask(struct irq_data *data)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
-	unsigned gpio = irq - dev->irq_base;
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
+	unsigned gpio = data->irq - dev->irq_base;
 
 	dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio);
 }
 
-static int adp5588_irq_set_type(unsigned int irq, unsigned int type)
+static int adp5588_irq_set_type(struct irq_data *data, unsigned int type)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
-	uint16_t gpio = irq - dev->irq_base;
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
+	uint16_t gpio = data->irq - dev->irq_base;
 	unsigned bank, bit;
 
 	if ((type & IRQ_TYPE_EDGE_BOTH)) {
 		dev_err(&dev->client->dev, "irq %d: unsupported type %d\n",
-			irq, type);
+			data->irq, type);
 		return -EINVAL;
 	}
 
@@ -222,11 +222,11 @@ static int adp5588_irq_set_type(unsigned int irq, unsigned int type)
 
 static struct irq_chip adp5588_irq_chip = {
 	.name			= "adp5588",
-	.mask			= adp5588_irq_mask,
-	.unmask			= adp5588_irq_unmask,
-	.bus_lock		= adp5588_irq_bus_lock,
-	.bus_sync_unlock	= adp5588_irq_bus_sync_unlock,
-	.set_type		= adp5588_irq_set_type,
+	.irq_mask		= adp5588_irq_mask,
+	.irq_unmask		= adp5588_irq_unmask,
+	.irq_bus_lock		= adp5588_irq_bus_lock,
+	.irq_bus_sync_unlock	= adp5588_irq_bus_sync_unlock,
+	.irq_set_type		= adp5588_irq_set_type,
 };
 
 static int adp5588_gpio_read_intstat(struct i2c_client *client, u8 *buf)
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
  2010-12-12 13:19 [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs Mark Brown
@ 2010-12-12 16:33 ` Mike Frysinger
  2010-12-12 18:41   ` Mark Brown
  2010-12-13 12:31 ` Hennerich, Michael
  2010-12-14 20:43 ` Andrew Morton
  2 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2010-12-12 16:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: Andrew Morton, Michael Hennerich, Grant Likely, linux-kernel,
	Paul Mundt

On Sun, Dec 12, 2010 at 08:19, Mark Brown wrote:
> The genirq core is being updated to pass struct irq_data to irq_chip
> operations instead of an irq number. Update the ADP5588 GPIO driver to
> the new API.

"is being updated" ... does that mean it hasnt been merged yet and so
this patch depends on something else ?
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
  2010-12-12 16:33 ` Mike Frysinger
@ 2010-12-12 18:41   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2010-12-12 18:41 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Andrew Morton, Michael Hennerich, Grant Likely, linux-kernel,
	Paul Mundt

On Sun, Dec 12, 2010 at 11:33:27AM -0500, Mike Frysinger wrote:
> On Sun, Dec 12, 2010 at 08:19, Mark Brown wrote:

> > The genirq core is being updated to pass struct irq_data to irq_chip
> > operations instead of an irq number. Update the ADP5588 GPIO driver to
> > the new API.

> "is being updated" ... does that mean it hasnt been merged yet and so
> this patch depends on something else ?

No dependency.  The change is being staged in gradually so from 2.6.37
both APIs are available unless the architecture explicitly selects a
Kconfig symbol which disables the old one (SH is trying to do this now
but I'm hopeful that Paul will update this for 2.6.37 so GPIO and MFD
drivers aren't affected in that release).  At some point in the future
when all the architectures are updated to the new API, hopefully in a
fairly small number of releases, support for the old API will be
withdrawn and only the new API will be available.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
  2010-12-12 13:19 [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs Mark Brown
  2010-12-12 16:33 ` Mike Frysinger
@ 2010-12-13 12:31 ` Hennerich, Michael
  2010-12-14 20:43 ` Andrew Morton
  2 siblings, 0 replies; 7+ messages in thread
From: Hennerich, Michael @ 2010-12-13 12:31 UTC (permalink / raw)
  To: Mark Brown, Andrew Morton, Mike Frysinger, Grant Likely
  Cc: linux-kernel@vger.kernel.org, Paul Mundt,
	device-drivers-devel@blackfin.uclinux.org, buytenh@wantstofly.org

Mark Brown wrote on 2010-12-12:
> The genirq core is being updated to pass struct irq_data to irq_chip
> operations instead of an irq number. Update the ADP5588 GPIO driver to
> the new API.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>  drivers/gpio/adp5588-gpio.c |   38 +++++++++++++++++++----------------
>  --- 1 files changed, 19 insertions(+), 19 deletions(-)
> diff --git a/drivers/gpio/adp5588-gpio.c b/drivers/gpio/adp5588-gpio.c
> index 0871f78..a8c1e58 100644
> --- a/drivers/gpio/adp5588-gpio.c
> +++ b/drivers/gpio/adp5588-gpio.c
> @@ -146,9 +146,9 @@ static int adp5588_gpio_to_irq(struct gpio_chip
> *chip, unsigned off)
>       return dev->irq_base + off;
>  }
> -static void adp5588_irq_bus_lock(unsigned int irq)
> +static void adp5588_irq_bus_lock(struct irq_data *data)
>  {
> -     struct adp5588_gpio *dev = get_irq_chip_data(irq);
> +     struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
>       mutex_lock(&dev->irq_lock);
>  }
> @@ -160,9 +160,9 @@ static void adp5588_irq_bus_lock(unsigned int irq)
>    * and unlocks the bus.
>    */
> -static void adp5588_irq_bus_sync_unlock(unsigned int irq)
> +static void adp5588_irq_bus_sync_unlock(struct irq_data *data)
>  {
> -     struct adp5588_gpio *dev = get_irq_chip_data(irq);
> +     struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
>       int i;
>
>       for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++) @@ -175,31
>  +175,31 @@ static void adp5588_irq_bus_sync_unlock(unsigned int irq)
>       mutex_unlock(&dev->irq_lock); }
> -static void adp5588_irq_mask(unsigned int irq)
> +static void adp5588_irq_mask(struct irq_data *data)
>  {
> -     struct adp5588_gpio *dev = get_irq_chip_data(irq);
> -     unsigned gpio = irq - dev->irq_base;
> +     struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
> +     unsigned gpio = data->irq - dev->irq_base;
>
>       dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio);  }
> -static void adp5588_irq_unmask(unsigned int irq)
> +static void adp5588_irq_unmask(struct irq_data *data)
>  {
> -     struct adp5588_gpio *dev = get_irq_chip_data(irq);
> -     unsigned gpio = irq - dev->irq_base;
> +     struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
> +     unsigned gpio = data->irq - dev->irq_base;
>
>       dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio);  }
> -static int adp5588_irq_set_type(unsigned int irq, unsigned int type)
> +static int adp5588_irq_set_type(struct irq_data *data, unsigned int
> +type)
>  {
> -     struct adp5588_gpio *dev = get_irq_chip_data(irq);
> -     uint16_t gpio = irq - dev->irq_base;
> +     struct adp5588_gpio *dev = irq_data_get_irq_chip_data(data);
> +     uint16_t gpio = data->irq - dev->irq_base;
>       unsigned bank, bit;
>
>       if ((type & IRQ_TYPE_EDGE_BOTH)) {
>               dev_err(&dev->client->dev, "irq %d: unsupported type %d\n",
> -                     irq, type);
> +                     data->irq, type);
>               return -EINVAL;
>       }
> @@ -222,11 +222,11 @@ static int adp5588_irq_set_type(unsigned int
> irq, unsigned int type)
>
>  static struct irq_chip adp5588_irq_chip = {
>       .name                   = "adp5588",
> -     .mask                   = adp5588_irq_mask,
> -     .unmask                 = adp5588_irq_unmask,
> -     .bus_lock               = adp5588_irq_bus_lock,
> -     .bus_sync_unlock        = adp5588_irq_bus_sync_unlock,
> -     .set_type               = adp5588_irq_set_type,
> +     .irq_mask               = adp5588_irq_mask,
> +     .irq_unmask             = adp5588_irq_unmask,
> +     .irq_bus_lock           = adp5588_irq_bus_lock,
> +     .irq_bus_sync_unlock    = adp5588_irq_bus_sync_unlock,
> +     .irq_set_type           = adp5588_irq_set_type,
>  };
>
>  static int adp5588_gpio_read_intstat(struct i2c_client *client, u8
> *buf)

Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
  2010-12-12 13:19 [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs Mark Brown
  2010-12-12 16:33 ` Mike Frysinger
  2010-12-13 12:31 ` Hennerich, Michael
@ 2010-12-14 20:43 ` Andrew Morton
  2010-12-14 20:54   ` Mike Frysinger
  2010-12-14 21:51   ` Mark Brown
  2 siblings, 2 replies; 7+ messages in thread
From: Andrew Morton @ 2010-12-14 20:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: Mike Frysinger, Michael Hennerich, Grant Likely, linux-kernel,
	Paul Mundt, Lennert Buytenhek

On Sun, 12 Dec 2010 13:19:48 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> The genirq core is being updated to pass struct irq_data to irq_chip
> operations instead of an irq number. Update the ADP5588 GPIO driver to
> the new API.

Seems to be the same as Lennert's patch, except he called it "d"?



From: Lennert Buytenhek <buytenh@wantstofly.org>

Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Acked-by: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/gpio/adp5588-gpio.c |   39 +++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff -puN drivers/gpio/adp5588-gpio.c~gpio-adp5588-gpio-irq_data-conversion drivers/gpio/adp5588-gpio.c
--- a/drivers/gpio/adp5588-gpio.c~gpio-adp5588-gpio-irq_data-conversion
+++ a/drivers/gpio/adp5588-gpio.c
@@ -146,9 +146,10 @@ static int adp5588_gpio_to_irq(struct gp
 	return dev->irq_base + off;
 }
 
-static void adp5588_irq_bus_lock(unsigned int irq)
+static void adp5588_irq_bus_lock(struct irq_data *d)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
+
 	mutex_lock(&dev->irq_lock);
 }
 
@@ -160,9 +161,9 @@ static void adp5588_irq_bus_lock(unsigne
   * and unlocks the bus.
   */
 
-static void adp5588_irq_bus_sync_unlock(unsigned int irq)
+static void adp5588_irq_bus_sync_unlock(struct irq_data *d)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
 	int i;
 
 	for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++)
@@ -175,31 +176,31 @@ static void adp5588_irq_bus_sync_unlock(
 	mutex_unlock(&dev->irq_lock);
 }
 
-static void adp5588_irq_mask(unsigned int irq)
+static void adp5588_irq_mask(struct irq_data *d)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
-	unsigned gpio = irq - dev->irq_base;
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
+	unsigned gpio = d->irq - dev->irq_base;
 
 	dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio);
 }
 
-static void adp5588_irq_unmask(unsigned int irq)
+static void adp5588_irq_unmask(struct irq_data *d)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
-	unsigned gpio = irq - dev->irq_base;
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
+	unsigned gpio = d->irq - dev->irq_base;
 
 	dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio);
 }
 
-static int adp5588_irq_set_type(unsigned int irq, unsigned int type)
+static int adp5588_irq_set_type(struct irq_data *d, unsigned int type)
 {
-	struct adp5588_gpio *dev = get_irq_chip_data(irq);
-	uint16_t gpio = irq - dev->irq_base;
+	struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
+	uint16_t gpio = d->irq - dev->irq_base;
 	unsigned bank, bit;
 
 	if ((type & IRQ_TYPE_EDGE_BOTH)) {
 		dev_err(&dev->client->dev, "irq %d: unsupported type %d\n",
-			irq, type);
+			d->irq, type);
 		return -EINVAL;
 	}
 
@@ -222,11 +223,11 @@ static int adp5588_irq_set_type(unsigned
 
 static struct irq_chip adp5588_irq_chip = {
 	.name			= "adp5588",
-	.mask			= adp5588_irq_mask,
-	.unmask			= adp5588_irq_unmask,
-	.bus_lock		= adp5588_irq_bus_lock,
-	.bus_sync_unlock	= adp5588_irq_bus_sync_unlock,
-	.set_type		= adp5588_irq_set_type,
+	.irq_mask		= adp5588_irq_mask,
+	.irq_unmask		= adp5588_irq_unmask,
+	.irq_bus_lock		= adp5588_irq_bus_lock,
+	.irq_bus_sync_unlock	= adp5588_irq_bus_sync_unlock,
+	.irq_set_type		= adp5588_irq_set_type,
 };
 
 static int adp5588_gpio_read_intstat(struct i2c_client *client, u8 *buf)
_


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
  2010-12-14 20:43 ` Andrew Morton
@ 2010-12-14 20:54   ` Mike Frysinger
  2010-12-14 21:51   ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2010-12-14 20:54 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mark Brown, Michael Hennerich, Grant Likely, linux-kernel,
	Paul Mundt, Lennert Buytenhek

On Tue, Dec 14, 2010 at 15:43, Andrew Morton wrote:
> On Sun, 12 Dec 2010 13:19:48 +0000 Mark Brown wrote:
>> The genirq core is being updated to pass struct irq_data to irq_chip
>> operations instead of an irq number. Update the ADP5588 GPIO driver to
>> the new API.
>
> Seems to be the same as Lennert's patch, except he called it "d"?

other way around ... Lennert's patch is like Mark's
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs
  2010-12-14 20:43 ` Andrew Morton
  2010-12-14 20:54   ` Mike Frysinger
@ 2010-12-14 21:51   ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2010-12-14 21:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mike Frysinger, Michael Hennerich, Grant Likely, linux-kernel,
	Paul Mundt, Lennert Buytenhek

On Tue, Dec 14, 2010 at 12:43:32PM -0800, Andrew Morton wrote:
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> > The genirq core is being updated to pass struct irq_data to irq_chip
> > operations instead of an irq number. Update the ADP5588 GPIO driver to
> > the new API.

> Seems to be the same as Lennert's patch, except he called it "d"?

Yes, we're both doing the same conversions - I posted this one patch for
the gpio stuff over the weekend then Lennart posted his on Monday.
There's no meaningful difference between the two of them, so long as one
of them gets in it's all good.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-14 21:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-12 13:19 [PATCH] gpiolib: Convert ADP5588 to new irq_ APIs Mark Brown
2010-12-12 16:33 ` Mike Frysinger
2010-12-12 18:41   ` Mark Brown
2010-12-13 12:31 ` Hennerich, Michael
2010-12-14 20:43 ` Andrew Morton
2010-12-14 20:54   ` Mike Frysinger
2010-12-14 21:51   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox