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]
Date:	Tue, 23 Sep 2014 17:27:19 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alexandre Courbot <gnurou@...il.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Bryan Wu <cooloney@...il.com>,
	Lee Jones <lee.jones@...aro.org>,
	Grant Likely <grant.likely@...aro.org>,
	Arnd Bergmann <arnd@...db.de>, Aaron Lu <aaron.lu@...el.com>,
	Darren Hart <dvhart@...ux.intel.com>
Subject: Re: [RFC PATCH v2 06/16] gpio / ACPI: Add support for _DSD device properties

On Tue, Sep 16, 2014 at 1:52 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:

> With release of ACPI 5.1 and _DSD method we can finally name GPIOs (and
> other things as well) returned by _CRS. Previously we were only able to
> use integer index to find the corresponding GPIO, which is pretty error
> prone if the order changes.
>
> With _DSD we can now query GPIOs using name instead of an integer index,
> like the below example shows:
>
>   // Bluetooth device with reset and shutdown GPIOs
>   Device (BTH)
>   {
>       Name (_HID, ...)
>
>       Name (_CRS, ResourceTemplate ()
>       {
>           GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly,
>                   "\\_SB.GPO0", 0, ResourceConsumer) {15}
>           GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly,
>                   "\\_SB.GPO0", 0, ResourceConsumer) {27, 31}
>       })
>
>       Name (_DSD, Package ()
>       {
>           ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
>           Package ()
>           {
>               Package () {"reset-gpio", Package() {^BTH, 1, 1, 0 }},
>               Package () {"shutdown-gpio", Package() {^BTH, 0, 0, 0 }},
>           }
>       })
>   }
>
> The format of the supported GPIO property is:
>
>   Package () { "name", Package () { ref, index, pin, active_low }}
>
>   ref - The device that has _CRS containing GpioIo()/GpioInt() resources,
>         typically this is the device itself (BTH in our case).
>   index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero.
>   pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero.
>   active_low - If 1 the GPIO is marked as active_low.
>
> Since ACPI GpioIo() resource does not have field saying whether it is
> active low or high, the "active_low" argument can be used here. Setting
> it to 1 marks the GPIO as active low.
>
> In our Bluetooth example the "reset-gpio" refers to the second GpioIo()
> resource, second pin in that resource with the GPIO number of 31.
>
> This patch implements necessary support to gpiolib for extracting GPIOs
> using _DSD device properties.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

Acked-by: Linus Walleij <linus.walleij@...aro.org>

If Rafael is happy with this approach, and you decide to take it
through the ACPI tree.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