Re: [PATCH] gpiolib: add GPIO_SET_DEBOUNCE_IOCTL
From: Linus Walleij <hidden>
Date: 2020-05-12 17:55:56
Also in:
lkml
On Mon, May 4, 2020 at 12:32 PM Bartosz Golaszewski [off-list ref] 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 properly.
Hm that sounds massive. Is it really that bad?
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. It would make it easier to: a) add a config option for disabling it entirely and b) add a config option to disable the v1 of the ioctl()s.
Its good to break out for code maintenance no matter what we do with it :) I would however not make it in any way totally optional, because the big win with the character device over the legacy sysfs is to always be available.
Linus: about the software-debounce you mentioned: do you think it somehow plugs the hole we identified here?
Hm, I don't quite understand what the hole is I guess... Linus