gpio.h 1.2 KB

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