linux/include/linux/gpio_keys.h
<<
>>
Prefs
   1#ifndef _GPIO_KEYS_H
   2#define _GPIO_KEYS_H
   3
   4struct device;
   5struct gpio_desc;
   6
   7/**
   8 * struct gpio_keys_button - configuration parameters
   9 * @code:               input event code (KEY_*, SW_*)
  10 * @gpio:               %-1 if this key does not support gpio
  11 * @active_low:         %true indicates that button is considered
  12 *                      depressed when gpio is low
  13 * @desc:               label that will be attached to button's gpio
  14 * @type:               input event type (%EV_KEY, %EV_SW, %EV_ABS)
  15 * @wakeup:             configure the button as a wake-up source
  16 * @debounce_interval:  debounce ticks interval in msecs
  17 * @can_disable:        %true indicates that userspace is allowed to
  18 *                      disable button via sysfs
  19 * @value:              axis value for %EV_ABS
  20 * @irq:                Irq number in case of interrupt keys
  21 * @gpiod:              GPIO descriptor
  22 */
  23struct gpio_keys_button {
  24        unsigned int code;
  25        int gpio;
  26        int active_low;
  27        const char *desc;
  28        unsigned int type;
  29        int wakeup;
  30        int debounce_interval;
  31        bool can_disable;
  32        int value;
  33        unsigned int irq;
  34        unsigned int irq_flags;
  35        struct gpio_desc *gpiod;
  36};
  37
  38/**
  39 * struct gpio_keys_platform_data - platform data for gpio_keys driver
  40 * @buttons:            pointer to array of &gpio_keys_button structures
  41 *                      describing buttons attached to the device
  42 * @nbuttons:           number of elements in @buttons array
  43 * @poll_interval:      polling interval in msecs - for polling driver only
  44 * @rep:                enable input subsystem auto repeat
  45 * @enable:             platform hook for enabling the device
  46 * @disable:            platform hook for disabling the device
  47 * @name:               input device name
  48 */
  49struct gpio_keys_platform_data {
  50        struct gpio_keys_button *buttons;
  51        int nbuttons;
  52        unsigned int poll_interval;
  53        unsigned int rep:1;
  54        int (*enable)(struct device *dev);
  55        void (*disable)(struct device *dev);
  56        const char *name;
  57};
  58
  59#endif
  60