1 #ifndef __NOUVEAU_GPIO_H__
2 #define __NOUVEAU_GPIO_H__
4 #include <core/subdev.h>
5 #include <core/device.h>
6 #include <core/event.h>
8 #include <subdev/bios.h>
9 #include <subdev/bios/gpio.h>
11 struct nvkm_gpio_ntfy_req {
12 #define NVKM_GPIO_HI 0x01
13 #define NVKM_GPIO_LO 0x02
14 #define NVKM_GPIO_TOGGLED 0x03
19 struct nvkm_gpio_ntfy_rep {
24 struct nouveau_subdev base;
26 struct nvkm_event event;
28 void (*reset)(struct nouveau_gpio *, u8 func);
29 int (*find)(struct nouveau_gpio *, int idx, u8 tag, u8 line,
30 struct dcb_gpio_func *);
31 int (*set)(struct nouveau_gpio *, int idx, u8 tag, u8 line, int state);
32 int (*get)(struct nouveau_gpio *, int idx, u8 tag, u8 line);
35 static inline struct nouveau_gpio *
36 nouveau_gpio(void *obj)
38 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_GPIO];
41 extern struct nouveau_oclass *nv10_gpio_oclass;
42 extern struct nouveau_oclass *nv50_gpio_oclass;
43 extern struct nouveau_oclass *nv94_gpio_oclass;
44 extern struct nouveau_oclass *nvd0_gpio_oclass;
45 extern struct nouveau_oclass *nve0_gpio_oclass;