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