lkml.org 
[lkml]   [2011]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpio: add flags to export GPIOs when requesting
Hi Wolfram,
On 11/16/2011 12:44 AM, Wolfram Sang wrote:
> Introduce new flags to automatically export GPIOs when using the convenience
> functions gpio_request_one() or gpio_request_array(). This eases support for
> custom boards where lots of GPIOs need to be exported for customer
> applications.

Adding GPIO maintainer Grant Likely to CC.

> +#define GPIOF_EXPORT (1 << 2)
> +#define GPIOF_EXPORT_CHANGEABLE (1 << 3)
> +#define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT)
> +#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)

Maybe, it's better to write like this:

#define GPIOF_EXPORT (1 << 2)
#define GPIOF_EXPORT_DIR_CHANGEABLE (3 << 2)

So you don't need additional defines (GPIOF_EXPORT_DIR_FIXED and
GPIOF_EXPORT_DIR_CHANGEABLE). This will not brake your logic and improve
readability IMHO.

--
Best regards, Denis Kuzmenko.


\
 
 \ /
  Last update: 2011-11-16 00:07    [W:0.085 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site