diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 4e3beb7c6..9e9a94a05 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -986,6 +986,14 @@ static int gk20a_pm_finalize_poweron(struct device *dev) if (IS_ENABLED(CONFIG_GK20A_CDE)) gk20a_init_cde_support(g); + +#ifdef CONFIG_INPUT_CFBOOST + if (!g->boost_added) { + gk20a_dbg_info("add touch boost"); + cfb_add_device(dev); + g->boost_added = true; + } +#endif done: return err; } @@ -1526,10 +1534,6 @@ static int gk20a_probe(struct platform_device *dev) gk20a_cde_debugfs_init(dev); #endif -#ifdef CONFIG_INPUT_CFBOOST - cfb_add_device(&dev->dev); -#endif - gk20a_init_gr(gk20a); return 0; @@ -1541,7 +1545,8 @@ static int __exit gk20a_remove(struct platform_device *dev) gk20a_dbg_fn(""); #ifdef CONFIG_INPUT_CFBOOST - cfb_remove_device(&dev->dev); + if (g->boost_added) + cfb_remove_device(&dev->dev); #endif if (g->remove_support) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index a03d5765f..a82ad2546 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -259,6 +259,9 @@ struct gk20a { void __iomem *bar1_saved; bool power_on; +#ifdef CONFIG_INPUT_CFBOOST + bool boost_added; +#endif struct rw_semaphore busy_lock;