summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/pci.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-14 18:12:57 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-14 03:05:12 -0400
commit7acc993cdbcc202854f188e7f53646f387573a09 (patch)
tree61d213424ed8985973fa7ee3e4580c7b1b95bd3b /drivers/gpu/nvgpu/common/linux/pci.c
parentab22d66386e3a23e0dfe897bca25e01623f6d61c (diff)
gpu: nvgpu: Move can_railgate & railgate_delay to gk20a
Copy can_railgate and railgate_delay to struct gk20a at probe time, and access them from gk20a instead of platform_gk20a. JIRA NVGPU-16 Change-Id: I63d4f4aff7eb17a167775fd7982a1b548bbca3a5 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1463543 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/pci.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/pci.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c
index b4e6cb7c..a603135f 100644
--- a/drivers/gpu/nvgpu/common/linux/pci.c
+++ b/drivers/gpu/nvgpu/common/linux/pci.c
@@ -64,8 +64,8 @@ static struct gk20a_platform nvgpu_pci_device[] = {
64 .remove = nvgpu_pci_tegra_remove, 64 .remove = nvgpu_pci_tegra_remove,
65 65
66 /* power management configuration */ 66 /* power management configuration */
67 .railgate_delay = 500, 67 .railgate_delay_init = 500,
68 .can_railgate = false, 68 .can_railgate_init = false,
69 .can_elpg = true, 69 .can_elpg = true,
70 .enable_elpg = true, 70 .enable_elpg = true,
71 .enable_elcg = false, 71 .enable_elcg = false,
@@ -98,8 +98,8 @@ static struct gk20a_platform nvgpu_pci_device[] = {
98 .remove = nvgpu_pci_tegra_remove, 98 .remove = nvgpu_pci_tegra_remove,
99 99
100 /* power management configuration */ 100 /* power management configuration */
101 .railgate_delay = 500, 101 .railgate_delay_init = 500,
102 .can_railgate = false, 102 .can_railgate_init = false,
103 .can_elpg = true, 103 .can_elpg = true,
104 .enable_elpg = true, 104 .enable_elpg = true,
105 .enable_elcg = false, 105 .enable_elcg = false,
@@ -132,8 +132,8 @@ static struct gk20a_platform nvgpu_pci_device[] = {
132 .remove = nvgpu_pci_tegra_remove, 132 .remove = nvgpu_pci_tegra_remove,
133 133
134 /* power management configuration */ 134 /* power management configuration */
135 .railgate_delay = 500, 135 .railgate_delay_init = 500,
136 .can_railgate = false, 136 .can_railgate_init = false,
137 .can_elpg = true, 137 .can_elpg = true,
138 .enable_elpg = true, 138 .enable_elpg = true,
139 .enable_elcg = false, 139 .enable_elcg = false,
@@ -166,8 +166,8 @@ static struct gk20a_platform nvgpu_pci_device[] = {
166 .remove = nvgpu_pci_tegra_remove, 166 .remove = nvgpu_pci_tegra_remove,
167 167
168 /* power management configuration */ 168 /* power management configuration */
169 .railgate_delay = 500, 169 .railgate_delay_init = 500,
170 .can_railgate = false, 170 .can_railgate_init = false,
171 .can_elpg = true, 171 .can_elpg = true,
172 .enable_elpg = true, 172 .enable_elpg = true,
173 .enable_elcg = false, 173 .enable_elcg = false,
@@ -311,14 +311,14 @@ static const struct dev_pm_ops nvgpu_pci_pm_ops = {
311static int nvgpu_pci_pm_init(struct device *dev) 311static int nvgpu_pci_pm_init(struct device *dev)
312{ 312{
313#ifdef CONFIG_PM 313#ifdef CONFIG_PM
314 struct gk20a_platform *platform = gk20a_get_platform(dev); 314 struct gk20a *g = get_gk20a(dev);
315 315
316 if (!platform->can_railgate) { 316 if (!g->can_railgate) {
317 pm_runtime_disable(dev); 317 pm_runtime_disable(dev);
318 } else { 318 } else {
319 if (platform->railgate_delay) 319 if (g->railgate_delay)
320 pm_runtime_set_autosuspend_delay(dev, 320 pm_runtime_set_autosuspend_delay(dev,
321 platform->railgate_delay); 321 g->railgate_delay);
322 322
323 /* 323 /*
324 * Runtime PM for PCI devices is disabled by default, 324 * Runtime PM for PCI devices is disabled by default,