xref: /openbmc/linux/drivers/gpu/drm/nouveau/dispnv50/dac907d.c (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
109e1b78aSBen Skeggs /*
209e1b78aSBen Skeggs  * Copyright 2018 Red Hat Inc.
309e1b78aSBen Skeggs  *
409e1b78aSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
509e1b78aSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
609e1b78aSBen Skeggs  * to deal in the Software without restriction, including without limitation
709e1b78aSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
809e1b78aSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
909e1b78aSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
1009e1b78aSBen Skeggs  *
1109e1b78aSBen Skeggs  * The above copyright notice and this permission notice shall be included in
1209e1b78aSBen Skeggs  * all copies or substantial portions of the Software.
1309e1b78aSBen Skeggs  *
1409e1b78aSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1509e1b78aSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1609e1b78aSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1709e1b78aSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1809e1b78aSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1909e1b78aSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2009e1b78aSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
2109e1b78aSBen Skeggs  */
2209e1b78aSBen Skeggs #include "core.h"
2309e1b78aSBen Skeggs 
249ec5e820SBen Skeggs #include <nvif/push507c.h>
259ec5e820SBen Skeggs 
26*344c2e5aSBen Skeggs #include <nvhw/class/cl907d.h>
27*344c2e5aSBen Skeggs 
289ec5e820SBen Skeggs static int
dac907d_ctrl(struct nv50_core * core,int or,u32 ctrl,struct nv50_head_atom * asyh)2909e1b78aSBen Skeggs dac907d_ctrl(struct nv50_core *core, int or, u32 ctrl,
3009e1b78aSBen Skeggs 	     struct nv50_head_atom *asyh)
3109e1b78aSBen Skeggs {
329ec5e820SBen Skeggs 	struct nvif_push *push = core->chan.push;
339ec5e820SBen Skeggs 	int ret;
349ec5e820SBen Skeggs 
359ec5e820SBen Skeggs 	if ((ret = PUSH_WAIT(push, 2)))
369ec5e820SBen Skeggs 		return ret;
379ec5e820SBen Skeggs 
38*344c2e5aSBen Skeggs 	PUSH_MTHD(push, NV907D, DAC_SET_CONTROL(or), ctrl);
399ec5e820SBen Skeggs 	return 0;
4009e1b78aSBen Skeggs }
4109e1b78aSBen Skeggs 
4209e1b78aSBen Skeggs const struct nv50_outp_func
4309e1b78aSBen Skeggs dac907d = {
4409e1b78aSBen Skeggs 	.ctrl = dac907d_ctrl,
4509e1b78aSBen Skeggs };
46