public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios
@ 2012-06-03 12:40 Mark Brown
  2012-06-04 17:08 ` Linus Walleij
  2012-07-05 12:38 ` Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2012-06-03 12:40 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: linux-kernel, patches, Mark Brown

This has no practical impact at present since we don't support device tree
so any user must have set an irq_base but this will in future allow a
transition to device tree with minimal invasiveness.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/gpio/gpio-wm8994.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index 92ea535..a1c7ba9 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -19,6 +19,7 @@
 #include <linux/mfd/core.h>
 #include <linux/platform_device.h>
 #include <linux/seq_file.h>
+#include <linux/regmap.h>
 
 #include <linux/mfd/wm8994/core.h>
 #include <linux/mfd/wm8994/pdata.h>
@@ -109,10 +110,7 @@ static int wm8994_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 	struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
 	struct wm8994 *wm8994 = wm8994_gpio->wm8994;
 
-	if (!wm8994->irq_base)
-		return -EINVAL;
-
-	return wm8994->irq_base + offset;
+	return regmap_irq_get_virq(wm8994->irq_data, offset);
 }
 
 
-- 
1.7.10


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

* Re: [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios
  2012-06-03 12:40 [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios Mark Brown
@ 2012-06-04 17:08 ` Linus Walleij
  2012-06-04 17:11   ` Mark Brown
  2012-06-04 17:30   ` Jonathan Corbet
  2012-07-05 12:38 ` Linus Walleij
  1 sibling, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2012-06-04 17:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, patches

On Sun, Jun 3, 2012 at 2:40 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> This has no practical impact at present since we don't support device tree
> so any user must have set an irq_base but this will in future allow a
> transition to device tree with minimal invasiveness.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I read some drivers/base/regmap code and I think I understand this stuff
now, but seriously, it's quite hard to see the forest with all these trees,
and regmap is actually one of the finest new things in recent kernels,
so can could we create
Documentation/driver-model/regmap.txt?

I think this document is needed... I would write it myself if I felt I
understood the regmap overall concepts well enough, but I'm
certain to get something wrong.

Yours,
Linus Walleij

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

* Re: [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios
  2012-06-04 17:08 ` Linus Walleij
@ 2012-06-04 17:11   ` Mark Brown
  2012-06-04 17:30   ` Jonathan Corbet
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-06-04 17:11 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Grant Likely, Linus Walleij, linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

On Mon, Jun 04, 2012 at 07:08:43PM +0200, Linus Walleij wrote:

> I read some drivers/base/regmap code and I think I understand this stuff
> now, but seriously, it's quite hard to see the forest with all these trees,
> and regmap is actually one of the finest new things in recent kernels,
> so can could we create
> Documentation/driver-model/regmap.txt?

Of course, someone can!

> I think this document is needed... I would write it myself if I felt I
> understood the regmap overall concepts well enough, but I'm
> certain to get something wrong.

Well, there's one sure fire way to make sure you've got a good
understanding :)

More seriously I'm not sure I could readily tell what's non-obvious and
worth writing a document about.  Personally I always just read the
commit logs for Linux stuff, they're some of the best documentation I've
ever seen for software.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios
  2012-06-04 17:08 ` Linus Walleij
  2012-06-04 17:11   ` Mark Brown
@ 2012-06-04 17:30   ` Jonathan Corbet
  2012-06-04 18:05     ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Corbet @ 2012-06-04 17:30 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Mark Brown, Grant Likely, Linus Walleij, linux-kernel, patches

On Mon, 4 Jun 2012 19:08:43 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> I read some drivers/base/regmap code and I think I understand this stuff
> now, but seriously, it's quite hard to see the forest with all these trees,
> and regmap is actually one of the finest new things in recent kernels,
> so can could we create
> Documentation/driver-model/regmap.txt?

That's actually on my list of things to do (by way of LWN, of course).
I just need to get my hands dirty first, probably by converting the
ov7670 driver.  Unfortunately, I have some serious distractions in my
life at the moment, so I can't make any promises as to when this will
happen...

jon

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

* Re: [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios
  2012-06-04 17:30   ` Jonathan Corbet
@ 2012-06-04 18:05     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-06-04 18:05 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Linus Walleij, Grant Likely, Linus Walleij, linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

On Mon, Jun 04, 2012 at 11:30:17AM -0600, Jonathan Corbet wrote:

> That's actually on my list of things to do (by way of LWN, of course).
> I just need to get my hands dirty first, probably by converting the
> ov7670 driver.  Unfortunately, I have some serious distractions in my
> life at the moment, so I can't make any promises as to when this will
> happen...

Actually I was thinking about mailing you about a LWN article at some
point but that'd be a different (more tutorialish) thing to what it
seemed like Linus was asking for.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios
  2012-06-03 12:40 [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios Mark Brown
  2012-06-04 17:08 ` Linus Walleij
@ 2012-07-05 12:38 ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2012-07-05 12:38 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, patches

On Sun, Jun 3, 2012 at 2:40 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> This has no practical impact at present since we don't support device tree
> so any user must have set an irq_base but this will in future allow a
> transition to device tree with minimal invasiveness.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Patch applied.

Thanks,
Linus Walleij

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

end of thread, other threads:[~2012-07-05 12:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-03 12:40 [PATCH] gpiolib: wm8994: Use irq_domain mappings for gpios Mark Brown
2012-06-04 17:08 ` Linus Walleij
2012-06-04 17:11   ` Mark Brown
2012-06-04 17:30   ` Jonathan Corbet
2012-06-04 18:05     ` Mark Brown
2012-07-05 12:38 ` Linus Walleij

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