summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index e70cc0de..0eaf31fa 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -651,9 +651,6 @@ static void gk20a_remove_support(struct platform_device *dev)
651 if (g->pmu.remove_support) 651 if (g->pmu.remove_support)
652 g->pmu.remove_support(&g->pmu); 652 g->pmu.remove_support(&g->pmu);
653 653
654 if (g->gk20a_cdev.gk20a_cooling_dev)
655 thermal_cooling_device_unregister(g->gk20a_cdev.gk20a_cooling_dev);
656
657 if (g->gr.remove_support) 654 if (g->gr.remove_support)
658 g->gr.remove_support(&g->gr); 655 g->gr.remove_support(&g->gr);
659 656
@@ -1009,53 +1006,6 @@ static struct of_device_id tegra_gk20a_of_match[] = {
1009 { }, 1006 { },
1010}; 1007};
1011 1008
1012int tegra_gpu_get_max_state(struct thermal_cooling_device *cdev,
1013 unsigned long *max_state)
1014{
1015 struct cooling_device_gk20a *gk20a_gpufreq_device = cdev->devdata;
1016
1017 *max_state = gk20a_gpufreq_device->gk20a_freq_table_size - 1;
1018 return 0;
1019}
1020
1021int tegra_gpu_get_cur_state(struct thermal_cooling_device *cdev,
1022 unsigned long *cur_state)
1023{
1024 struct cooling_device_gk20a *gk20a_gpufreq_device = cdev->devdata;
1025
1026 *cur_state = gk20a_gpufreq_device->gk20a_freq_state;
1027 return 0;
1028}
1029
1030int tegra_gpu_set_cur_state(struct thermal_cooling_device *c_dev,
1031 unsigned long cur_state)
1032{
1033 u32 target_freq;
1034 struct gk20a *g;
1035 struct gpufreq_table_data *gpu_cooling_table;
1036 struct cooling_device_gk20a *gk20a_gpufreq_device = c_dev->devdata;
1037
1038 BUG_ON(cur_state >= gk20a_gpufreq_device->gk20a_freq_table_size);
1039
1040 g = container_of(gk20a_gpufreq_device, struct gk20a, gk20a_cdev);
1041
1042 gpu_cooling_table = tegra_gpufreq_table_get();
1043 target_freq = gpu_cooling_table[cur_state].frequency;
1044
1045 /* ensure a query for state will get the proper value */
1046 gk20a_gpufreq_device->gk20a_freq_state = cur_state;
1047
1048 gk20a_clk_set_rate(g, target_freq);
1049
1050 return 0;
1051}
1052
1053static struct thermal_cooling_device_ops tegra_gpu_cooling_ops = {
1054 .get_max_state = tegra_gpu_get_max_state,
1055 .get_cur_state = tegra_gpu_get_cur_state,
1056 .set_cur_state = tegra_gpu_set_cur_state,
1057};
1058
1059static int gk20a_create_device( 1009static int gk20a_create_device(
1060 struct platform_device *pdev, int devno, const char *cdev_name, 1010 struct platform_device *pdev, int devno, const char *cdev_name,
1061 struct cdev *cdev, struct device **out, 1011 struct cdev *cdev, struct device **out,
@@ -1421,7 +1371,6 @@ static int gk20a_probe(struct platform_device *dev)
1421 struct gk20a *gk20a; 1371 struct gk20a *gk20a;
1422 int err; 1372 int err;
1423 struct gk20a_platform *platform = NULL; 1373 struct gk20a_platform *platform = NULL;
1424 struct cooling_device_gk20a *gpu_cdev = NULL;
1425 1374
1426 if (dev->dev.of_node) { 1375 if (dev->dev.of_node) {
1427 const struct of_device_id *match; 1376 const struct of_device_id *match;
@@ -1525,13 +1474,6 @@ static int gk20a_probe(struct platform_device *dev)
1525 dev->dev.dma_parms = &gk20a->dma_parms; 1474 dev->dev.dma_parms = &gk20a->dma_parms;
1526 dma_set_max_seg_size(&dev->dev, UINT_MAX); 1475 dma_set_max_seg_size(&dev->dev, UINT_MAX);
1527 1476
1528 gpu_cdev = &gk20a->gk20a_cdev;
1529 gpu_cdev->gk20a_freq_table_size = tegra_gpufreq_table_size_get();
1530 gpu_cdev->gk20a_freq_state = 0;
1531 gpu_cdev->g = gk20a;
1532 gpu_cdev->gk20a_cooling_dev = thermal_cooling_device_register("gk20a_cdev", gpu_cdev,
1533 &tegra_gpu_cooling_ops);
1534
1535 gk20a->gr_idle_timeout_default = 1477 gk20a->gr_idle_timeout_default =
1536 CONFIG_GK20A_DEFAULT_TIMEOUT; 1478 CONFIG_GK20A_DEFAULT_TIMEOUT;
1537 if (tegra_platform_is_silicon()) 1479 if (tegra_platform_is_silicon())