summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-05-27 10:20:09 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:58 -0400
commit2ad53bb4ca3877694853ac517c351ed1a9825772 (patch)
treee24a1d98864cafa43266d76b817fd4ca353a11fa /drivers/gpu
parentcd9f8553ad1e6e03e8a3a70cb8d08edd3513fb66 (diff)
gpu: nvgpu: add is_railgated() callback
Add is_railgated() platform callback to check status of gk20a power rail Bug 1376916 Bug 1487804 Change-Id: Ia0d909210dc409ab684eb6f20528b81500aecd5c Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c13
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index d9d86b63..49f386d8 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -88,6 +88,9 @@ struct gk20a_platform {
88 /* Called to turn on the device */ 88 /* Called to turn on the device */
89 int (*unrailgate)(struct platform_device *dev); 89 int (*unrailgate)(struct platform_device *dev);
90 90
91 /* Called to check state of device */
92 bool (*is_railgated)(struct platform_device *dev);
93
91 /* Postscale callback is called after frequency change */ 94 /* Postscale callback is called after frequency change */
92 void (*postscale)(struct platform_device *pdev, 95 void (*postscale)(struct platform_device *pdev,
93 unsigned long freq); 96 unsigned long freq);
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
index 3a739cb6..813053e0 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
@@ -305,6 +305,17 @@ void gk20a_tegra_calibrate_emc(struct gk20a_emc_params *emc_params,
305} 305}
306 306
307/* 307/*
308 * gk20a_tegra_is_railgated()
309 *
310 * Check status of gk20a power rail
311 */
312
313static bool gk20a_tegra_is_railgated(struct platform_device *pdev)
314{
315 return !tegra_powergate_is_powered(TEGRA_POWERGATE_GPU);
316}
317
318/*
308 * gk20a_tegra_railgate() 319 * gk20a_tegra_railgate()
309 * 320 *
310 * Gate (disable) gk20a power rail 321 * Gate (disable) gk20a power rail
@@ -504,6 +515,7 @@ struct gk20a_platform t132_gk20a_tegra_platform = {
504 .suspend = gk20a_tegra_suspend, 515 .suspend = gk20a_tegra_suspend,
505 .railgate = gk20a_tegra_railgate, 516 .railgate = gk20a_tegra_railgate,
506 .unrailgate = gk20a_tegra_unrailgate, 517 .unrailgate = gk20a_tegra_unrailgate,
518 .is_railgated = gk20a_tegra_is_railgated,
507 519
508 /* frequency scaling configuration */ 520 /* frequency scaling configuration */
509 .prescale = gk20a_tegra_prescale, 521 .prescale = gk20a_tegra_prescale,
@@ -530,6 +542,7 @@ struct gk20a_platform gk20a_tegra_platform = {
530 .suspend = gk20a_tegra_suspend, 542 .suspend = gk20a_tegra_suspend,
531 .railgate = gk20a_tegra_railgate, 543 .railgate = gk20a_tegra_railgate,
532 .unrailgate = gk20a_tegra_unrailgate, 544 .unrailgate = gk20a_tegra_unrailgate,
545 .is_railgated = gk20a_tegra_is_railgated,
533 546
534 /* frequency scaling configuration */ 547 /* frequency scaling configuration */
535 .prescale = gk20a_tegra_prescale, 548 .prescale = gk20a_tegra_prescale,