Lines Matching refs:pci

33 	struct nvkm_pci *pci = device->pci;  in nvkm_pci_msi_rearm()  local
35 if (pci && pci->msi) in nvkm_pci_msi_rearm()
36 pci->func->msi_rearm(pci); in nvkm_pci_msi_rearm()
40 nvkm_pci_rd32(struct nvkm_pci *pci, u16 addr) in nvkm_pci_rd32() argument
42 return pci->func->rd32(pci, addr); in nvkm_pci_rd32()
46 nvkm_pci_wr08(struct nvkm_pci *pci, u16 addr, u8 data) in nvkm_pci_wr08() argument
48 pci->func->wr08(pci, addr, data); in nvkm_pci_wr08()
52 nvkm_pci_wr32(struct nvkm_pci *pci, u16 addr, u32 data) in nvkm_pci_wr32() argument
54 pci->func->wr32(pci, addr, data); in nvkm_pci_wr32()
58 nvkm_pci_mask(struct nvkm_pci *pci, u16 addr, u32 mask, u32 value) in nvkm_pci_mask() argument
60 u32 data = pci->func->rd32(pci, addr); in nvkm_pci_mask()
61 pci->func->wr32(pci, addr, (data & ~mask) | value); in nvkm_pci_mask()
66 nvkm_pci_rom_shadow(struct nvkm_pci *pci, bool shadow) in nvkm_pci_rom_shadow() argument
68 u32 data = nvkm_pci_rd32(pci, 0x0050); in nvkm_pci_rom_shadow()
73 nvkm_pci_wr32(pci, 0x0050, data); in nvkm_pci_rom_shadow()
79 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_fini() local
81 if (pci->agp.bridge) in nvkm_pci_fini()
82 nvkm_agp_fini(pci); in nvkm_pci_fini()
90 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_preinit() local
91 if (pci->agp.bridge) in nvkm_pci_preinit()
92 nvkm_agp_preinit(pci); in nvkm_pci_preinit()
99 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_oneinit() local
102 if (pci_is_pcie(pci->pdev)) { in nvkm_pci_oneinit()
103 ret = nvkm_pcie_oneinit(pci); in nvkm_pci_oneinit()
114 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_init() local
117 if (pci->agp.bridge) { in nvkm_pci_init()
118 ret = nvkm_agp_init(pci); in nvkm_pci_init()
121 } else if (pci_is_pcie(pci->pdev)) { in nvkm_pci_init()
122 nvkm_pcie_init(pci); in nvkm_pci_init()
125 if (pci->func->init) in nvkm_pci_init()
126 pci->func->init(pci); in nvkm_pci_init()
131 if (pci->msi) in nvkm_pci_init()
132 pci->func->msi_rearm(pci); in nvkm_pci_init()
140 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_dtor() local
142 nvkm_agp_dtor(pci); in nvkm_pci_dtor()
144 if (pci->msi) in nvkm_pci_dtor()
145 pci_disable_msi(pci->pdev); in nvkm_pci_dtor()
163 struct nvkm_pci *pci; in nvkm_pci_new_() local
165 if (!(pci = *ppci = kzalloc(sizeof(**ppci), GFP_KERNEL))) in nvkm_pci_new_()
167 nvkm_subdev_ctor(&nvkm_pci_func, device, type, inst, &pci->subdev); in nvkm_pci_new_()
168 pci->func = func; in nvkm_pci_new_()
169 pci->pdev = device->func->pci(device)->pdev; in nvkm_pci_new_()
170 pci->pcie.speed = -1; in nvkm_pci_new_()
171 pci->pcie.width = -1; in nvkm_pci_new_()
174 nvkm_agp_ctor(pci); in nvkm_pci_new_()
176 switch (pci->pdev->device & 0x0ff0) { in nvkm_pci_new_()
187 pci->msi = true; in nvkm_pci_new_()
193 pci->msi = false; in nvkm_pci_new_()
196 pci->msi = nvkm_boolopt(device->cfgopt, "NvMSI", pci->msi); in nvkm_pci_new_()
197 if (pci->msi && func->msi_rearm) { in nvkm_pci_new_()
198 pci->msi = pci_enable_msi(pci->pdev) == 0; in nvkm_pci_new_()
199 if (pci->msi) in nvkm_pci_new_()
200 nvkm_debug(&pci->subdev, "MSI enabled\n"); in nvkm_pci_new_()
202 pci->msi = false; in nvkm_pci_new_()