Thread (22 messages) 22 messages, 5 authors, 2021-01-28

Re: [libgpiod][PATCH 3/6] treewide: rename BIAS_AS_IS to BIAS_NONE

From: Kent Gibson <warthog618@gmail.com>
Date: 2021-01-11 14:32:14

On Mon, Jan 11, 2021 at 02:34:23PM +0100, Bartosz Golaszewski wrote:
From: Bartosz Golaszewski <redacted>

When inspecting the current bias setting of a GPIO line, the AS_IS name
of one of the possible values really means that there's no bias so it
should be renamed to NONE for clarity.
I disagree this one, as the BIAS_NONE can be confused with BIAS_DISABLED.

Its meaning depends on whether you are setting or reading the value.
On write, for backwards compatibility, it means don't change the bias
from what it was previously, hence the AS-IS naming.
On read it means unknown, as the uAPI can't determine bias setting
unless it set it itself - so if it is set by DT then the cdev can't tell.

If you are going to change it I'd go with BIAS_UNKNOWN.

Cheers,
Kent.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help