lkml.org 
[lkml]   [2016]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 1/2] staging: iio: ad7606: replace range/range_available with corresponding scale
    From
    Date
    On 11/14/2016 05:58 PM, Linus Walleij wrote:
    > On Sat, Nov 12, 2016 at 3:24 PM, Jonathan Cameron <jic23@kernel.org> wrote:
    >
    >> Is it just me who thought, we need a fixed GPI like a fixed regulator?
    >> Would allow this sort of fixed wiring to be simply defined.
    >>
    >> Linus, worth exploring?
    >
    > So if fixed regulator is for a voltage provider, this would be
    > pretty much the inverse: deciding for a voltage range by switching
    > a GPIO.

    It's about figuring out the setting of a "GPIO" that can't be changed from
    software.

    Devices sometimes, instead of a configuration bus like I2C or SPI, use
    simple input pins, that can either be set to high or low, to allow software
    the state of the device. The GPIO API is typically used to configure these pins.

    This works fine as long as the pin is connected to a GPIO. But sometimes the
    system designer decides that a settings does not need to be configurable, in
    this case the pin will be tied to logic low or high directly on the PCB
    without any GPIO controller being involved.

    Sometimes a driver wants to know how the pin is wired up so it can report to
    userspace this part runs in the following mode and the mode can't be
    changed. In a sense it is like a reverse GPIO hog.

    Considering that this is a common usecase the question was how this can be
    implemented in a driver independent way to avoid code duplication and
    slightly different variations of what is effectively the same DT/ACPI binding.

    E.g. lets say for a configurable pin you use

    range-gpio = <&gpio ...>;

    and for a static pin

    range-gpio-fixed = <1>;

    Or something similar.

    \
     
     \ /
      Last update: 2016-11-14 19:54    [W:3.995 / U:0.224 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site