License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / drivers / gpu / drm / nouveau / nvkm / subdev / gpio / priv.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
4e7659fc
BS
2#ifndef __NVKM_GPIO_PRIV_H__
3#define __NVKM_GPIO_PRIV_H__
2ea7249f 4#define nvkm_gpio(p) container_of((p), struct nvkm_gpio, subdev)
fa531bc8
BS
5#include <subdev/gpio.h>
6
2ea7249f 7struct nvkm_gpio_func {
7356859a 8 int lines;
5693c0f2
BS
9
10 /* read and ack pending interrupts, returning only data
11 * for lines that have not been masked off, while still
12 * performing the ack for anything that was pending.
13 */
4e7659fc 14 void (*intr_stat)(struct nvkm_gpio *, u32 *, u32 *);
5693c0f2
BS
15
16 /* mask on/off interrupts for hi/lo transitions on a
17 * given set of gpio lines
18 */
4e7659fc 19 void (*intr_mask)(struct nvkm_gpio *, u32, u32, u32);
bc3b0c41
BS
20
21 /* configure gpio direction and output value */
4e7659fc 22 int (*drive)(struct nvkm_gpio *, int line, int dir, int out);
bc3b0c41
BS
23
24 /* sense current state of given gpio line */
4e7659fc 25 int (*sense)(struct nvkm_gpio *, int line);
bc3b0c41
BS
26
27 /*XXX*/
4e7659fc 28 void (*reset)(struct nvkm_gpio *, u8);
7356859a
BS
29};
30
2ea7249f
BS
31int nvkm_gpio_new_(const struct nvkm_gpio_func *, struct nvkm_device *,
32 int index, struct nvkm_gpio **);
33
4e7659fc
BS
34void nv50_gpio_reset(struct nvkm_gpio *, u8);
35int nv50_gpio_drive(struct nvkm_gpio *, int, int, int);
36int nv50_gpio_sense(struct nvkm_gpio *, int);
bc3b0c41 37
4e7659fc
BS
38void g94_gpio_intr_stat(struct nvkm_gpio *, u32 *, u32 *);
39void g94_gpio_intr_mask(struct nvkm_gpio *, u32, u32, u32);
7356859a 40
2ea7249f
BS
41void gf119_gpio_reset(struct nvkm_gpio *, u8);
42int gf119_gpio_drive(struct nvkm_gpio *, int, int, int);
43int gf119_gpio_sense(struct nvkm_gpio *, int);
fa531bc8 44#endif