Lines Matching refs:pci
51 nvkm_pcie_get_version(struct nvkm_pci *pci) in nvkm_pcie_get_version() argument
53 if (!pci->func->pcie.version) in nvkm_pcie_get_version()
56 return pci->func->pcie.version(pci); in nvkm_pcie_get_version()
60 nvkm_pcie_get_max_version(struct nvkm_pci *pci) in nvkm_pcie_get_max_version() argument
62 if (!pci->func->pcie.version_supported) in nvkm_pcie_get_max_version()
65 return pci->func->pcie.version_supported(pci); in nvkm_pcie_get_max_version()
69 nvkm_pcie_set_version(struct nvkm_pci *pci, int version) in nvkm_pcie_set_version() argument
71 if (!pci->func->pcie.set_version) in nvkm_pcie_set_version()
74 nvkm_trace(&pci->subdev, "set to version %i\n", version); in nvkm_pcie_set_version()
75 pci->func->pcie.set_version(pci, version); in nvkm_pcie_set_version()
76 return nvkm_pcie_get_version(pci); in nvkm_pcie_set_version()
80 nvkm_pcie_oneinit(struct nvkm_pci *pci) in nvkm_pcie_oneinit() argument
82 if (pci->func->pcie.max_speed) in nvkm_pcie_oneinit()
83 nvkm_debug(&pci->subdev, "pcie max speed: %s\n", in nvkm_pcie_oneinit()
84 nvkm_pcie_speeds[pci->func->pcie.max_speed(pci)]); in nvkm_pcie_oneinit()
89 nvkm_pcie_init(struct nvkm_pci *pci) in nvkm_pcie_init() argument
91 struct nvkm_subdev *subdev = &pci->subdev; in nvkm_pcie_init()
95 ret = nvkm_pcie_get_version(pci); in nvkm_pcie_init()
97 int max_version = nvkm_pcie_get_max_version(pci); in nvkm_pcie_init()
99 ret = nvkm_pcie_set_version(pci, max_version); in nvkm_pcie_init()
105 if (pci->func->pcie.init) in nvkm_pcie_init()
106 pci->func->pcie.init(pci); in nvkm_pcie_init()
108 if (pci->pcie.speed != -1) in nvkm_pcie_init()
109 nvkm_pcie_set_link(pci, pci->pcie.speed, pci->pcie.width); in nvkm_pcie_init()
115 nvkm_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8 width) in nvkm_pcie_set_link() argument
117 struct nvkm_subdev *subdev = &pci->subdev; in nvkm_pcie_set_link()
122 if (!pci || !pci_is_pcie(pci->pdev)) in nvkm_pcie_set_link()
124 pbus = pci->pdev->bus; in nvkm_pcie_set_link()
126 if (!pci->func->pcie.set_link) in nvkm_pcie_set_link()
131 if (pci->func->pcie.version(pci) < 2) { in nvkm_pcie_set_link()
136 cur_speed = pci->func->pcie.cur_speed(pci); in nvkm_pcie_set_link()
138 pci->func->pcie.max_speed(pci)); in nvkm_pcie_set_link()
149 pci->pcie.speed = speed; in nvkm_pcie_set_link()
150 pci->pcie.width = width; in nvkm_pcie_set_link()
160 ret = pci->func->pcie.set_link(pci, speed, width); in nvkm_pcie_set_link()