priv.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. struct nvkm_gpio_func {
  6. int lines;
  7. /* read and ack pending interrupts, returning only data
  8. * for lines that have not been masked off, while still
  9. * performing the ack for anything that was pending.
  10. */
  11. void (*intr_stat)(struct nvkm_gpio *, u32 *, u32 *);
  12. /* mask on/off interrupts for hi/lo transitions on a
  13. * given set of gpio lines
  14. */
  15. void (*intr_mask)(struct nvkm_gpio *, u32, u32, u32);
  16. /* configure gpio direction and output value */
  17. int (*drive)(struct nvkm_gpio *, int line, int dir, int out);
  18. /* sense current state of given gpio line */
  19. int (*sense)(struct nvkm_gpio *, int line);
  20. /*XXX*/
  21. void (*reset)(struct nvkm_gpio *, u8);
  22. };
  23. int nvkm_gpio_new_(const struct nvkm_gpio_func *, struct nvkm_device *,
  24. int index, struct nvkm_gpio **);
  25. void nv50_gpio_reset(struct nvkm_gpio *, u8);
  26. int nv50_gpio_drive(struct nvkm_gpio *, int, int, int);
  27. int nv50_gpio_sense(struct nvkm_gpio *, int);
  28. void g94_gpio_intr_stat(struct nvkm_gpio *, u32 *, u32 *);
  29. void g94_gpio_intr_mask(struct nvkm_gpio *, u32, u32, u32);
  30. void gf119_gpio_reset(struct nvkm_gpio *, u8);
  31. int gf119_gpio_drive(struct nvkm_gpio *, int, int, int);
  32. int gf119_gpio_sense(struct nvkm_gpio *, int);
  33. #endif