Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / sorgt215.c
blobda228b54b43e40b2ba0e059772389d8b311e6fe7
1 /*
2 * Copyright 2017 Red Hat Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
22 #include "ior.h"
24 #include <subdev/timer.h>
26 void
27 gt215_sor_dp_audio(struct nvkm_ior *sor, int head, bool enable)
29 struct nvkm_device *device = sor->disp->engine.subdev.device;
30 const u32 soff = nv50_ior_base(sor);
31 const u32 data = 0x80000000 | (0x00000001 * enable);
32 const u32 mask = 0x8000000d;
33 nvkm_mask(device, 0x61c1e0 + soff, mask, data);
34 nvkm_msec(device, 2000,
35 if (!(nvkm_rd32(device, 0x61c1e0 + soff) & 0x80000000))
36 break;
40 static const struct nvkm_ior_func
41 gt215_sor = {
42 .state = g94_sor_state,
43 .power = nv50_sor_power,
44 .clock = nv50_sor_clock,
45 .hdmi = {
46 .ctrl = gt215_hdmi_ctrl,
48 .dp = {
49 .lanes = { 2, 1, 0, 3 },
50 .links = g94_sor_dp_links,
51 .power = g94_sor_dp_power,
52 .pattern = g94_sor_dp_pattern,
53 .drive = g94_sor_dp_drive,
54 .audio = gt215_sor_dp_audio,
55 .audio_sym = g94_sor_dp_audio_sym,
56 .activesym = g94_sor_dp_activesym,
57 .watermark = g94_sor_dp_watermark,
59 .hda = {
60 .hpd = gt215_hda_hpd,
61 .eld = gt215_hda_eld,
65 int
66 gt215_sor_new(struct nvkm_disp *disp, int id)
68 return nv50_sor_new_(&gt215_sor, disp, id);