···11+/*22+ * Copyright 2016 Red Hat Inc.33+ *44+ * Permission is hereby granted, free of charge, to any person obtaining a55+ * copy of this software and associated documentation files (the "Software"),66+ * to deal in the Software without restriction, including without limitation77+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,88+ * and/or sell copies of the Software, and to permit persons to whom the99+ * Software is furnished to do so, subject to the following conditions:1010+ *1111+ * The above copyright notice and this permission notice shall be included in1212+ * all copies or substantial portions of the Software.1313+ *1414+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR1515+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,1616+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL1717+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR1818+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,1919+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR2020+ * OTHER DEALINGS IN THE SOFTWARE.2121+ *2222+ * Authors: Ben Skeggs <bskeggs@redhat.com>2323+ */2424+#include "nv50.h"2525+#include "outpdp.h"2626+2727+int2828+gm107_sor_dp_pattern(struct nvkm_output_dp *outp, int pattern)2929+{3030+ struct nvkm_device *device = outp->base.disp->engine.subdev.device;3131+ const u32 soff = outp->base.or * 0x800;3232+ const u32 data = 0x01010101 * pattern;3333+ if (outp->base.info.sorconf.link & 1)3434+ nvkm_mask(device, 0x61c110 + soff, 0x0f0f0f0f, data);3535+ else3636+ nvkm_mask(device, 0x61c12c + soff, 0x0f0f0f0f, data);3737+ return 0;3838+}3939+4040+static const struct nvkm_output_dp_func4141+gm107_sor_dp_func = {4242+ .pattern = gm107_sor_dp_pattern,4343+ .lnk_pwr = g94_sor_dp_lnk_pwr,4444+ .lnk_ctl = gf119_sor_dp_lnk_ctl,4545+ .drv_ctl = gf119_sor_dp_drv_ctl,4646+};4747+4848+int4949+gm107_sor_dp_new(struct nvkm_disp *disp, int index,5050+ struct dcb_output *dcbE, struct nvkm_output **poutp)5151+{5252+ return nvkm_output_dp_new_(&gm107_sor_dp_func, disp, index, dcbE, poutp);5353+}