All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	alsa-devel@alsa-project.org, Dmitry Artamonow <mad_soft@inbox.ru>,
	x86@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	linux-next@vger.kernel.org, Harald Welte <laforge@gnufiish.org>
Subject: [PATCH/RFC] gpio: add GPIOF_ values regardless on kconfig settings
Date: Mon, 23 May 2011 21:58:39 -0700	[thread overview]
Message-ID: <4DDB3AFF.9030006@oracle.com> (raw)
In-Reply-To: <20110524014959.GA27710@opensource.wolfsonmicro.com>

On 05/23/11 18:50, Mark Brown wrote:
> On Mon, May 23, 2011 at 06:21:51PM -0700, Randy Dunlap wrote:
>> On 05/23/11 17:08, Mark Brown wrote:
> 
>>> No, really we should.  The GPIO APIs are stubbed out when not in use for
>>> a very good reason, think about the usability here.  The goal here isn't
>>> to litter the code with ifdefs - if architectures aren't able to keep up
>>> with API changes they should convert to using gpiolib so this stuff
>>> happens automatically (indeed, I can't think of any good reason for an
>>> architecture to not be using gpiolib at this point).
> 
>> No, I would say that there are a lot of drivers in sound/soc/codecs/
>> that are missing some GPIO pieces in the Kconfig file.
> 
> Have you actually looked at the code here?  Vanishingly few of the
> drivers need GPIOs at all, they can just optionally use GPIOs if the
> system makes them available.  There is absolutely no dependency on GPIOs
> for them, anything in Kconfig would be entirely unconstructive.
> 
>>>> MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
> 
>>> You've clearly not looked at MAINTAINERS for this one.
> 
>> It's not listed in the MAINTAINERS file.
> 
> MAINTAINERS has a pattern sound/soc/codecs/wm*.

Thanks for that hint.

>> But maybe you mean scripts/get_maintainer.pl, which I did try.
>> I found that using git log <that source file name> was better info
>> than using scripts/get_maintainer.pl.
> 
> get_maintainers is just a script that reads MAINTAINERS and trawls logs
> for it; the reason I mentioned MAINTAINERs was that you were saying you
> didn't use git.  In general you're better off doing things by hand
> rather than using get_maintainers.

Yes.

OK, I didn't mean to get into a blame game on this.
You mentioned stubs earlier and that's what is not working AFAICT.

Below is a patch that makes the 2 reported drivers build when
CONFIG_GPIOLIB is disabled and CONFIG_GENERIC_GPIO is disabled.
What do you think of the patch?


---
From: Randy Dunlap <randy.dunlap@oracle.com>

Make GPIOF_ defined values available even when GPIOLIB nor GENERIC_GPIO
is enabled by moving them to <linux/gpio.h>.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 include/asm-generic/gpio.h |   10 ----------
 include/linux/gpio.h       |   11 +++++++++++
 2 files changed, 11 insertions(+), 10 deletions(-)

--- linux-next-20110523.orig/include/asm-generic/gpio.h
+++ linux-next-20110523/include/asm-generic/gpio.h
@@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio
 
 extern int __gpio_to_irq(unsigned gpio);
 
-#define GPIOF_DIR_OUT	(0 << 0)
-#define GPIOF_DIR_IN	(1 << 0)
-
-#define GPIOF_INIT_LOW	(0 << 1)
-#define GPIOF_INIT_HIGH	(1 << 1)
-
-#define GPIOF_IN		(GPIOF_DIR_IN)
-#define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)
-#define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
-
 /**
  * struct gpio - a structure describing a GPIO with configuration
  * @gpio:	the GPIO number
--- linux-next-20110523.orig/include/linux/gpio.h
+++ linux-next-20110523/include/linux/gpio.h
@@ -3,6 +3,17 @@
 
 /* see Documentation/gpio.txt */
 
+/* make these flag values available regardless of GPIO kconfig options */
+#define GPIOF_DIR_OUT	(0 << 0)
+#define GPIOF_DIR_IN	(1 << 0)
+
+#define GPIOF_INIT_LOW	(0 << 1)
+#define GPIOF_INIT_HIGH	(1 << 1)
+
+#define GPIOF_IN		(GPIOF_DIR_IN)
+#define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)
+#define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
+
 #ifdef CONFIG_GENERIC_GPIO
 #include <asm/gpio.h>
 

WARNING: multiple messages have this Message-ID (diff)
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: x86@kernel.org, Stephen Rothwell <sfr@canb.auug.org.au>,
	alsa-devel@alsa-project.org, linux-next@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Harald Welte <laforge@gnufiish.org>,
	Dmitry Artamonow <mad_soft@inbox.ru>,
	Grant Likely <grant.likely@secretlab.ca>
Subject: [PATCH/RFC] gpio: add GPIOF_ values regardless on kconfig settings
Date: Mon, 23 May 2011 21:58:39 -0700	[thread overview]
Message-ID: <4DDB3AFF.9030006@oracle.com> (raw)
In-Reply-To: <20110524014959.GA27710@opensource.wolfsonmicro.com>

