Re: [PATCH] gpiolib-legacy: Request gpio without touching direction

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

 



On Fri, May 25, 2018 at 01:43:59PM +0200, Linus Walleij wrote:
> On Thu, May 24, 2018 at 3:01 PM, Einar Vading <einar.vading@xxxxxxxx> wrote:
> 
> Hi Einar,

Hi,

> 
> thanks for your patch!

thanks for taking the time to look at it.

> 
> Unfortunately it can not be applied.
> 
> > Adds function to request a gpio without touching the direction of the
> > gpio upon export.
> >
> > This is useful if some user space application know what state the gpio
> > should be in and it is important that this state is kept during reboot.
> >
> > Signed-off-by: Einar Vading <einarv@xxxxxxxx>
> 
> The sysfs ABI is deprecated since two years:
> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/Documentation/ABI/obsolete/sysfs-gpio?id=fe95046e960b4b76e73dc1486955d93f47276134
> 
> This means we do not extend or add features to the sysfs ABI.o

Ok, well it should be relatively easy to maintain this patch out of tree then =)

> 
> The new chardev ABI should be used for all new features to
> userspace. Here are the example tools for GPIO descriptor
> access:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/gpio
> 
> What is even more featured for commandline and apps is
> libgpiod:
> https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/

I know, and I'm dying to get to port our stuff over to use it. But time,
releases and business are in my way ATM.

> 
> If you want to add a new flag for not touching the direction
> of the GPIO when requesting, by patching
> include/uapi/linux/gpio.h then I'm all game for that!
> 
> We currently have these:
> /* Linerequest flags */
> #define GPIOHANDLE_REQUEST_INPUT        (1UL << 0)
> #define GPIOHANDLE_REQUEST_OUTPUT       (1UL << 1)
> #define GPIOHANDLE_REQUEST_ACTIVE_LOW   (1UL << 2)
> #define GPIOHANDLE_REQUEST_OPEN_DRAIN   (1UL << 3)
> #define GPIOHANDLE_REQUEST_OPEN_SOURCE  (1UL << 4)
> 
> We could definately add an "ASIS" flag if you can find a way to
> implement it nicely!

Sounds good, I'll look into it when I get that far.

> 
> Yours,
> Linus Walleij

// Einar
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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