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 3fa4f0c6..0c6b1e5f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -740,10 +740,10 @@ void gk20a_put_client(struct gk20a *g) | |||
740 | WARN_ON(g->client_refcount < 0); | 740 | WARN_ON(g->client_refcount < 0); |
741 | } | 741 | } |
742 | 742 | ||
743 | static int gk20a_pm_prepare_poweroff(struct device *_dev) | 743 | static int gk20a_pm_prepare_poweroff(struct device *dev) |
744 | { | 744 | { |
745 | struct platform_device *dev = to_platform_device(_dev); | 745 | struct platform_device *pdev = to_platform_device(dev); |
746 | struct gk20a *g = get_gk20a(dev); | 746 | struct gk20a *g = get_gk20a(pdev); |
747 | int ret = 0; | 747 | int ret = 0; |
748 | 748 | ||
749 | gk20a_dbg_fn(""); | 749 | gk20a_dbg_fn(""); |
@@ -770,6 +770,7 @@ static int gk20a_pm_prepare_poweroff(struct device *_dev) | |||
770 | 770 | ||
771 | /* Disable GPCPLL */ | 771 | /* Disable GPCPLL */ |
772 | ret |= gk20a_suspend_clk_support(g); | 772 | ret |= gk20a_suspend_clk_support(g); |
773 | |||
773 | g->power_on = false; | 774 | g->power_on = false; |
774 | 775 | ||
775 | return ret; | 776 | return ret; |
@@ -793,10 +794,10 @@ static void gk20a_detect_chip(struct gk20a *g) | |||
793 | g->gpu_characteristics.rev); | 794 | g->gpu_characteristics.rev); |
794 | } | 795 | } |
795 | 796 | ||
796 | static int gk20a_pm_finalize_poweron(struct device *_dev) | 797 | static int gk20a_pm_finalize_poweron(struct device *dev) |
797 | { | 798 | { |
798 | struct platform_device *dev = to_platform_device(_dev); | 799 | struct platform_device *pdev = to_platform_device(dev); |
799 | struct gk20a *g = get_gk20a(dev); | 800 | struct gk20a *g = get_gk20a(pdev); |
800 | int err, nice_value; | 801 | int err, nice_value; |
801 | 802 | ||
802 | gk20a_dbg_fn(""); | 803 | gk20a_dbg_fn(""); |
@@ -849,7 +850,7 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
849 | saving features (blcg/slcg) are enabled. For now, do it here. */ | 850 | saving features (blcg/slcg) are enabled. For now, do it here. */ |
850 | err = gk20a_init_clk_support(g); | 851 | err = gk20a_init_clk_support(g); |
851 | if (err) { | 852 | if (err) { |
852 | gk20a_err(&dev->dev, "failed to init gk20a clk"); | 853 | gk20a_err(dev, "failed to init gk20a clk"); |
853 | goto done; | 854 | goto done; |
854 | } | 855 | } |
855 | 856 | ||
@@ -868,7 +869,7 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
868 | 869 | ||
869 | err = gk20a_init_fifo_reset_enable_hw(g); | 870 | err = gk20a_init_fifo_reset_enable_hw(g); |
870 | if (err) { | 871 | if (err) { |
871 | gk20a_err(&dev->dev, "failed to reset gk20a fifo"); | 872 | gk20a_err(dev, "failed to reset gk20a fifo"); |
872 | goto done; | 873 | goto done; |
873 | } | 874 | } |
874 | 875 | ||
@@ -877,43 +878,43 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
877 | 878 | ||
878 | err = gk20a_init_mm_support(g); | 879 | err = gk20a_init_mm_support(g); |
879 | if (err) { | 880 | if (err) { |
880 | gk20a_err(&dev->dev, "failed to init gk20a mm"); | 881 | gk20a_err(dev, "failed to init gk20a mm"); |
881 | goto done; | 882 | goto done; |
882 | } | 883 | } |
883 | 884 | ||
884 | err = gk20a_init_pmu_support(g); | 885 | err = gk20a_init_pmu_support(g); |
885 | if (err) { | 886 | if (err) { |
886 | gk20a_err(&dev->dev, "failed to init gk20a pmu"); | 887 | gk20a_err(dev, "failed to init gk20a pmu"); |
887 | goto done; | 888 | goto done; |
888 | } | 889 | } |
889 | 890 | ||
890 | err = gk20a_init_fifo_support(g); | 891 | err = gk20a_init_fifo_support(g); |
891 | if (err) { | 892 | if (err) { |
892 | gk20a_err(&dev->dev, "failed to init gk20a fifo"); | 893 | gk20a_err(dev, "failed to init gk20a fifo"); |
893 | goto done; | 894 | goto done; |
894 | } | 895 | } |
895 | 896 | ||
896 | err = gk20a_init_gr_support(g); | 897 | err = gk20a_init_gr_support(g); |
897 | if (err) { | 898 | if (err) { |
898 | gk20a_err(&dev->dev, "failed to init gk20a gr"); | 899 | gk20a_err(dev, "failed to init gk20a gr"); |
899 | goto done; | 900 | goto done; |
900 | } | 901 | } |
901 | 902 | ||
902 | err = gk20a_init_pmu_setup_hw2(g); | 903 | err = gk20a_init_pmu_setup_hw2(g); |
903 | if (err) { | 904 | if (err) { |
904 | gk20a_err(&dev->dev, "failed to init gk20a pmu_hw2"); | 905 | gk20a_err(dev, "failed to init gk20a pmu_hw2"); |
905 | goto done; | 906 | goto done; |
906 | } | 907 | } |
907 | 908 | ||
908 | err = gk20a_init_therm_support(g); | 909 | err = gk20a_init_therm_support(g); |
909 | if (err) { | 910 | if (err) { |
910 | gk20a_err(&dev->dev, "failed to init gk20a therm"); | 911 | gk20a_err(dev, "failed to init gk20a therm"); |
911 | goto done; | 912 | goto done; |
912 | } | 913 | } |
913 | 914 | ||
914 | err = gk20a_init_gpu_characteristics(g); | 915 | err = gk20a_init_gpu_characteristics(g); |
915 | if (err) { | 916 | if (err) { |
916 | gk20a_err(&dev->dev, "failed to init gk20a gpu characteristics"); | 917 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); |
917 | goto done; | 918 | goto done; |
918 | } | 919 | } |
919 | 920 | ||
@@ -1540,27 +1541,6 @@ void gk20a_busy_noresume(struct platform_device *pdev) | |||
1540 | pm_runtime_get_noresume(&pdev->dev); | 1541 | pm_runtime_get_noresume(&pdev->dev); |
1541 | } | 1542 | } |
1542 | 1543 | ||
1543 | int gk20a_channel_busy(struct platform_device *pdev) | ||
1544 | { | ||
1545 | int ret = 0; | ||
1546 | |||
1547 | ret = gk20a_platform_channel_busy(pdev); | ||
1548 | if (ret) | ||
1549 | return ret; | ||
1550 | |||
1551 | ret = gk20a_busy(pdev); | ||
1552 | if (ret) | ||
1553 | gk20a_platform_channel_idle(pdev); | ||
1554 | |||
1555 | return ret; | ||
1556 | } | ||
1557 | |||
1558 | void gk20a_channel_idle(struct platform_device *pdev) | ||
1559 | { | ||
1560 | gk20a_idle(pdev); | ||
1561 | gk20a_platform_channel_idle(pdev); | ||
1562 | } | ||
1563 | |||
1564 | int gk20a_busy(struct platform_device *pdev) | 1544 | int gk20a_busy(struct platform_device *pdev) |
1565 | { | 1545 | { |
1566 | int ret = 0; | 1546 | int ret = 0; |