2011-11-21 16:41:48 +10:00
|
|
|
#ifndef __NOUVEAU_GPIO_H__
|
|
|
|
#define __NOUVEAU_GPIO_H__
|
|
|
|
|
2012-07-10 12:20:17 +10:00
|
|
|
#include <core/subdev.h>
|
|
|
|
#include <core/device.h>
|
2013-02-03 12:56:16 +10:00
|
|
|
#include <core/event.h>
|
2011-11-21 16:41:48 +10:00
|
|
|
|
2012-07-10 12:20:17 +10:00
|
|
|
#include <subdev/bios.h>
|
|
|
|
#include <subdev/bios/gpio.h>
|
2011-11-21 16:41:48 +10:00
|
|
|
|
2014-08-10 04:10:20 +10:00
|
|
|
struct nvkm_gpio_ntfy_req {
|
|
|
|
#define NVKM_GPIO_HI 0x01
|
|
|
|
#define NVKM_GPIO_LO 0x02
|
|
|
|
#define NVKM_GPIO_TOGGLED 0x03
|
|
|
|
u8 mask;
|
|
|
|
u8 line;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nvkm_gpio_ntfy_rep {
|
|
|
|
u8 mask;
|
2014-05-13 15:54:17 +10:00
|
|
|
};
|
|
|
|
|
2012-07-10 12:20:17 +10:00
|
|
|
struct nouveau_gpio {
|
|
|
|
struct nouveau_subdev base;
|
2011-11-21 16:41:48 +10:00
|
|
|
|
2014-08-10 04:10:20 +10:00
|
|
|
struct nvkm_event event;
|
2013-02-03 12:56:16 +10:00
|
|
|
|
2012-12-07 13:46:52 +10:00
|
|
|
void (*reset)(struct nouveau_gpio *, u8 func);
|
2012-07-10 12:20:17 +10:00
|
|
|
int (*find)(struct nouveau_gpio *, int idx, u8 tag, u8 line,
|
|
|
|
struct dcb_gpio_func *);
|
|
|
|
int (*set)(struct nouveau_gpio *, int idx, u8 tag, u8 line, int state);
|
|
|
|
int (*get)(struct nouveau_gpio *, int idx, u8 tag, u8 line);
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct nouveau_gpio *
|
|
|
|
nouveau_gpio(void *obj)
|
2011-11-21 16:41:48 +10:00
|
|
|
{
|
2014-12-03 17:07:22 +10:00
|
|
|
return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_GPIO);
|
2011-11-21 16:41:48 +10:00
|
|
|
}
|
|
|
|
|
2014-05-12 14:18:06 +10:00
|
|
|
extern struct nouveau_oclass *nv10_gpio_oclass;
|
|
|
|
extern struct nouveau_oclass *nv50_gpio_oclass;
|
2014-09-08 20:27:57 +01:00
|
|
|
extern struct nouveau_oclass *nv94_gpio_oclass;
|
2014-05-12 14:18:06 +10:00
|
|
|
extern struct nouveau_oclass *nvd0_gpio_oclass;
|
|
|
|
extern struct nouveau_oclass *nve0_gpio_oclass;
|
2012-07-10 12:20:17 +10:00
|
|
|
|
2011-11-21 16:41:48 +10:00
|
|
|
#endif
|