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

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

 



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

Signed-off-by: Bartosz Golaszewski <brgl@xxxxxxxx>
---
 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




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux