[PATCH 2/9] gpiolib: implement gpio_direction_input/output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These are straight wrappers around existing functions, but with a name
that's more like their Linux counterparts.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 include/gpiod.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/gpiod.h b/include/gpiod.h
index 8abf86db8682..df02b86e1ee8 100644
--- a/include/gpiod.h
+++ b/include/gpiod.h
@@ -57,12 +57,22 @@ static inline int gpiod_get(struct device *dev,
 	return dev_gpiod_get(dev, dev->of_node, _con_id, flags, NULL);
 }
 
-static inline void gpiod_set_value(int gpio, bool value)
+static inline void gpiod_direction_input(int gpio)
+{
+	gpio_direction_input(gpio);
+}
+
+static inline void gpiod_direction_output(int gpio, bool value)
 {
 	if (gpio != -ENOENT)
 		gpio_direction_active(gpio, value);
 }
 
+static inline void gpiod_set_value(int gpio, bool value)
+{
+	gpiod_direction_output(gpio, value);
+}
+
 static inline int gpiod_get_value(int gpio)
 {
 	if (gpio < 0)
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux