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/gk20a_sysfs.c | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 60e65b3e..cdbe3c09 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1148,6 +1148,9 @@ static void gk20a_pm_shutdown(struct platform_device *pdev) | |||
1148 | break; | 1148 | break; |
1149 | } | 1149 | } |
1150 | #endif | 1150 | #endif |
1151 | |||
1152 | /* Be ready for rail-gate after this point */ | ||
1153 | gk20a_pm_prepare_poweroff(&pdev->dev); | ||
1151 | } | 1154 | } |
1152 | 1155 | ||
1153 | #ifdef CONFIG_PM | 1156 | #ifdef CONFIG_PM |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index d8da34d9..96a945f8 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -262,6 +262,19 @@ static ssize_t railgate_delay_show(struct device *dev, | |||
262 | static DEVICE_ATTR(railgate_delay, ROOTRW, railgate_delay_show, | 262 | static DEVICE_ATTR(railgate_delay, ROOTRW, railgate_delay_show, |
263 | railgate_delay_store); | 263 | railgate_delay_store); |
264 | 264 | ||
265 | static ssize_t is_railgated_show(struct device *dev, | ||
266 | struct device_attribute *attr, char *buf) | ||
267 | { | ||
268 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
269 | bool is_railgated = 0; | ||
270 | |||
271 | if (platform->is_railgated) | ||
272 | is_railgated = platform->is_railgated(platform->g->dev); | ||
273 | |||
274 | return snprintf(buf, PAGE_SIZE, "%s\n", is_railgated ? "yes" : "no"); | ||
275 | } | ||
276 | static DEVICE_ATTR(is_railgated, S_IRUGO, is_railgated_show, NULL); | ||
277 | |||
265 | static ssize_t clockgate_delay_store(struct device *dev, | 278 | static ssize_t clockgate_delay_store(struct device *dev, |
266 | struct device_attribute *attr, | 279 | struct device_attribute *attr, |
267 | const char *buf, size_t count) | 280 | const char *buf, size_t count) |
@@ -691,6 +704,7 @@ void gk20a_remove_sysfs(struct device *dev) | |||
691 | device_remove_file(dev, &dev_attr_counters_reset); | 704 | device_remove_file(dev, &dev_attr_counters_reset); |
692 | device_remove_file(dev, &dev_attr_load); | 705 | device_remove_file(dev, &dev_attr_load); |
693 | device_remove_file(dev, &dev_attr_railgate_delay); | 706 | device_remove_file(dev, &dev_attr_railgate_delay); |
707 | device_remove_file(dev, &dev_attr_is_railgated); | ||
694 | device_remove_file(dev, &dev_attr_clockgate_delay); | 708 | device_remove_file(dev, &dev_attr_clockgate_delay); |
695 | #ifdef CONFIG_PM_RUNTIME | 709 | #ifdef CONFIG_PM_RUNTIME |
696 | device_remove_file(dev, &dev_attr_force_idle); | 710 | device_remove_file(dev, &dev_attr_force_idle); |
@@ -720,6 +734,7 @@ void gk20a_create_sysfs(struct platform_device *dev) | |||
720 | error |= device_create_file(&dev->dev, &dev_attr_counters_reset); | 734 | error |= device_create_file(&dev->dev, &dev_attr_counters_reset); |
721 | error |= device_create_file(&dev->dev, &dev_attr_load); | 735 | error |= device_create_file(&dev->dev, &dev_attr_load); |
722 | error |= device_create_file(&dev->dev, &dev_attr_railgate_delay); | 736 | error |= device_create_file(&dev->dev, &dev_attr_railgate_delay); |
737 | error |= device_create_file(&dev->dev, &dev_attr_is_railgated); | ||
723 | error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay); | 738 | error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay); |
724 | #ifdef CONFIG_PM_RUNTIME | 739 | #ifdef CONFIG_PM_RUNTIME |
725 | error |= device_create_file(&dev->dev, &dev_attr_force_idle); | 740 | error |= device_create_file(&dev->dev, &dev_attr_force_idle); |