]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL
authorKent Gibson <warthog618@gmail.com>
Mon, 28 Sep 2020 00:27:55 +0000 (08:27 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 30 Sep 2020 08:56:52 +0000 (10:56 +0200)
commit9bacc9f5599324213f77e4957ec16fe29a5e1794
tree31d9b4821c4b8cfe15b9c76fb6fc59297eed34fd
parent5f251acf7c6a0439016042f97186eef9a1e1b586
gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL

Add support for GPIO_V2_GET_LINEINFO_IOCTL and
GPIO_V2_GET_LINEINFO_WATCH_IOCTL.

The core of this change is the event kfifo switching to contain
struct gpioline_info_changed_v2, instead of v1 as v2 is richer.

The two uAPI versions are mostly independent - other than where they both
provide line info changes via reads on the chip fd.  As the info change
structs differ between v1 and v2, the infowatch implementation tracks which
version of the infowatch ioctl, either GPIO_GET_LINEINFO_WATCH_IOCTL or
GPIO_V2_GET_LINEINFO_WATCH_IOCTL, initiates the initial watch and returns
the corresponding info change struct to the read.  The version supported
on that fd locks to that version on the first watch request, so subsequent
watches from that process must use the same uAPI version.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib-cdev.c