Linux Audio

Check our new training course

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