Skip to contentSkip to conversation

gpio: fix bits conflict for gpio flags

PATCH Superseded Laxman Dewangan 1 participant 2 messages May 7, 2012 – May 14, 2012 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: fix bits conflict for gpio flags

The bit 2 and 3 in GPIO flag are allocated for the flag OPEN_DRAIN/OPEN_SOURCE. These bits are reused for the flag EXPORT/EXPORT_CHANGEABLE and so creating conflict.
Fix this conflict by allocating bit 4 and 5 for the flag EXPORT/EXPORT_CHANGEABLE.

---
This is broken by commit
commit fc3a1f04f5040255cbc086c419e4237f29f89f88
Author: Wolfram Sang <[email protected]>

gpio: add flags to export GPIOs when requesting

 include/linux/gpio.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/gpio.h +2 -2
index d1890d4..0118141 100644
@@ -20,8 +20,8 @@
 /* Gpio pin is open source */
 #define GPIOF_OPEN_SOURCE	(1 << 3)
 
-#define GPIOF_EXPORT		(1 << 2)
-#define GPIOF_EXPORT_CHANGEABLE	(1 << 3)
+#define GPIOF_EXPORT		(1 << 4)
+#define GPIOF_EXPORT_CHANGEABLE	(1 << 5)
 #define GPIOF_EXPORT_DIR_FIXED	(GPIOF_EXPORT)
 #define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)
 
Signature · 1 line
1.7.1.1
#1 lore raw

Grant,

Quoted 7 lines · Laxman Dewangan

The bit 2 and 3 in GPIO flag are allocated for the flag OPEN_DRAIN/OPEN_SOURCE. These bits are reused for the flag EXPORT/EXPORT_CHANGEABLE and so creating conflict.
Fix this conflict by allocating bit 4 and 5 for the flag EXPORT/EXPORT_CHANGEABLE.

Quoted 8 lines

---
This is broken by commit
commit fc3a1f04f5040255cbc086c419e4237f29f89f88
Author: Wolfram Sang<[email protected]>

gpio: add flags to export GPIOs when requesting

It would be good if it go to 3.5.

Thanks,
Laxman