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, 28 Oct 2014 13:11:50 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Arnd Bergmann <arnd@...db.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Grant Likely <grant.likely@...aro.org>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	Aaron Lu <aaron.lu@...el.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Bryan Wu <cooloney@...il.com>,
	Darren Hart <dvhart@...ux.intel.com>,
	Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH] ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs

On Tue, Oct 28, 2014 at 7:34 AM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> On Monday, October 27, 2014 02:21:23 PM Alexandre Courbot wrote:
>> On Sat, Oct 25, 2014 at 7:05 AM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>> >
>> > Provide a way for device drivers using GPIOs described by ACPI
>> > GpioIo resources in _CRS to tell the GPIO subsystem what names
>> > (connection IDs) to associate with specific GPIO pins defined
>> > in there.
>> >
>> > To do that, a driver needs to define a mapping table as a
>> > NULL-terminated array of struct acpi_gpio_mapping objects
>> > that each contain a name, a pointer to an array of pin data
>> > (struct acpi_gpio_params) objects and the size of that array.
>> >
>> > Each struct acpi_gpio_params object consists of three fields,
>> > crs_entry_index, pin_index, active_low, representing the index of
>> > the target GpioIo()/GpioInt() resource in _CRS starting from zero,
>> > the index of the target pin in that resource starting from zero,
>> > and the active-low flag for that pin, respectively.
>> >
>> > Next, the mapping table needs to be passed as the second argument to
>> > acpi_dev_add_driver_gpios() that will register it with the ACPI device
>> > object pointed to by its first argument.  That object must represent
>> > the ACPI namespace node containing the _CRS object referred to by the
>> > GPIO mapping.  That should be done in the driver's .probe() routine.
>> >
>> > On removal, the driver should unregister its GPIO mapping table
>> > by calling acpi_dev_remove_driver_gpios() on the ACPI device
>> > object where that table was previously registered.
>> >
>> > Included are fixes from Mika Westerberg.
>>
>> Acked-by: Alexandre Courbot <acourbot@...dia.com>
>>
>> As we discussed already, this is a great idea. The only thing that is
>> missing is a paragraph in Documentation/gpio/consumer.txt with an
>> explanation of the global mechanism and a simple example to illustrate
>> how and when this should be used.
>
> Yes, I'm going to provide documentation.
>
> One question, though.  We're already adding gpio-properties.txt under
> Documentation/acpi/ containing analogous information for _DSD-based
> mappings.  I thought I'd add a section to that file and a short paragraph
> pointing to it into consumer.txt, would that work?

Definitely yes, since this is ACPI-specific. Thanks!
--
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