On 05/23/11 18:50, Mark Brown wrote:
> On Mon, May 23, 2011 at 06:21:51PM -0700, Randy Dunlap wrote:
>> On 05/23/11 17:08, Mark Brown wrote:
> 
>>> No, really we should.  The GPIO APIs are stubbed out when not in use for
>>> a very good reason, think about the usability here.  The goal here isn't
>>> to litter the code with ifdefs - if architectures aren't able to keep up
>>> with API changes they should convert to using gpiolib so this stuff
>>> happens automatically (indeed, I can't think of any good reason for an
>>> architecture to not be using gpiolib at this point).
> 
>> No, I would say that there are a lot of drivers in sound/soc/codecs/
>> that are missing some GPIO pieces in the Kconfig file.
> 
> Have you actually looked at the code here?  Vanishingly few of the
> drivers need GPIOs at all, they can just optionally use GPIOs if the
> system makes them available.  There is absolutely no dependency on GPIOs
> for them, anything in Kconfig would be entirely unconstructive.
> 
>>>> MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
> 
>>> You've clearly not looked at MAINTAINERS for this one.
> 
>> It's not listed in the MAINTAINERS file.
> 
> MAINTAINERS has a pattern sound/soc/codecs/wm*.

Thanks for that hint.

>> But maybe you mean scripts/get_maintainer.pl, which I did try.
>> I found that using git log <that source file name> was better info
>> than using scripts/get_maintainer.pl.
> 
> get_maintainers is just a script that reads MAINTAINERS and trawls logs
> for it; the reason I mentioned MAINTAINERs was that you were saying you
> didn't use git.  In general you're better off doing things by hand
> rather than using get_maintainers.

Yes.

OK, I didn't mean to get into a blame game on this.
You mentioned stubs earlier and that's what is not working AFAICT.

Below is a patch that makes the 2 reported drivers build when
CONFIG_GPIOLIB is disabled and CONFIG_GENERIC_GPIO is disabled.
What do you think of the patch?


---
From: Randy Dunlap <randy.dunlap@oracle.com>

Make GPIOF_ defined values available even when GPIOLIB nor GENERIC_GPIO
is enabled by moving them to <linux/gpio.h>.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 include/asm-generic/gpio.h |   10 ----------
 include/linux/gpio.h       |   11 +++++++++++
 2 files changed, 11 insertions(+), 10 deletions(-)

--- linux-next-20110523.orig/include/asm-generic/gpio.h
+++ linux-next-20110523/include/asm-generic/gpio.h
@@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio
 
 extern int __gpio_to_irq(unsigned gpio);
 
-#define GPIOF_DIR_OUT	(0 << 0)
-#define GPIOF_DIR_IN	(1 << 0)
-
-#define GPIOF_INIT_LOW	(0 << 1)
-#define GPIOF_INIT_HIGH	(1 << 1)
-
-#define GPIOF_IN		(GPIOF_DIR_IN)
-#define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)
-#define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
-
 /**
  * struct gpio - a structure describing a GPIO with configuration
  * @gpio:	the GPIO number
--- linux-next-20110523.orig/include/linux/gpio.h
+++ linux-next-20110523/include/linux/gpio.h
@@ -3,6 +3,17 @@
 
 /* see Documentation/gpio.txt */
 
