Lines Matching +full:current +full:- +full:speed
33 nvkm_pcie_speed(enum pci_bus_speed speed) in nvkm_pcie_speed() argument
35 switch (speed) { in nvkm_pcie_speed()
44 if (speed == 0x17) in nvkm_pcie_speed()
46 return -1; in nvkm_pcie_speed()
53 if (!pci->func->pcie.version) in nvkm_pcie_get_version()
54 return -ENOSYS; in nvkm_pcie_get_version()
56 return pci->func->pcie.version(pci); in nvkm_pcie_get_version()
62 if (!pci->func->pcie.version_supported) in nvkm_pcie_get_max_version()
63 return -ENOSYS; in nvkm_pcie_get_max_version()
65 return pci->func->pcie.version_supported(pci); in nvkm_pcie_get_max_version()
71 if (!pci->func->pcie.set_version) in nvkm_pcie_set_version()
72 return -ENOSYS; 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()
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()
91 struct nvkm_subdev *subdev = &pci->subdev; 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
121 if (!pci || !pci_is_pcie(pci->pdev)) in nvkm_pcie_set_link()
124 if (!pci->func->pcie.set_link) in nvkm_pcie_set_link()
125 return -ENOSYS; in nvkm_pcie_set_link()
127 subdev = &pci->subdev; in nvkm_pcie_set_link()
128 nvkm_trace(subdev, "requested %s\n", nvkm_pcie_speeds[speed]); in nvkm_pcie_set_link()
130 if (pci->func->pcie.version(pci) < 2) { in nvkm_pcie_set_link()
132 return -ENODEV; in nvkm_pcie_set_link()
135 cur_speed = pci->func->pcie.cur_speed(pci); in nvkm_pcie_set_link()
136 max_speed = min(nvkm_pcie_speed(pci->pdev->bus->max_bus_speed), in nvkm_pcie_set_link()
137 pci->func->pcie.max_speed(pci)); in nvkm_pcie_set_link()
139 nvkm_trace(subdev, "current speed: %s\n", nvkm_pcie_speeds[cur_speed]); in nvkm_pcie_set_link()
141 if (speed > max_speed) { in nvkm_pcie_set_link()
143 "requested speed to %s", nvkm_pcie_speeds[speed], in nvkm_pcie_set_link()
145 speed = max_speed; in nvkm_pcie_set_link()
148 pci->pcie.speed = speed; in nvkm_pcie_set_link()
149 pci->pcie.width = width; in nvkm_pcie_set_link()
151 if (speed == cur_speed) { in nvkm_pcie_set_link()
152 nvkm_debug(subdev, "requested matches current speed\n"); in nvkm_pcie_set_link()
153 return speed; in nvkm_pcie_set_link()
157 nvkm_pcie_speeds[speed], width); in nvkm_pcie_set_link()
159 ret = pci->func->pcie.set_link(pci, speed, width); in nvkm_pcie_set_link()