gpio.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __NVKM_GPIO_H__
  2. #define __NVKM_GPIO_H__
  3. #include <core/subdev.h>
  4. #include <core/event.h>
  5. #include <subdev/bios.h>
  6. #include <subdev/bios/gpio.h>
  7. struct nvkm_gpio_ntfy_req {
  8. #define NVKM_GPIO_HI 0x01
  9. #define NVKM_GPIO_LO 0x02
  10. #define NVKM_GPIO_TOGGLED 0x03
  11. u8 mask;
  12. u8 line;
  13. };
  14. struct nvkm_gpio_ntfy_rep {
  15. u8 mask;
  16. };
  17. struct nvkm_gpio {
  18. const struct nvkm_gpio_func *func;
  19. struct nvkm_subdev subdev;
  20. struct nvkm_event event;
  21. };
  22. void nvkm_gpio_reset(struct nvkm_gpio *, u8 func);
  23. int nvkm_gpio_find(struct nvkm_gpio *, int idx, u8 tag, u8 line,
  24. struct dcb_gpio_func *);
  25. int nvkm_gpio_set(struct nvkm_gpio *, int idx, u8 tag, u8 line, int state);
  26. int nvkm_gpio_get(struct nvkm_gpio *, int idx, u8 tag, u8 line);
  27. int nv10_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
  28. int nv50_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
  29. int g94_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
  30. int gf119_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
  31. int gk104_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
  32. #endif