linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jack Winch <sunt.un.morcov@gmail.com>,
	Helmut Grohne <helmut.grohne@intenta.de>
Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [libgpiod][PATCH 3/4] API: add an AS_IS value for bias setting
Date: Mon, 21 Jun 2021 21:18:29 +0200	[thread overview]
Message-ID: <20210621191830.10628-4-brgl@bgdev.pl> (raw)
In-Reply-To: <20210621191830.10628-1-brgl@bgdev.pl>

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

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


  parent reply	other threads:[~2021-06-21 19:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 19:18 [libgpiod][PATCH 0/4] libgpiod v2: C++ bindings Bartosz Golaszewski
2021-06-21 19:18 ` [libgpiod][PATCH 1/4] events: hide the *_read_fd() symbols from the API header Bartosz Golaszewski
2021-06-21 19:18 ` [libgpiod][PATCH 2/4] API: drop "peek" functions Bartosz Golaszewski
2021-06-21 19:18 ` Bartosz Golaszewski [this message]
2021-06-21 19:18 ` [libgpiod][PATCH 4/4] bindings: cxx: implement C++ bindings for libgpiod v2.0 Bartosz Golaszewski
2021-06-27  8:47   ` Kent Gibson
2021-06-28 11:30     ` Andy Shevchenko
2021-06-28 11:34       ` Kent Gibson
2021-06-28 11:53         ` Andy Shevchenko
2021-06-28 14:25           ` Kent Gibson
2021-07-02  8:50     ` Bartosz Golaszewski
2021-07-02 11:38       ` Kent Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210621191830.10628-4-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=helmut.grohne@intenta.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sunt.un.morcov@gmail.com \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).