lkml.org 
[lkml]   [2011]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectgpio_set_debounce return value specification
Regarding gpio_set_debounce, declared in include/linux/gpio.h, defined in drivers/gpio/gpiolib.c

The return value for gpio_set_debounce isn't clearly specified.  The current use of the return value appears to be 0 on success, <0 on error.  Because many hardware implementations allow only specific debounce intervals, the actual debounce setting after calling gpio_set_debounce is unlikely to be the argument with which it was called.

I suggest that on success, the return value should be a positive integer indicating, in microseconds, the actual debounce interval which has been applied.  A value of 0 would indicate that the debounce was applied successfully, but the driver does not support this reporting.

The current code in gpiolib.c would support this without change.   A documentation change to gpiolib.c and gpio.h would be necessary.

Brendan Moran

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

\
 
 \ /
  Last update: 2011-07-21 22:55    [W:0.091 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site