2019-06-19 20:13:43 -04:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
2015-01-14 15:02:59 +10:00
|
|
|
#ifndef __NVKM_GPIO_H__
|
|
|
|
#define __NVKM_GPIO_H__
|
2012-07-10 12:20:17 +10:00
|
|
|
#include <core/subdev.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
|
|
|
};
|
|
|
|
|
2015-01-14 15:02:59 +10:00
|
|
|
struct nvkm_gpio {
|
2015-08-20 14:54:20 +10:00
|
|
|
const struct nvkm_gpio_func *func;
|
2015-08-20 14:54:06 +10:00
|
|
|
struct nvkm_subdev subdev;
|
2011-11-21 16:41:48 +10:00
|
|
|
|
2014-08-10 04:10:20 +10:00
|
|
|
struct nvkm_event event;
|
2012-07-10 12:20:17 +10:00
|
|
|
};
|
|
|
|
|
2015-08-20 14:54:20 +10:00
|
|
|
void nvkm_gpio_reset(struct nvkm_gpio *, u8 func);
|
|
|
|
int nvkm_gpio_find(struct nvkm_gpio *, int idx, u8 tag, u8 line,
|
|
|
|
struct dcb_gpio_func *);
|
|
|
|
int nvkm_gpio_set(struct nvkm_gpio *, int idx, u8 tag, u8 line, int state);
|
|
|
|
int nvkm_gpio_get(struct nvkm_gpio *, int idx, u8 tag, u8 line);
|
|
|
|
|
|
|
|
int nv10_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
|
|
|
|
int nv50_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
|
|
|
|
int g94_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
|
|
|
|
int gf119_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
|
|
|
|
int gk104_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
|
2011-11-21 16:41:48 +10:00
|
|
|
#endif
|