Lines Matching refs:pci

32 nvkm_pci_rd32(struct nvkm_pci *pci, u16 addr)  in nvkm_pci_rd32()  argument
34 return pci->func->rd32(pci, addr); in nvkm_pci_rd32()
38 nvkm_pci_wr08(struct nvkm_pci *pci, u16 addr, u8 data) in nvkm_pci_wr08() argument
40 pci->func->wr08(pci, addr, data); in nvkm_pci_wr08()
44 nvkm_pci_wr32(struct nvkm_pci *pci, u16 addr, u32 data) in nvkm_pci_wr32() argument
46 pci->func->wr32(pci, addr, data); in nvkm_pci_wr32()
50 nvkm_pci_mask(struct nvkm_pci *pci, u16 addr, u32 mask, u32 value) in nvkm_pci_mask() argument
52 u32 data = pci->func->rd32(pci, addr); in nvkm_pci_mask()
53 pci->func->wr32(pci, addr, (data & ~mask) | value); in nvkm_pci_mask()
58 nvkm_pci_rom_shadow(struct nvkm_pci *pci, bool shadow) in nvkm_pci_rom_shadow() argument
60 u32 data = nvkm_pci_rd32(pci, 0x0050); in nvkm_pci_rom_shadow()
65 nvkm_pci_wr32(pci, 0x0050, data); in nvkm_pci_rom_shadow()
71 struct nvkm_pci *pci = arg; in nvkm_pci_intr() local
72 struct nvkm_device *device = pci->subdev.device; in nvkm_pci_intr()
75 if (pci->irq < 0) in nvkm_pci_intr()
79 if (pci->msi) in nvkm_pci_intr()
80 pci->func->msi_rearm(pci); in nvkm_pci_intr()
89 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_fini() local
91 if (pci->agp.bridge) in nvkm_pci_fini()
92 nvkm_agp_fini(pci); in nvkm_pci_fini()
100 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_preinit() local
101 if (pci->agp.bridge) in nvkm_pci_preinit()
102 nvkm_agp_preinit(pci); in nvkm_pci_preinit()
109 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_oneinit() local
110 struct pci_dev *pdev = pci->pdev; in nvkm_pci_oneinit()
113 if (pci_is_pcie(pci->pdev)) { in nvkm_pci_oneinit()
114 ret = nvkm_pcie_oneinit(pci); in nvkm_pci_oneinit()
119 ret = request_irq(pdev->irq, nvkm_pci_intr, IRQF_SHARED, "nvkm", pci); in nvkm_pci_oneinit()
123 pci->irq = pdev->irq; in nvkm_pci_oneinit()
130 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_init() local
133 if (pci->agp.bridge) { in nvkm_pci_init()
134 ret = nvkm_agp_init(pci); in nvkm_pci_init()
137 } else if (pci_is_pcie(pci->pdev)) { in nvkm_pci_init()
138 nvkm_pcie_init(pci); in nvkm_pci_init()
141 if (pci->func->init) in nvkm_pci_init()
142 pci->func->init(pci); in nvkm_pci_init()
147 if (pci->msi) in nvkm_pci_init()
148 pci->func->msi_rearm(pci); in nvkm_pci_init()
156 struct nvkm_pci *pci = nvkm_pci(subdev); in nvkm_pci_dtor() local
158 nvkm_agp_dtor(pci); in nvkm_pci_dtor()
160 if (pci->irq >= 0) { in nvkm_pci_dtor()
164 int irq = pci->irq; in nvkm_pci_dtor()
165 pci->irq = -1; in nvkm_pci_dtor()
166 free_irq(irq, pci); in nvkm_pci_dtor()
169 if (pci->msi) in nvkm_pci_dtor()
170 pci_disable_msi(pci->pdev); in nvkm_pci_dtor()
188 struct nvkm_pci *pci; in nvkm_pci_new_() local
190 if (!(pci = *ppci = kzalloc(sizeof(**ppci), GFP_KERNEL))) in nvkm_pci_new_()
192 nvkm_subdev_ctor(&nvkm_pci_func, device, type, inst, &pci->subdev); in nvkm_pci_new_()
193 pci->func = func; in nvkm_pci_new_()
194 pci->pdev = device->func->pci(device)->pdev; in nvkm_pci_new_()
195 pci->irq = -1; in nvkm_pci_new_()
196 pci->pcie.speed = -1; in nvkm_pci_new_()
197 pci->pcie.width = -1; in nvkm_pci_new_()
200 nvkm_agp_ctor(pci); in nvkm_pci_new_()
202 switch (pci->pdev->device & 0x0ff0) { in nvkm_pci_new_()
213 pci->msi = true; in nvkm_pci_new_()
219 pci->msi = false; in nvkm_pci_new_()
222 pci->msi = nvkm_boolopt(device->cfgopt, "NvMSI", pci->msi); in nvkm_pci_new_()
223 if (pci->msi && func->msi_rearm) { in nvkm_pci_new_()
224 pci->msi = pci_enable_msi(pci->pdev) == 0; in nvkm_pci_new_()
225 if (pci->msi) in nvkm_pci_new_()
226 nvkm_debug(&pci->subdev, "MSI enabled\n"); in nvkm_pci_new_()
228 pci->msi = false; in nvkm_pci_new_()