diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index ef9ddd6d..60e65b3e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1226,7 +1226,6 @@ static int gk20a_pm_resume(struct device *dev) | |||
1226 | return gk20a_pm_finalize_poweron(dev); | 1226 | return gk20a_pm_finalize_poweron(dev); |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1230 | static int gk20a_pm_initialise_domain(struct platform_device *pdev) | 1229 | static int gk20a_pm_initialise_domain(struct platform_device *pdev) |
1231 | { | 1230 | { |
1232 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | 1231 | struct gk20a_platform *platform = platform_get_drvdata(pdev); |
@@ -1246,50 +1245,6 @@ static int gk20a_pm_initialise_domain(struct platform_device *pdev) | |||
1246 | return 0; | 1245 | return 0; |
1247 | } | 1246 | } |
1248 | 1247 | ||
1249 | #else | ||
1250 | static int gk20a_pm_initialise_domain(struct platform_device *pdev) | ||
1251 | { | ||
1252 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | ||
1253 | struct dev_power_governor *pm_domain_gov = NULL; | ||
1254 | struct generic_pm_domain *domain = NULL; | ||
1255 | int ret = 0; | ||
1256 | struct gk20a_domain_data *gpu_gpd_data = (struct gk20a_domain_data *) | ||
1257 | kzalloc(sizeof(struct gk20a_domain_data), GFP_KERNEL); | ||
1258 | |||
1259 | if (!gpu_gpd_data) | ||
1260 | return -ENOMEM; | ||
1261 | |||
1262 | gpu_gpd_data->gk20a = platform->g; | ||
1263 | domain = &gpu_gpd_data->gpd; | ||
1264 | |||
1265 | domain->name = "gpu"; | ||
1266 | |||
1267 | #ifdef CONFIG_PM_RUNTIME | ||
1268 | if (!platform->can_railgate) | ||
1269 | pm_domain_gov = &pm_domain_always_on_gov; | ||
1270 | #endif | ||
1271 | |||
1272 | pm_genpd_init(domain, pm_domain_gov, true); | ||
1273 | |||
1274 | domain->power_off = gk20a_pm_railgate; | ||
1275 | domain->power_on = gk20a_pm_unrailgate; | ||
1276 | domain->dev_ops.start = gk20a_pm_enable_clk; | ||
1277 | domain->dev_ops.stop = gk20a_pm_disable_clk; | ||
1278 | domain->dev_ops.save_state = gk20a_pm_prepare_poweroff; | ||
1279 | domain->dev_ops.restore_state = gk20a_pm_finalize_poweron; | ||
1280 | domain->dev_ops.suspend = gk20a_pm_suspend; | ||
1281 | domain->dev_ops.resume = gk20a_pm_resume; | ||
1282 | |||
1283 | device_set_wakeup_capable(&pdev->dev, 0); | ||
1284 | ret = pm_genpd_add_device(domain, &pdev->dev); | ||
1285 | |||
1286 | if (platform->railgate_delay) | ||
1287 | pm_genpd_set_poweroff_delay(domain, platform->railgate_delay); | ||
1288 | |||
1289 | return ret; | ||
1290 | } | ||
1291 | #endif | ||
1292 | |||
1293 | static int gk20a_pm_init(struct platform_device *dev) | 1248 | static int gk20a_pm_init(struct platform_device *dev) |
1294 | { | 1249 | { |
1295 | struct gk20a_platform *platform = platform_get_drvdata(dev); | 1250 | struct gk20a_platform *platform = platform_get_drvdata(dev); |
@@ -1356,10 +1311,7 @@ static int gk20a_probe(struct platform_device *dev) | |||
1356 | struct gk20a *gk20a; | 1311 | struct gk20a *gk20a; |
1357 | int err; | 1312 | int err; |
1358 | struct gk20a_platform *platform = NULL; | 1313 | struct gk20a_platform *platform = NULL; |
1359 | |||
1360 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1361 | struct gk20a_domain_data *gk20a_domain; | 1314 | struct gk20a_domain_data *gk20a_domain; |
1362 | #endif | ||
1363 | 1315 | ||
1364 | if (dev->dev.of_node) { | 1316 | if (dev->dev.of_node) { |
1365 | const struct of_device_id *match; | 1317 | const struct of_device_id *match; |
@@ -1391,11 +1343,9 @@ static int gk20a_probe(struct platform_device *dev) | |||
1391 | init_waitqueue_head(&gk20a->sw_irq_stall_last_handled_wq); | 1343 | init_waitqueue_head(&gk20a->sw_irq_stall_last_handled_wq); |
1392 | init_waitqueue_head(&gk20a->sw_irq_nonstall_last_handled_wq); | 1344 | init_waitqueue_head(&gk20a->sw_irq_nonstall_last_handled_wq); |
1393 | 1345 | ||
1394 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1395 | gk20a_domain = container_of(dev_to_genpd(&dev->dev), | 1346 | gk20a_domain = container_of(dev_to_genpd(&dev->dev), |
1396 | struct gk20a_domain_data, gpd); | 1347 | struct gk20a_domain_data, gpd); |
1397 | gk20a_domain->gk20a = gk20a; | 1348 | gk20a_domain->gk20a = gk20a; |
1398 | #endif | ||
1399 | 1349 | ||
1400 | set_gk20a(dev, gk20a); | 1350 | set_gk20a(dev, gk20a); |
1401 | gk20a->dev = dev; | 1351 | gk20a->dev = dev; |
@@ -1611,9 +1561,6 @@ static struct platform_driver gk20a_driver = { | |||
1611 | } | 1561 | } |
1612 | }; | 1562 | }; |
1613 | 1563 | ||
1614 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1615 | |||
1616 | |||
1617 | static int _gk20a_init_domain(struct device_node *np, | 1564 | static int _gk20a_init_domain(struct device_node *np, |
1618 | struct generic_pm_domain *gpd) | 1565 | struct generic_pm_domain *gpd) |
1619 | { | 1566 | { |
@@ -1663,13 +1610,6 @@ static int gk20a_domain_init(struct of_device_id *matches) | |||
1663 | 1610 | ||
1664 | return ret; | 1611 | return ret; |
1665 | } | 1612 | } |
1666 | #else | ||
1667 | static int gk20a_domain_init(struct of_device_id *matches) | ||
1668 | { | ||
1669 | return 0; | ||
1670 | } | ||
1671 | #endif | ||
1672 | |||
1673 | 1613 | ||
1674 | static int __init gk20a_init(void) | 1614 | static int __init gk20a_init(void) |
1675 | { | 1615 | { |