17632b30eSBen Skeggs /*
27632b30eSBen Skeggs  * Copyright 2013 Red Hat Inc.
37632b30eSBen Skeggs  *
47632b30eSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
57632b30eSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
67632b30eSBen Skeggs  * to deal in the Software without restriction, including without limitation
77632b30eSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
87632b30eSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
97632b30eSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
107632b30eSBen Skeggs  *
117632b30eSBen Skeggs  * The above copyright notice and this permission notice shall be included in
127632b30eSBen Skeggs  * all copies or substantial portions of the Software.
137632b30eSBen Skeggs  *
147632b30eSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157632b30eSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167632b30eSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
177632b30eSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
187632b30eSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
197632b30eSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
207632b30eSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
217632b30eSBen Skeggs  *
227632b30eSBen Skeggs  * Authors: Ben Skeggs <bskeggs@redhat.com>
237632b30eSBen Skeggs  */
247632b30eSBen Skeggs #include "nv50.h"
257632b30eSBen Skeggs 
266625f55cSBen Skeggs static const struct nvkm_clk_func
276625f55cSBen Skeggs g84_clk = {
286625f55cSBen Skeggs 	.read = nv50_clk_read,
296625f55cSBen Skeggs 	.calc = nv50_clk_calc,
306625f55cSBen Skeggs 	.prog = nv50_clk_prog,
316625f55cSBen Skeggs 	.tidy = nv50_clk_tidy,
326625f55cSBen Skeggs 	.domains = {
337632b30eSBen Skeggs 		{ nv_clk_src_crystal, 0xff },
347632b30eSBen Skeggs 		{ nv_clk_src_href   , 0xff },
357632b30eSBen Skeggs 		{ nv_clk_src_core   , 0xff, 0, "core", 1000 },
367632b30eSBen Skeggs 		{ nv_clk_src_shader , 0xff, 0, "shader", 1000 },
377632b30eSBen Skeggs 		{ nv_clk_src_mem    , 0xff, 0, "memory", 1000 },
387632b30eSBen Skeggs 		{ nv_clk_src_vdec   , 0xff },
397632b30eSBen Skeggs 		{ nv_clk_src_max }
406625f55cSBen Skeggs 	}
417632b30eSBen Skeggs };
427632b30eSBen Skeggs 
436625f55cSBen Skeggs int
g84_clk_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_clk ** pclk)44*98fd7f83SBen Skeggs g84_clk_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
45*98fd7f83SBen Skeggs 	    struct nvkm_clk **pclk)
466625f55cSBen Skeggs {
47*98fd7f83SBen Skeggs 	return nv50_clk_new_(&g84_clk, device, type, inst, (device->chipset >= 0x94), pclk);
486625f55cSBen Skeggs }
49