Skip to content
  • Kent Gibson's avatar
    gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL · aad95584
    Kent Gibson authored
    
    
    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: default avatarKent Gibson <warthog618@gmail.com>
    Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
    aad95584