+/* make these flag values available regardless of GPIO kconfig options */
+#define GPIOF_DIR_OUT	(0 << 0)
+#define GPIOF_DIR_IN	(1 << 0)
+
+#define GPIOF_INIT_LOW	(0 << 1)
+#define GPIOF_INIT_HIGH	(1 << 1)
+
+#define GPIOF_IN		(GPIOF_DIR_IN)
+#define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)
+#define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
+
 #ifdef CONFIG_GENERIC_GPIO
 #include <asm/gpio.h>
 

  reply	other threads:[~2011-05-24  4:58 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23  5:45 linux-next: Tree for May 23 Stephen Rothwell
2011-05-23 16:42 ` linux-next: Tree for May 23 (infiniband + netlink) Randy Dunlap
     [not found]   ` <20110523094205.4a5651d2.randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2011-05-23 18:05     ` Roland Dreier
2011-05-23 18:05       ` Roland Dreier
     [not found]       ` <BANLkTindDsbE-Fdr5-Db4Kw6ww+ntk2S2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-23 21:37         ` Or Gerlitz
     [not found]           ` <BANLkTikaiNZfMV8o_=xmuHrhM_O-tq4cDw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-23 22:51             ` Roland Dreier
2011-05-23 17:43 ` [PATCH -next] x86: apic_flat_64.c needs module.h Randy Dunlap
2011-05-23 17:51   ` Cyrill Gorcunov
2011-05-23 18:09     ` Cyrill Gorcunov
2011-05-23 18:12       ` Randy Dunlap
2011-05-23 18:35         ` Cyrill Gorcunov
2011-05-23 19:10         ` Ingo Molnar
2011-05-23 19:26           ` Ingo Molnar
2011-05-23 19:31   ` [tip:x86/apic] x86, apic: Include module.h header in apic_flat_64.c tip-bot for Randy Dunlap
2011-05-23 17:49 ` linux-next: Tree for May 23 (hwmon/coretemp.c) Randy Dunlap
2011-05-23 17:49   ` [lm-sensors] " Randy Dunlap
2011-05-23 18:03   ` Guenter Roeck
2011-05-23 18:03     ` [lm-sensors] " Guenter Roeck
2011-05-23 18:03     ` Guenter Roeck
2011-05-23 18:35 ` [PATCH -next] target: fix tfc_io.c printk format warning Randy Dunlap
2011-05-23 20:47   ` Nicholas A. Bellinger
2011-06-16 18:35     ` Randy Dunlap
2011-05-23 18:37 ` [PATCH -next] mtd: fix physmap.h warnings Randy Dunlap
2011-05-23 18:37   ` Randy Dunlap
2011-05-24  5:53   ` Artem Bityutskiy
2011-05-24  5:53     ` Artem Bityutskiy
2011-05-24  5:58     ` Artem Bityutskiy
2011-05-24  5:58       ` Artem Bityutskiy
2011-05-24  7:40       ` Russell King
2011-05-24  7:40         ` Russell King
2011-05-24  7:40         ` Artem Bityutskiy
2011-05-24  7:40           ` Artem Bityutskiy
2011-05-24  7:42         ` Artem Bityutskiy
2011-05-24  7:42           ` Artem Bityutskiy
2011-06-01  7:45           ` Artem Bityutskiy
2011-06-01  7:45             ` Artem Bityutskiy
2011-06-01  7:45             ` Artem Bityutskiy
2011-06-01  8:05             ` Russell King
2011-06-01  8:05               ` Russell King
2011-05-24  7:41   ` Artem Bityutskiy
2011-05-24  7:41     ` Artem Bityutskiy
2011-05-23 20:48 ` linux-next: Tree for May 23 (sound/soc/codecs) Randy Dunlap
2011-05-23 20:48   ` Randy Dunlap
2011-05-23 22:47   ` Mark Brown
2011-05-23 22:53     ` Randy Dunlap
2011-05-23 22:53       ` Randy Dunlap
2011-05-24  0:08       ` Mark Brown
2011-05-24  1:21         ` Randy Dunlap
2011-05-24  1:21           ` Randy Dunlap
2011-05-24  1:50           ` Mark Brown
2011-05-24  4:58             ` Randy Dunlap [this message]
2011-05-24  4:58               ` [PATCH/RFC] gpio: add GPIOF_ values regardless on kconfig settings Randy Dunlap
2011-05-24  5:23               ` Dmitry Artamonow
2011-05-24  5:23                 ` Dmitry Artamonow
2011-05-24 19:44                 ` Randy Dunlap
2011-05-24 19:44                   ` Randy Dunlap
2011-05-24  7:52               ` Mark Brown
2011-05-24  7:52                 ` [alsa-devel] " Mark Brown
2011-05-27  7:45                 ` Grant Likely
2011-05-27 17:46                   ` [PATCH] " Randy Dunlap
2011-05-27 17:46                     ` Randy Dunlap
2011-05-27 20:12                     ` Grant Likely
2011-06-03 17:04                       ` Grant Likely
2011-06-03 17:04                         ` Grant Likely
2011-06-03 17:18                         ` Mark Brown
2011-06-03 17:42                           ` Grant Likely
2011-06-06  3:45                             ` Randy Dunlap
2011-06-06  3:45                               ` Randy Dunlap
2011-06-14 16:12                               ` Randy Dunlap
2011-06-14 16:12                                 ` Randy Dunlap
2011-06-14 16:13                                 ` Grant Likely
2011-06-15  0:03                                   ` Randy Dunlap
2011-06-15  0:03                                     ` Randy Dunlap
2011-06-15  0:05                                   ` [PATCH 1/2] " Randy Dunlap
2011-06-15  0:05                                     ` Randy Dunlap
2011-06-16 14:37                                     ` Grant Likely
2011-06-15  0:06                                   ` [PATCH 2/2] gpio: include linux/gpio.h where needed Randy Dunlap
2011-06-15  0:06                                     ` Randy Dunlap
2011-06-15  0:34                                     ` Stephen Rothwell
2011-06-15 17:59                                       ` Randy Dunlap
2011-06-15 19:21                                         ` Grant Likely
2011-06-15 19:21                                           ` Grant Likely
2011-06-16 14:37                                     ` Grant Likely

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=4DDB3AFF.9030006@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=laforge@gnufiish.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mad_soft@inbox.ru \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.