diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index cdbe3c096..121e442cd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -584,6 +585,10 @@ static void gk20a_remove_support(struct platform_device *dev) { struct gk20a *g = get_gk20a(dev); +#ifdef CONFIG_TEGRA_COMMON + tegra_unregister_idle_unidle(); +#endif + if (g->pmu.remove_support) g->pmu.remove_support(&g->pmu); @@ -618,6 +623,10 @@ static int gk20a_init_support(struct platform_device *dev) int err = 0; struct gk20a *g = get_gk20a(dev); +#ifdef CONFIG_TEGRA_COMMON + tegra_register_idle_unidle(gk20a_do_idle, gk20a_do_unidle); +#endif + g->regs = gk20a_ioremap_resource(dev, GK20A_BAR0_IORESOURCE_MEM, &g->reg_mem); if (IS_ERR(g->regs)) { diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 6454bbfc6..ed209929d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -839,6 +839,8 @@ void gk20a_idle(struct platform_device *pdev); void gk20a_disable(struct gk20a *g, u32 units); void gk20a_enable(struct gk20a *g, u32 units); void gk20a_reset(struct gk20a *g, u32 units); +int gk20a_do_idle(void); +int gk20a_do_unidle(void); int __gk20a_do_idle(struct platform_device *pdev, bool force_reset); int __gk20a_do_unidle(struct platform_device *pdev);