diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 1411d1cc..4e06e139 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1182,15 +1182,29 @@ const struct dev_pm_ops gk20a_pm_ops = { | |||
1182 | }; | 1182 | }; |
1183 | #endif | 1183 | #endif |
1184 | 1184 | ||
1185 | static int _gk20a_pm_railgate(struct platform_device *pdev) | ||
1186 | { | ||
1187 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | ||
1188 | int ret = 0; | ||
1189 | if (platform->railgate) | ||
1190 | ret = platform->railgate(pdev); | ||
1191 | return ret; | ||
1192 | } | ||
1193 | |||
1185 | static int gk20a_pm_railgate(struct generic_pm_domain *domain) | 1194 | static int gk20a_pm_railgate(struct generic_pm_domain *domain) |
1186 | { | 1195 | { |
1187 | struct gk20a *g = container_of(domain, struct gk20a, pd); | 1196 | struct gk20a *g = container_of(domain, struct gk20a, pd); |
1188 | struct gk20a_platform *platform = platform_get_drvdata(g->dev); | 1197 | struct gk20a_platform *platform = platform_get_drvdata(g->dev); |
1189 | int ret = 0; | ||
1190 | 1198 | ||
1191 | if (platform->railgate) | 1199 | return _gk20a_pm_railgate(platform->g->dev); |
1192 | ret = platform->railgate(platform->g->dev); | 1200 | } |
1193 | 1201 | ||
1202 | static int _gk20a_pm_unrailgate(struct platform_device *pdev) | ||
1203 | { | ||
1204 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | ||
1205 | int ret = 0; | ||
1206 | if (platform->unrailgate) | ||
1207 | ret = platform->unrailgate(pdev); | ||
1194 | return ret; | 1208 | return ret; |
1195 | } | 1209 | } |
1196 | 1210 | ||
@@ -1198,12 +1212,8 @@ static int gk20a_pm_unrailgate(struct generic_pm_domain *domain) | |||
1198 | { | 1212 | { |
1199 | struct gk20a *g = container_of(domain, struct gk20a, pd); | 1213 | struct gk20a *g = container_of(domain, struct gk20a, pd); |
1200 | struct gk20a_platform *platform = platform_get_drvdata(g->dev); | 1214 | struct gk20a_platform *platform = platform_get_drvdata(g->dev); |
1201 | int ret = 0; | ||
1202 | 1215 | ||
1203 | if (platform->unrailgate) | 1216 | return _gk20a_pm_unrailgate(platform->g->dev); |
1204 | ret = platform->unrailgate(platform->g->dev); | ||
1205 | |||
1206 | return ret; | ||
1207 | } | 1217 | } |
1208 | 1218 | ||
1209 | static int gk20a_pm_suspend(struct device *dev) | 1219 | static int gk20a_pm_suspend(struct device *dev) |
@@ -1274,6 +1284,8 @@ static int gk20a_pm_init(struct platform_device *dev) | |||
1274 | struct gk20a_platform *platform = platform_get_drvdata(dev); | 1284 | struct gk20a_platform *platform = platform_get_drvdata(dev); |
1275 | int err = 0; | 1285 | int err = 0; |
1276 | 1286 | ||
1287 | gk20a_dbg_fn(""); | ||
1288 | |||
1277 | /* Initialise pm runtime */ | 1289 | /* Initialise pm runtime */ |
1278 | if (platform->clockgate_delay) { | 1290 | if (platform->clockgate_delay) { |
1279 | pm_runtime_set_autosuspend_delay(&dev->dev, | 1291 | pm_runtime_set_autosuspend_delay(&dev->dev, |
@@ -1288,9 +1300,9 @@ static int gk20a_pm_init(struct platform_device *dev) | |||
1288 | /* Enable runtime railgating if possible. If not, | 1300 | /* Enable runtime railgating if possible. If not, |
1289 | * turn on the rail now. */ | 1301 | * turn on the rail now. */ |
1290 | if (platform->can_railgate && IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) | 1302 | if (platform->can_railgate && IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) |
1291 | platform->railgate(dev); | 1303 | _gk20a_pm_railgate(dev); |
1292 | else | 1304 | else |
1293 | platform->unrailgate(dev); | 1305 | _gk20a_pm_unrailgate(dev); |
1294 | 1306 | ||
1295 | /* genpd will take care of runtime power management if it is enabled */ | 1307 | /* genpd will take care of runtime power management if it is enabled */ |
1296 | if (IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) | 1308 | if (IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) |