Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-26 Thread Linus Walleij
On Mon, May 25, 2020 at 5:17 PM Kent Gibson wrote: > > I suppose gpiolib would have to steal or intercept the interrupt > > by using e.g. IRQF_SHARED and then just return IRQ_HANDLED > > on the first IRQ so the underlying irq handler does not get called. > > And how would gpiolib ensure that it w

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-25 Thread Kent Gibson
On Mon, May 25, 2020 at 02:17:41PM +0200, Linus Walleij wrote: > On Mon, May 25, 2020 at 4:22 AM Kent Gibson wrote: > > > You mention timers for the gpio pins that cannot provide debounce, > > so I'm confused. Could you clarify which strategy you have in mind? > > My idea is that the callback gp

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-25 Thread Linus Walleij
On Mon, May 25, 2020 at 4:22 AM Kent Gibson wrote: > You mention timers for the gpio pins that cannot provide debounce, > so I'm confused. Could you clarify which strategy you have in mind? My idea is that the callback gpiod_set_debounce() for in-kernel consumers should more or less always retur

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-24 Thread Kent Gibson
On Wed, Apr 29, 2020 at 02:38:13PM +0200, Linus Walleij wrote: > On Wed, Apr 29, 2020 at 2:06 PM Bartosz Golaszewski wrote: > > > I understand the need to set debounce time to make line events > > reliable. As I see it: there'll be a couple steps to add this. > > I think there is a serious user-

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-14 Thread Linus Walleij
On Thu, May 7, 2020 at 5:40 AM Kent Gibson wrote: > > This would of course add a lot of cruft to the uAPI code. I'd start by > > moving it out of drivers/gpio/gpiolib.c into a new file: > > drivers/gpio/gpiolib-cdev.c. This way we'd have everything related to > > the character device in one place

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-12 Thread Kent Gibson
On Tue, May 12, 2020 at 07:55:42PM +0200, Linus Walleij wrote: > On Mon, May 4, 2020 at 12:32 PM Bartosz Golaszewski wrote: > I hope Bart doesn't mind if I jump in here, but I've started working on this so hopefully I can address most of your points... > > Ideally we'd have to introduce new ver

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-12 Thread Linus Walleij
On Mon, May 4, 2020 at 12:32 PM Bartosz Golaszewski wrote: > Ideally we'd have to introduce new versions of gpioevent_request, > gpioline_request, gpioline_info and gpioevent_data structs - this time > with enough additional padding and no alignment issues. Then we could > add the debounce proper

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-06 Thread Kent Gibson
On Mon, May 04, 2020 at 12:31:57PM +0200, Bartosz Golaszewski wrote: > czw., 30 kwi 2020 o 16:58 Kent Gibson napisał(a): > > > > On Thu, Apr 30, 2020 at 01:32:22PM +, Bujanda, Hector wrote: > > > Thanks all for your guidance! > > > > > > First saying that this patch request was sent having our

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-04 Thread Andy Shevchenko
On Wed, Apr 29, 2020 at 3:09 PM Bartosz Golaszewski wrote: > niedz., 19 kwi 2020 o 02:19 Hector Bujanda > napisał(a): ... > Finally: we can extend the gpiohandle_config structure with a field > containing the debounce time which would be read by the kernel if the > debounce flag is set in gpio

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-05-04 Thread Bartosz Golaszewski
czw., 30 kwi 2020 o 16:58 Kent Gibson napisał(a): > > On Thu, Apr 30, 2020 at 01:32:22PM +, Bujanda, Hector wrote: > > Thanks all for your guidance! > > > > First saying that this patch request was sent having our platforms in k4.14 > > in the way of upgrading to k5.4. > > In those versions t

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-30 Thread Kent Gibson
On Thu, Apr 30, 2020 at 01:32:22PM +, Bujanda, Hector wrote: > Thanks all for your guidance! > > First saying that this patch request was sent having our platforms in k4.14 > in the way of upgrading to k5.4. > In those versions the commit e588bb1eae31be73fbec2b731be986a7c09635a4 "gpio: > add

RE: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-30 Thread Bujanda, Hector
9 de abril de 2020 15:00 To: Linus Walleij Cc: Bujanda, Hector ; open list:GPIO SUBSYSTEM ; Linux Kernel Mailing List ; Kent Gibson Subject: Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL śr., 29 kwi 2020 o 14:38 Linus Walleij napisał(a): > > On Wed, Apr 29, 2020 at 2:06 PM Bartosz

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-29 Thread Bartosz Golaszewski
śr., 29 kwi 2020 o 14:38 Linus Walleij napisał(a): > > On Wed, Apr 29, 2020 at 2:06 PM Bartosz Golaszewski wrote: > > > I understand the need to set debounce time to make line events > > reliable. As I see it: there'll be a couple steps to add this. > > I think there is a serious user-facing prob

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-29 Thread Linus Walleij
On Wed, Apr 29, 2020 at 2:06 PM Bartosz Golaszewski wrote: > I understand the need to set debounce time to make line events > reliable. As I see it: there'll be a couple steps to add this. I think there is a serious user-facing problem here though, because not all GPIO controllers supports debou

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-29 Thread Bartosz Golaszewski
niedz., 19 kwi 2020 o 02:19 Hector Bujanda napisał(a): > > This allows calling gpiod_set_debounce function through char device ioctl. > > Signed-off-by: Hector Bujanda > --- Hi Hector, please keep in mind to Cc me on GPIO patches - especially when touching uAPI. For uAPI you can also Cc Kent Gi

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-28 Thread Kent Gibson
On Tue, Apr 28, 2020 at 12:35:05PM +0200, Linus Walleij wrote: > Hi Hector, > > thanks for your patch! > > On Sun, Apr 19, 2020 at 2:22 AM Hector Bujanda > wrote: > > > This allows calling gpiod_set_debounce function through char device ioctl. > > > > Signed-off-by: Hector Bujanda > > (...)

Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL

2020-04-28 Thread Linus Walleij
Hi Hector, thanks for your patch! On Sun, Apr 19, 2020 at 2:22 AM Hector Bujanda wrote: > This allows calling gpiod_set_debounce function through char device ioctl. > > Signed-off-by: Hector Bujanda (...) > +/** > + * struct gpioline_debounce - GPIO line debounce > + * @line_offset: the local