Thread (12 messages) 12 messages, 4 authors, 2021-07-02

[libgpiod][PATCH 3/4] API: add an AS_IS value for bias setting

From: Bartosz Golaszewski <hidden>
Date: 2021-06-21 19:18:40
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

We don't have an explicit default "as-is" value for the bias setting.
This adds it.

Signed-off-by: Bartosz Golaszewski <redacted>
---
 include/gpiod.h   | 4 +++-
 lib/line-config.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/gpiod.h b/include/gpiod.h
index 3671c2d..629601a 100644
--- a/include/gpiod.h
+++ b/include/gpiod.h
@@ -451,7 +451,9 @@ enum {
  * @brief Available internal bias settings for line requests.
  */
 enum {
-	GPIOD_LINE_CONFIG_BIAS_DISABLED = 1,
+	GPIOD_LINE_CONFIG_BIAS_AS_IS = 1,
+	/**< Don't change the current bias setting. */
+	GPIOD_LINE_CONFIG_BIAS_DISABLED,
 	/**< The internal bias should be disabled (the default). */
 	GPIOD_LINE_CONFIG_BIAS_PULL_UP,
 	/**< The internal pull-up bias is enabled. */
diff --git a/lib/line-config.c b/lib/line-config.c
index 5b6dab4..24dc5f4 100644
--- a/lib/line-config.c
+++ b/lib/line-config.c
@@ -496,6 +496,7 @@ static int gpiod_make_kernel_flags(uint64_t *flags, struct base_config *config)
 	case GPIOD_LINE_CONFIG_BIAS_PULL_DOWN:
 		*flags |= GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN;
 		break;
+	case GPIOD_LINE_CONFIG_BIAS_AS_IS:
 	case 0:
 		break;
 	default:
-- 
2.30.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help