linux/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h
<<
>>
Prefs
   1#ifndef __NVKM_GPIO_PRIV_H__
   2#define __NVKM_GPIO_PRIV_H__
   3#define nvkm_gpio(p) container_of((p), struct nvkm_gpio, subdev)
   4#include <subdev/gpio.h>
   5
   6struct nvkm_gpio_func {
   7        int lines;
   8
   9        /* read and ack pending interrupts, returning only data
  10         * for lines that have not been masked off, while still
  11         * performing the ack for anything that was pending.
  12         */
  13        void (*intr_stat)(struct nvkm_gpio *, u32 *, u32 *);
  14
  15        /* mask on/off interrupts for hi/lo transitions on a
  16         * given set of gpio lines
  17         */
  18        void (*intr_mask)(struct nvkm_gpio *, u32, u32, u32);
  19
  20        /* configure gpio direction and output value */
  21        int  (*drive)(struct nvkm_gpio *, int line, int dir, int out);
  22
  23        /* sense current state of given gpio line */
  24        int  (*sense)(struct nvkm_gpio *, int line);
  25
  26        /*XXX*/
  27        void (*reset)(struct nvkm_gpio *, u8);
  28};
  29
  30int nvkm_gpio_new_(const struct nvkm_gpio_func *, struct nvkm_device *,
  31                   int index, struct nvkm_gpio **);
  32
  33void nv50_gpio_reset(struct nvkm_gpio *, u8);
  34int  nv50_gpio_drive(struct nvkm_gpio *, int, int, int);
  35int  nv50_gpio_sense(struct nvkm_gpio *, int);
  36
  37void g94_gpio_intr_stat(struct nvkm_gpio *, u32 *, u32 *);
  38void g94_gpio_intr_mask(struct nvkm_gpio *, u32, u32, u32);
  39
  40void gf119_gpio_reset(struct nvkm_gpio *, u8);
  41int  gf119_gpio_drive(struct nvkm_gpio *, int, int, int);
  42int  gf119_gpio_sense(struct nvkm_gpio *, int);
  43#endif
  44