xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/pci/g94.c (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
15112abc6SKarol Herbst /*
25112abc6SKarol Herbst  * Copyright 2015 Red Hat Inc.
35112abc6SKarol Herbst  *
45112abc6SKarol Herbst  * Permission is hereby granted, free of charge, to any person obtaining a
55112abc6SKarol Herbst  * copy of this software and associated documentation files (the "Software"),
65112abc6SKarol Herbst  * to deal in the Software without restriction, including without limitation
75112abc6SKarol Herbst  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
85112abc6SKarol Herbst  * and/or sell copies of the Software, and to permit persons to whom the
95112abc6SKarol Herbst  * Software is furnished to do so, subject to the following conditions:
105112abc6SKarol Herbst  *
115112abc6SKarol Herbst  * The above copyright notice and this permission notice shall be included in
125112abc6SKarol Herbst  * all copies or substantial portions of the Software.
135112abc6SKarol Herbst  *
145112abc6SKarol Herbst  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
155112abc6SKarol Herbst  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
165112abc6SKarol Herbst  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
175112abc6SKarol Herbst  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
185112abc6SKarol Herbst  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
195112abc6SKarol Herbst  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
205112abc6SKarol Herbst  * OTHER DEALINGS IN THE SOFTWARE.
215112abc6SKarol Herbst  *
225112abc6SKarol Herbst  * Authors: Ben Skeggs <bskeggs@redhat.com>
235112abc6SKarol Herbst  */
245112abc6SKarol Herbst #include "priv.h"
255112abc6SKarol Herbst 
265112abc6SKarol Herbst static const struct nvkm_pci_func
275112abc6SKarol Herbst g94_pci_func = {
285112abc6SKarol Herbst 	.init = g84_pci_init,
295112abc6SKarol Herbst 	.rd32 = nv40_pci_rd32,
305112abc6SKarol Herbst 	.wr08 = nv40_pci_wr08,
315112abc6SKarol Herbst 	.wr32 = nv40_pci_wr32,
325112abc6SKarol Herbst 	.msi_rearm = nv40_pci_msi_rearm,
335112abc6SKarol Herbst 
345112abc6SKarol Herbst 	.pcie.init = g84_pcie_init,
355112abc6SKarol Herbst 	.pcie.set_link = g84_pcie_set_link,
365112abc6SKarol Herbst 
375112abc6SKarol Herbst 	.pcie.max_speed = g84_pcie_max_speed,
385112abc6SKarol Herbst 	.pcie.cur_speed = g84_pcie_cur_speed,
395112abc6SKarol Herbst 
405112abc6SKarol Herbst 	.pcie.set_version = g84_pcie_set_version,
415112abc6SKarol Herbst 	.pcie.version = g84_pcie_version,
425112abc6SKarol Herbst 	.pcie.version_supported = g92_pcie_version_supported,
435112abc6SKarol Herbst };
445112abc6SKarol Herbst 
455112abc6SKarol Herbst int
g94_pci_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_pci ** ppci)46*9b70cd54SBen Skeggs g94_pci_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
47*9b70cd54SBen Skeggs 	    struct nvkm_pci **ppci)
485112abc6SKarol Herbst {
49*9b70cd54SBen Skeggs 	return nvkm_pci_new_(&g94_pci_func, device, type, inst, ppci);
505112abc6SKarol Herbst }
51