1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include "ior.h"
23
24static void
25gf119_dac_clock(struct nvkm_ior *dac)
26{
27 struct nvkm_device *device = dac->disp->engine.subdev.device;
28 const u32 doff = nv50_ior_base(dac);
29 nvkm_mask(device, 0x612280 + doff, 0x07070707, 0x00000000);
30}
31
32static void
33gf119_dac_state(struct nvkm_ior *dac, struct nvkm_ior_state *state)
34{
35 struct nvkm_device *device = dac->disp->engine.subdev.device;
36 const u32 coff = (state == &dac->asy) * 0x20000 + dac->id * 0x20;
37 u32 ctrl = nvkm_rd32(device, 0x640180 + coff);
38
39 state->proto_evo = (ctrl & 0x00000f00) >> 8;
40 switch (state->proto_evo) {
41 case 0: state->proto = CRT; break;
42 default:
43 state->proto = UNKNOWN;
44 break;
45 }
46
47 state->head = ctrl & 0x0000000f;
48}
49
50static const struct nvkm_ior_func
51gf119_dac = {
52 .state = gf119_dac_state,
53 .power = nv50_dac_power,
54 .sense = nv50_dac_sense,
55 .clock = gf119_dac_clock,
56};
57
58int
59gf119_dac_new(struct nvkm_disp *disp, int id)
60{
61 return nvkm_ior_new_(&gf119_dac, disp, DAC, id);
62}
63
64int
65gf119_dac_cnt(struct nvkm_disp *disp, unsigned long *pmask)
66{
67 struct nvkm_device *device = disp->engine.subdev.device;
68 *pmask = (nvkm_rd32(device, 0x612004) & 0x000000f0) >> 4;
69 return 4;
70}
71