diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 0e117b69..f04e9187 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -739,10 +739,10 @@ void gk20a_put_client(struct gk20a *g) | |||
739 | WARN_ON(g->client_refcount < 0); | 739 | WARN_ON(g->client_refcount < 0); |
740 | } | 740 | } |
741 | 741 | ||
742 | static int gk20a_pm_prepare_poweroff(struct device *_dev) | 742 | static int gk20a_pm_prepare_poweroff(struct device *dev) |
743 | { | 743 | { |
744 | struct platform_device *dev = to_platform_device(_dev); | 744 | struct platform_device *pdev = to_platform_device(dev); |
745 | struct gk20a *g = get_gk20a(dev); | 745 | struct gk20a *g = get_gk20a(pdev); |
746 | int ret = 0; | 746 | int ret = 0; |
747 | 747 | ||
748 | gk20a_dbg_fn(""); | 748 | gk20a_dbg_fn(""); |
@@ -767,6 +767,7 @@ static int gk20a_pm_prepare_poweroff(struct device *_dev) | |||
767 | 767 | ||
768 | /* Disable GPCPLL */ | 768 | /* Disable GPCPLL */ |
769 | ret |= gk20a_suspend_clk_support(g); | 769 | ret |= gk20a_suspend_clk_support(g); |
770 | |||
770 | g->power_on = false; | 771 | g->power_on = false; |
771 | 772 | ||
772 | return ret; | 773 | return ret; |
@@ -790,10 +791,10 @@ static void gk20a_detect_chip(struct gk20a *g) | |||
790 | g->gpu_characteristics.rev); | 791 | g->gpu_characteristics.rev); |
791 | } | 792 | } |
792 | 793 | ||
793 | static int gk20a_pm_finalize_poweron(struct device *_dev) | 794 | static int gk20a_pm_finalize_poweron(struct device *dev) |
794 | { | 795 | { |
795 | struct platform_device *dev = to_platform_device(_dev); | 796 | struct platform_device *pdev = to_platform_device(dev); |
796 | struct gk20a *g = get_gk20a(dev); | 797 | struct gk20a *g = get_gk20a(pdev); |
797 | int err, nice_value; | 798 | int err, nice_value; |
798 | 799 | ||
799 | gk20a_dbg_fn(""); | 800 | gk20a_dbg_fn(""); |
@@ -846,7 +847,7 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
846 | saving features (blcg/slcg) are enabled. For now, do it here. */ | 847 | saving features (blcg/slcg) are enabled. For now, do it here. */ |
847 | err = gk20a_init_clk_support(g); | 848 | err = gk20a_init_clk_support(g); |
848 | if (err) { | 849 | if (err) { |
849 | gk20a_err(&dev->dev, "failed to init gk20a clk"); | 850 | gk20a_err(dev, "failed to init gk20a clk"); |
850 | goto done; | 851 | goto done; |
851 | } | 852 | } |
852 | 853 | ||
@@ -865,49 +866,49 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
865 | 866 | ||
866 | err = gk20a_init_fifo_reset_enable_hw(g); | 867 | err = gk20a_init_fifo_reset_enable_hw(g); |
867 | if (err) { | 868 | if (err) { |
868 | gk20a_err(&dev->dev, "failed to reset gk20a fifo"); | 869 | gk20a_err(dev, "failed to reset gk20a fifo"); |
869 | goto done; | 870 | goto done; |
870 | } | 871 | } |
871 | 872 | ||
872 | err = gk20a_init_mm_support(g); | 873 | err = gk20a_init_mm_support(g); |
873 | if (err) { | 874 | if (err) { |
874 | gk20a_err(&dev->dev, "failed to init gk20a mm"); | 875 | gk20a_err(dev, "failed to init gk20a mm"); |
875 | goto done; | 876 | goto done; |
876 | } | 877 | } |
877 | 878 | ||
878 | err = gk20a_init_pmu_support(g); | 879 | err = gk20a_init_pmu_support(g); |
879 | if (err) { | 880 | if (err) { |
880 | gk20a_err(&dev->dev, "failed to init gk20a pmu"); | 881 | gk20a_err(dev, "failed to init gk20a pmu"); |
881 | goto done; | 882 | goto done; |
882 | } | 883 | } |
883 | 884 | ||
884 | err = gk20a_init_fifo_support(g); | 885 | err = gk20a_init_fifo_support(g); |
885 | if (err) { | 886 | if (err) { |
886 | gk20a_err(&dev->dev, "failed to init gk20a fifo"); | 887 | gk20a_err(dev, "failed to init gk20a fifo"); |
887 | goto done; | 888 | goto done; |
888 | } | 889 | } |
889 | 890 | ||
890 | err = gk20a_init_gr_support(g); | 891 | err = gk20a_init_gr_support(g); |
891 | if (err) { | 892 | if (err) { |
892 | gk20a_err(&dev->dev, "failed to init gk20a gr"); | 893 | gk20a_err(dev, "failed to init gk20a gr"); |
893 | goto done; | 894 | goto done; |
894 | } | 895 | } |
895 | 896 | ||
896 | err = gk20a_init_pmu_setup_hw2(g); | 897 | err = gk20a_init_pmu_setup_hw2(g); |
897 | if (err) { | 898 | if (err) { |
898 | gk20a_err(&dev->dev, "failed to init gk20a pmu_hw2"); | 899 | gk20a_err(dev, "failed to init gk20a pmu_hw2"); |
899 | goto done; | 900 | goto done; |
900 | } | 901 | } |
901 | 902 | ||
902 | err = gk20a_init_therm_support(g); | 903 | err = gk20a_init_therm_support(g); |
903 | if (err) { | 904 | if (err) { |
904 | gk20a_err(&dev->dev, "failed to init gk20a therm"); | 905 | gk20a_err(dev, "failed to init gk20a therm"); |
905 | goto done; | 906 | goto done; |
906 | } | 907 | } |
907 | 908 | ||
908 | err = gk20a_init_gpu_characteristics(g); | 909 | err = gk20a_init_gpu_characteristics(g); |
909 | if (err) { | 910 | if (err) { |
910 | gk20a_err(&dev->dev, "failed to init gk20a gpu characteristics"); | 911 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); |
911 | goto done; | 912 | goto done; |
912 | } | 913 | } |
913 | 914 | ||
@@ -1507,27 +1508,6 @@ void gk20a_busy_noresume(struct platform_device *pdev) | |||
1507 | pm_runtime_get_noresume(&pdev->dev); | 1508 | pm_runtime_get_noresume(&pdev->dev); |
1508 | } | 1509 | } |
1509 | 1510 | ||
1510 | int gk20a_channel_busy(struct platform_device *pdev) | ||
1511 | { | ||
1512 | int ret = 0; | ||
1513 | |||
1514 | ret = gk20a_platform_channel_busy(pdev); | ||
1515 | if (ret) | ||
1516 | return ret; | ||
1517 | |||
1518 | ret = gk20a_busy(pdev); | ||
1519 | if (ret) | ||
1520 | gk20a_platform_channel_idle(pdev); | ||
1521 | |||
1522 | return ret; | ||
1523 | } | ||
1524 | |||
1525 | void gk20a_channel_idle(struct platform_device *pdev) | ||
1526 | { | ||
1527 | gk20a_idle(pdev); | ||
1528 | gk20a_platform_channel_idle(pdev); | ||
1529 | } | ||
1530 | |||
1531 | int gk20a_busy(struct platform_device *pdev) | 1511 | int gk20a_busy(struct platform_device *pdev) |
1532 | { | 1512 | { |
1533 | int ret = 0; | 1513 | int ret = 0; |