diff mbox series

fmc: Decouple from Linux GPIO subsystem

Message ID 20190608231430.22916-1-linus.walleij@linaro.org
State Accepted
Commit 7fae8a9ced742f364604a88a53084f471cc9c6e5
Headers show
Series fmc: Decouple from Linux GPIO subsystem | expand

Commit Message

Linus Walleij June 8, 2019, 11:14 p.m. UTC
FMC has its own GPIO handling, the inclusion of <linux/gpio.h>
is only to reuse some flags that we can just as well provide
using local defines.

Cc: Federico Vaga <federico.vaga@cern.ch>
Cc: Pat Riehecky <riehecky@fnal.gov>
Cc: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
I will merge this into the GPIO tree unless there are protests
against it.
---
 drivers/fmc/fmc-trivial.c |  1 -
 include/linux/fmc.h       | 18 ++++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.20.1

Comments

Alessandro Rubini June 10, 2019, 6:14 a.m. UTC | #1
> FMC has its own GPIO handling, the inclusion of <linux/gpio.h>

> is only to reuse some flags that we can just as well provide

> using local defines.

> 

> Cc: Federico Vaga <federico.vaga@cern.ch>

> Cc: Pat Riehecky <riehecky@fnal.gov>

> Cc: Alessandro Rubini <rubini@gnudd.com>

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


Acked-by: Alessandro Rubini <rubini@gnudd.com>
diff mbox series

Patch

diff --git a/drivers/fmc/fmc-trivial.c b/drivers/fmc/fmc-trivial.c
index 8defdee3e3a3..b99dbc7ee203 100644
--- a/drivers/fmc/fmc-trivial.c
+++ b/drivers/fmc/fmc-trivial.c
@@ -15,7 +15,6 @@ 
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/gpio.h>
 #include <linux/fmc.h>
 
 static struct fmc_driver t_drv; /* initialized later */
diff --git a/include/linux/fmc.h b/include/linux/fmc.h
index 3dc8a1b2db7b..f0d482d29df7 100644
--- a/include/linux/fmc.h
+++ b/include/linux/fmc.h
@@ -101,7 +101,7 @@  struct fmc_gpio {
 	char *carrier_name; /* name or NULL for virtual pins */
 	int gpio;
 	int _gpio;	/* internal use by the carrier */
-	int mode;	/* GPIOF_DIR_OUT etc, from <linux/gpio.h> */
+	int mode;	/* GPIOF_DIR_OUT etc */
 	int irqmode;	/* IRQF_TRIGGER_LOW and so on */
 };
 
@@ -115,13 +115,15 @@  struct fmc_gpio {
 #define FMC_GPIO_USER(x)	((x) + 0x1400)	/*  256 of them */
 /* We may add SCL and SDA, or other roles if the need arises */
 
-/* GPIOF_DIR_IN etc are missing before 3.0. copy from <linux/gpio.h> */
-#ifndef GPIOF_DIR_IN
-#  define GPIOF_DIR_OUT   (0 << 0)
-#  define GPIOF_DIR_IN    (1 << 0)
-#  define GPIOF_INIT_LOW  (0 << 1)
-#  define GPIOF_INIT_HIGH (1 << 1)
-#endif
+/*
+ * These are similar to the legacy Linux GPIO defines from <linux/gpio.h>
+ * but in fact FMC has its own GPIO handling and is not using the Linux
+ * GPIO subsystem.
+ */
+#define GPIOF_DIR_OUT   (0 << 0)
+#define GPIOF_DIR_IN    (1 << 0)
+#define GPIOF_INIT_LOW  (0 << 1)
+#define GPIOF_INIT_HIGH (1 << 1)
 
 /*
  * The operations are offered by each carrier and should make driver