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

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

 



On Mon, Jan 11, 2021 at 02:34:23PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>
> 
> 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.




[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