diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 25 |
4 files changed, 42 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index ab9dd037..3d887d85 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1478,6 +1478,9 @@ static int __exit gk20a_remove(struct platform_device *dev) | |||
1478 | else | 1478 | else |
1479 | gk20a_pm_disable_clk(&dev->dev); | 1479 | gk20a_pm_disable_clk(&dev->dev); |
1480 | 1480 | ||
1481 | if (platform->remove) | ||
1482 | platform->remove(dev); | ||
1483 | |||
1481 | set_gk20a(dev, NULL); | 1484 | set_gk20a(dev, NULL); |
1482 | kfree(g); | 1485 | kfree(g); |
1483 | 1486 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 7638cf15..f4301dab 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h | |||
@@ -103,6 +103,10 @@ struct gk20a_platform { | |||
103 | */ | 103 | */ |
104 | int (*late_probe)(struct platform_device *dev); | 104 | int (*late_probe)(struct platform_device *dev); |
105 | 105 | ||
106 | /* Remove device after power management has been done | ||
107 | */ | ||
108 | int (*remove)(struct platform_device *dev); | ||
109 | |||
106 | /* Poweron platform dependencies */ | 110 | /* Poweron platform dependencies */ |
107 | int (*busy)(struct platform_device *dev); | 111 | int (*busy)(struct platform_device *dev); |
108 | 112 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c index d5b82fcc..ee176b8b 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c | |||
@@ -120,6 +120,15 @@ static int gk20a_generic_late_probe(struct platform_device *dev) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int gk20a_generic_remove(struct platform_device *dev) | ||
124 | { | ||
125 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
126 | |||
127 | tegra_pd_remove_sd(&platform->g->pd); | ||
128 | |||
129 | return 0; | ||
130 | } | ||
131 | |||
123 | struct gk20a_platform gk20a_generic_platform = { | 132 | struct gk20a_platform gk20a_generic_platform = { |
124 | .railgate = gk20a_generic_railgate, | 133 | .railgate = gk20a_generic_railgate, |
125 | .unrailgate = gk20a_generic_unrailgate, | 134 | .unrailgate = gk20a_generic_unrailgate, |
@@ -127,5 +136,6 @@ struct gk20a_platform gk20a_generic_platform = { | |||
127 | 136 | ||
128 | .probe = gk20a_generic_probe, | 137 | .probe = gk20a_generic_probe, |
129 | .late_probe = gk20a_generic_late_probe, | 138 | .late_probe = gk20a_generic_late_probe, |
139 | .remove = gk20a_generic_remove, | ||
130 | .default_big_page_size = SZ_128K, | 140 | .default_big_page_size = SZ_128K, |
131 | }; | 141 | }; |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 415e4020..dfbc1ae0 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | |||
@@ -381,6 +381,15 @@ static void gk20a_tegra_scale_init(struct platform_device *pdev) | |||
381 | profile->private_data = emc_params; | 381 | profile->private_data = emc_params; |
382 | } | 382 | } |
383 | 383 | ||
384 | static void gk20a_tegra_scale_exit(struct platform_device *pdev) | ||
385 | { | ||
386 | struct gk20a_platform *platform = gk20a_get_platform(pdev); | ||
387 | struct gk20a_scale_profile *profile = platform->g->scale_profile; | ||
388 | |||
389 | if (profile) | ||
390 | kfree(profile->private_data); | ||
391 | } | ||
392 | |||
384 | void gk20a_tegra_debug_dump(struct platform_device *pdev) | 393 | void gk20a_tegra_debug_dump(struct platform_device *pdev) |
385 | { | 394 | { |
386 | struct gk20a_platform *platform = gk20a_get_platform(pdev); | 395 | struct gk20a_platform *platform = gk20a_get_platform(pdev); |
@@ -466,6 +475,19 @@ static int gk20a_tegra_late_probe(struct platform_device *dev) | |||
466 | return 0; | 475 | return 0; |
467 | } | 476 | } |
468 | 477 | ||
478 | static int gk20a_tegra_remove(struct platform_device *dev) | ||
479 | { | ||
480 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
481 | |||
482 | /* remove gk20a power subdomain from host1x */ | ||
483 | nvhost_unregister_client_domain(&platform->g->pd); | ||
484 | |||
485 | /* deinitialise tegra specific scaling quirks */ | ||
486 | gk20a_tegra_scale_exit(dev); | ||
487 | |||
488 | return 0; | ||
489 | } | ||
490 | |||
469 | static int gk20a_tegra_suspend(struct device *dev) | 491 | static int gk20a_tegra_suspend(struct device *dev) |
470 | { | 492 | { |
471 | tegra_edp_notify_gpu_load(0, 0); | 493 | tegra_edp_notify_gpu_load(0, 0); |
@@ -491,6 +513,7 @@ static struct gk20a_platform t132_gk20a_tegra_platform = { | |||
491 | 513 | ||
492 | .probe = gk20a_tegra_probe, | 514 | .probe = gk20a_tegra_probe, |
493 | .late_probe = gk20a_tegra_late_probe, | 515 | .late_probe = gk20a_tegra_late_probe, |
516 | .remove = gk20a_tegra_remove, | ||
494 | 517 | ||
495 | /* power management callbacks */ | 518 | /* power management callbacks */ |
496 | .suspend = gk20a_tegra_suspend, | 519 | .suspend = gk20a_tegra_suspend, |
@@ -534,6 +557,7 @@ struct gk20a_platform gk20a_tegra_platform = { | |||
534 | 557 | ||
535 | .probe = gk20a_tegra_probe, | 558 | .probe = gk20a_tegra_probe, |
536 | .late_probe = gk20a_tegra_late_probe, | 559 | .late_probe = gk20a_tegra_late_probe, |
560 | .remove = gk20a_tegra_remove, | ||
537 | 561 | ||
538 | /* power management callbacks */ | 562 | /* power management callbacks */ |
539 | .suspend = gk20a_tegra_suspend, | 563 | .suspend = gk20a_tegra_suspend, |
@@ -578,6 +602,7 @@ struct gk20a_platform gm20b_tegra_platform = { | |||
578 | 602 | ||
579 | .probe = gk20a_tegra_probe, | 603 | .probe = gk20a_tegra_probe, |
580 | .late_probe = gk20a_tegra_late_probe, | 604 | .late_probe = gk20a_tegra_late_probe, |
605 | .remove = gk20a_tegra_remove, | ||
581 | 606 | ||
582 | /* power management callbacks */ | 607 | /* power management callbacks */ |
583 | .suspend = gk20a_tegra_suspend, | 608 | .suspend = gk20a_tegra_suspend, |