lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43a2499484c2435eae63fe372f9b7b17@asem.it>
Date:   Tue, 29 Sep 2020 16:10:52 +0000
From:   Flavio Suligoi <f.suligoi@...m.it>
To:     Bartosz Golaszewski <brgl@...ev.pl>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC:     "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: How to use an ACPI declared GPIO in a userspace ...

Hi Bartosz,

> > I need to expose to the userspace a GPIO, physically connected to a
> board
> > push-button. This GPIO must expose a pre-defined name, such as
> > "user-push-button", so that the userspace applications can use it
> without
> > know any physical GPIO details.
> >
> > I can customize the board BIOS and so my goal is to add an ACPI table
> with
> > a content like this:
> >
> > ...
> > Scope (\_SB.GPO1)
> >         {
> >                 Device (BTNS)
> >                 {
> >                         Name (_HID, "PRP0001")
> >                         Name (_DDN, "GPIO buttons device")
> >
> >                         Name (_CRS, ResourceTemplate ()
> >                         {
> >                                 GpioIo (
> >                                 Exclusive,               // Not shared
> >                                 PullNone,                // No need for
> pulls
> >                                 0,                       // Debounce
> timeout
> >                                 0,                       // Drive
> strength
> >                                 IoRestrictionInputOnly,  // Only used as
> input
> >                                 "\\_SB.GPO1",            // GPIO
> controller
> >                                 0, ResourceConsumer, , ) // Must be 0
> >                                 {
> >                                         25,              // GPIO number
> >                                 }
> > ...
> >
> > I know that this GPIO can be used from other drivers.
> > For example I successfully tested it using the "gpio-keys" device
> driver,
> > giving to my GPIO a key-code and emulating in this way a keyboard key.
> > This could be a possible solution.
> >
> > But I prefer to expose my GPIO as a classic GPIO, not as a keyboard key.
> >
> > I was wondering if there is a generic GPIO driver that I can use to
> expose
> > this GPIO with its pre-defined name (caming from the ACPI table
> declaration),
> > to the userspace...
> >
> > Best regards,
> >
> > Flavio
> 
> Adding Andy who knows ACPI GPIO well.
> 
> In general, the "gpio-line-names" property is used for that and it's
> supported both for device tree as well as ACPI, although I have only
> ever used the former.
> 
> Bartosz

Thanks! I'll try!!!

Flavio

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