From 5077b3ecedae1093511da0599e66dac8e3c28412 Mon Sep 17 00:00:00 2001
From: 3moredays <azureqaq@gmail.com>
Date: Fri, 17 May 2024 15:58:38 +0800
Subject: [PATCH] extend linerequest flags

add BIAS_PULL_UP BIAS_PULL_DOWN BIAS_DISABLE which available since 5.5

https://elixir.bootlin.com/linux/v5.5/source/include/uapi/linux/gpio.h#L62
---
 .gitignore | 4 +++-
 Cargo.toml | 1 +
 src/lib.rs | 7 +++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 143b1ca..be39b2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
-
 /target/
 **/*.rs.bk
 Cargo.lock
+
+/.cargo
+/.vscode
diff --git a/Cargo.toml b/Cargo.toml
index c7d44a9..0c10854 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,6 +27,7 @@ tokio = { version = "1", features = ["io-std", "net"], optional = true }
 futures = { version = "0.3", optional = true }
 
 [dev-dependencies]
+ignore = "=0.4.20" # dep of `quicli`, make it compatible with rust 1.65.0
 quicli = "0.4"
 structopt = "0.3"
 anyhow = "1.0"
diff --git a/src/lib.rs b/src/lib.rs
index b8b6506..9dab370 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -356,6 +356,13 @@ bitflags! {
         const ACTIVE_LOW = (1 << 2);
         const OPEN_DRAIN = (1 << 3);
         const OPEN_SOURCE = (1 << 4);
+        // https://elixir.bootlin.com/linux/v5.5/source/include/uapi/linux/gpio.h#L30
+        /// Available since Linux Kernel 5.5
+        const BIAS_PULL_UP = (1 << 5);
+        /// Available since Linux Kernel 5.5
+        const BIAS_PULL_DOWN = (1 << 6);
+        /// Available since Linux Kernel 5.5
+        const BIAS_PULL_DISABLE = (1 << 7);
     }
 }