From 4ac110cb8a46a0c91a4a1e39c168de1b49688971 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 7 May 2014 13:09:36 +0300 Subject: gpu: nvgpu: Register as subdomain of host1x Add gk20a as a sub power domain of host1x. This enforces keeping host1x on when using gk20a. Bug 200003112 Change-Id: I08db595bc7b819d86d33fb98af0d8fb4de369463 Signed-off-by: Arto Merilainen Reviewed-on: http://git-master/r/407543 Reviewed-by: Riham Haidar Tested-by: Riham Haidar --- drivers/gpu/nvgpu/gk20a/gk20a.c | 52 +++++++++++++---------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 0e117b69..f04e9187 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -739,10 +739,10 @@ void gk20a_put_client(struct gk20a *g) WARN_ON(g->client_refcount < 0); } -static int gk20a_pm_prepare_poweroff(struct device *_dev) +static int gk20a_pm_prepare_poweroff(struct device *dev) { - struct platform_device *dev = to_platform_device(_dev); - struct gk20a *g = get_gk20a(dev); + struct platform_device *pdev = to_platform_device(dev); + struct gk20a *g = get_gk20a(pdev); int ret = 0; gk20a_dbg_fn(""); @@ -767,6 +767,7 @@ static int gk20a_pm_prepare_poweroff(struct device *_dev) /* Disable GPCPLL */ ret |= gk20a_suspend_clk_support(g); + g->power_on = false; return ret; @@ -790,10 +791,10 @@ static void gk20a_detect_chip(struct gk20a *g) g->gpu_characteristics.rev); } -static int gk20a_pm_finalize_poweron(struct device *_dev) +static int gk20a_pm_finalize_poweron(struct device *dev) { - struct platform_device *dev = to_platform_device(_dev); - struct gk20a *g = get_gk20a(dev); + struct platform_device *pdev = to_platform_device(dev); + struct gk20a *g = get_gk20a(pdev); int err, nice_value; gk20a_dbg_fn(""); @@ -846,7 +847,7 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) saving features (blcg/slcg) are enabled. For now, do it here. */ err = gk20a_init_clk_support(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a clk"); + gk20a_err(dev, "failed to init gk20a clk"); goto done; } @@ -865,49 +866,49 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) err = gk20a_init_fifo_reset_enable_hw(g); if (err) { - gk20a_err(&dev->dev, "failed to reset gk20a fifo"); + gk20a_err(dev, "failed to reset gk20a fifo"); goto done; } err = gk20a_init_mm_support(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a mm"); + gk20a_err(dev, "failed to init gk20a mm"); goto done; } err = gk20a_init_pmu_support(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a pmu"); + gk20a_err(dev, "failed to init gk20a pmu"); goto done; } err = gk20a_init_fifo_support(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a fifo"); + gk20a_err(dev, "failed to init gk20a fifo"); goto done; } err = gk20a_init_gr_support(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a gr"); + gk20a_err(dev, "failed to init gk20a gr"); goto done; } err = gk20a_init_pmu_setup_hw2(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a pmu_hw2"); + gk20a_err(dev, "failed to init gk20a pmu_hw2"); goto done; } err = gk20a_init_therm_support(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a therm"); + gk20a_err(dev, "failed to init gk20a therm"); goto done; } err = gk20a_init_gpu_characteristics(g); if (err) { - gk20a_err(&dev->dev, "failed to init gk20a gpu characteristics"); + gk20a_err(dev, "failed to init gk20a gpu characteristics"); goto done; } @@ -1507,27 +1508,6 @@ void gk20a_busy_noresume(struct platform_device *pdev) pm_runtime_get_noresume(&pdev->dev); } -int gk20a_channel_busy(struct platform_device *pdev) -{ - int ret = 0; - - ret = gk20a_platform_channel_busy(pdev); - if (ret) - return ret; - - ret = gk20a_busy(pdev); - if (ret) - gk20a_platform_channel_idle(pdev); - - return ret; -} - -void gk20a_channel_idle(struct platform_device *pdev) -{ - gk20a_idle(pdev); - gk20a_platform_channel_idle(pdev); -} - int gk20a_busy(struct platform_device *pdev) { int ret = 0; -- cgit v1.2.2