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:	Thu, 5 Sep 2013 12:45:04 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	Stephen Warren <swarren@...dotorg.org>
Cc:	Alexandre Courbot <acourbot@...dia.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Arnd Bergmann <arnd@...db.de>,
	Grant Likely <grant.likely@...aro.org>,
	Thierry Reding <thierry.reding@...il.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	linux-doc@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-arch <linux-arch@...r.kernel.org>,
	devicetree@...r.kernel.org
Subject: Re: [RFC 2/5] gpiolib: export descriptor-based GPIO interface

On Thu, Sep 5, 2013 at 4:58 AM, Stephen Warren <swarren@...dotorg.org> wrote:
> On 09/04/2013 05:29 AM, Alexandre Courbot wrote:
>> This patch exports the gpiod_* family of API functions, a safer
>> alternative to the legacy gpio interface. Differences between the gpiod
>> and gpio APIs are:
>>
>> - gpio works with integers, whereas gpiod operates on opaque handlers
>>   which cannot be forged or used before proper acquisition
>> - gpiod get/set functions are aware of the active low state of a GPIO
>> - gpio consumers should now include <linux/gpio/consumer.h> to access
>>   the new interface, whereas chips drivers will use
>>   <linux/gpio/driver.h>
>>
>> The legacy gpio API is now built as inline functions on top of gpiod.
>>
>
>> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
>
>> +struct gpio_chip {
>
>> +     int                     (*get_direction)(struct gpio_chip *chip,
>> +                                             unsigned offset);
>> +     int                     (*direction_input)(struct gpio_chip *chip,
>> +                                             unsigned offset);
>> +     int                     (*get)(struct gpio_chip *chip,
>> +                                             unsigned offset);
>> +     int                     (*direction_output)(struct gpio_chip *chip,
>> +                                             unsigned offset, int value);
>> +     int                     (*set_debounce)(struct gpio_chip *chip,
>> +                                             unsigned offset,
>> +                                             unsigned debounce);
>> +
>> +     void                    (*set)(struct gpio_chip *chip,
>> +                                             unsigned offset, int value);
>> +
>
> Minor nit: It might be nice to sort/group these entries more cohesively,
> i.e. get_direction, direction_input, direction_output, get, set,
> set_debounce?

Sure, since we are moving this around anyway... :)

Alex.
--
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