diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2014-11-05 11:09:26 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:12:22 -0400 |
commit | 6049301229b184d15873f907a35d22eb473c38a0 (patch) | |
tree | 49ced67c74cf1e70433a2fe36282b785d3cdc1b5 /drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | |
parent | 3501269d1cdb08b5b8e67d6742f606211816e827 (diff) |
gpu: nvgpu: remove platform device on exit
Add ->remove() for undoing the ->probe() and ->late_probe() in
gk20a_platform devices, and call it when gk20a is removed.
Bug 1476801
Change-Id: Ic9b29c0a7ea4a4cae7b5a0f66774bd799eb28434
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/594443
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 25 |
1 files changed, 25 insertions, 0 deletions
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, |