diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 61 |
1 files changed, 1 insertions, 60 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 3dfc50e8..cdbe3c09 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1229,7 +1229,6 @@ static int gk20a_pm_resume(struct device *dev) | |||
1229 | return gk20a_pm_finalize_poweron(dev); | 1229 | return gk20a_pm_finalize_poweron(dev); |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1233 | static int gk20a_pm_initialise_domain(struct platform_device *pdev) | 1232 | static int gk20a_pm_initialise_domain(struct platform_device *pdev) |
1234 | { | 1233 | { |
1235 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | 1234 | struct gk20a_platform *platform = platform_get_drvdata(pdev); |
@@ -1249,50 +1248,6 @@ static int gk20a_pm_initialise_domain(struct platform_device *pdev) | |||
1249 | return 0; | 1248 | return 0; |
1250 | } | 1249 | } |
1251 | 1250 | ||
1252 | #else | ||
1253 | static int gk20a_pm_initialise_domain(struct platform_device *pdev) | ||
1254 | { | ||
1255 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | ||
1256 | struct dev_power_governor *pm_domain_gov = NULL; | ||
1257 | struct generic_pm_domain *domain = NULL; | ||
1258 | int ret = 0; | ||
1259 | struct gk20a_domain_data *gpu_gpd_data = (struct gk20a_domain_data *) | ||
1260 | kzalloc(sizeof(struct gk20a_domain_data), GFP_KERNEL); | ||
1261 | |||
1262 | if (!gpu_gpd_data) | ||
1263 | return -ENOMEM; | ||
1264 | |||
1265 | gpu_gpd_data->gk20a = platform->g; | ||
1266 | domain = &gpu_gpd_data->gpd; | ||
1267 | |||
1268 | domain->name = "gpu"; | ||
1269 | |||
1270 | #ifdef CONFIG_PM_RUNTIME | ||
1271 | if (!platform->can_railgate) | ||
1272 | pm_domain_gov = &pm_domain_always_on_gov; | ||
1273 | #endif | ||
1274 | |||
1275 | pm_genpd_init(domain, pm_domain_gov, true); | ||
1276 | |||
1277 | domain->power_off = gk20a_pm_railgate; | ||
1278 | domain->power_on = gk20a_pm_unrailgate; | ||
1279 | domain->dev_ops.start = gk20a_pm_enable_clk; | ||
1280 | domain->dev_ops.stop = gk20a_pm_disable_clk; | ||
1281 | domain->dev_ops.save_state = gk20a_pm_prepare_poweroff; | ||
1282 | domain->dev_ops.restore_state = gk20a_pm_finalize_poweron; | ||
1283 | domain->dev_ops.suspend = gk20a_pm_suspend; | ||
1284 | domain->dev_ops.resume = gk20a_pm_resume; | ||
1285 | |||
1286 | device_set_wakeup_capable(&pdev->dev, 0); | ||
1287 | ret = pm_genpd_add_device(domain, &pdev->dev); | ||
1288 | |||
1289 | if (platform->railgate_delay) | ||
1290 | pm_genpd_set_poweroff_delay(domain, platform->railgate_delay); | ||
1291 | |||
1292 | return ret; | ||
1293 | } | ||
1294 | #endif | ||
1295 | |||
1296 | static int gk20a_pm_init(struct platform_device *dev) | 1251 | static int gk20a_pm_init(struct platform_device *dev) |
1297 | { | 1252 | { |
1298 | struct gk20a_platform *platform = platform_get_drvdata(dev); | 1253 | struct gk20a_platform *platform = platform_get_drvdata(dev); |
@@ -1350,6 +1305,7 @@ static int gk20a_secure_page_alloc(struct platform_device *pdev) | |||
1350 | static struct of_device_id tegra_gpu_domain_match[] = { | 1305 | static struct of_device_id tegra_gpu_domain_match[] = { |
1351 | {.compatible = "nvidia,tegra132-gpu-pd"}, | 1306 | {.compatible = "nvidia,tegra132-gpu-pd"}, |
1352 | {.compatible = "nvidia,tegra210-gpu-pd"}, | 1307 | {.compatible = "nvidia,tegra210-gpu-pd"}, |
1308 | {.compatible = "nvidia,tegra186-gpu-pd"}, | ||
1353 | {}, | 1309 | {}, |
1354 | }; | 1310 | }; |
1355 | 1311 | ||
@@ -1358,10 +1314,7 @@ static int gk20a_probe(struct platform_device *dev) | |||
1358 | struct gk20a *gk20a; | 1314 | struct gk20a *gk20a; |
1359 | int err; | 1315 | int err; |
1360 | struct gk20a_platform *platform = NULL; | 1316 | struct gk20a_platform *platform = NULL; |
1361 | |||
1362 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1363 | struct gk20a_domain_data *gk20a_domain; | 1317 | struct gk20a_domain_data *gk20a_domain; |
1364 | #endif | ||
1365 | 1318 | ||
1366 | if (dev->dev.of_node) { | 1319 | if (dev->dev.of_node) { |
1367 | const struct of_device_id *match; | 1320 | const struct of_device_id *match; |
@@ -1393,11 +1346,9 @@ static int gk20a_probe(struct platform_device *dev) | |||
1393 | init_waitqueue_head(&gk20a->sw_irq_stall_last_handled_wq); | 1346 | init_waitqueue_head(&gk20a->sw_irq_stall_last_handled_wq); |
1394 | init_waitqueue_head(&gk20a->sw_irq_nonstall_last_handled_wq); | 1347 | init_waitqueue_head(&gk20a->sw_irq_nonstall_last_handled_wq); |
1395 | 1348 | ||
1396 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1397 | gk20a_domain = container_of(dev_to_genpd(&dev->dev), | 1349 | gk20a_domain = container_of(dev_to_genpd(&dev->dev), |
1398 | struct gk20a_domain_data, gpd); | 1350 | struct gk20a_domain_data, gpd); |
1399 | gk20a_domain->gk20a = gk20a; | 1351 | gk20a_domain->gk20a = gk20a; |
1400 | #endif | ||
1401 | 1352 | ||
1402 | set_gk20a(dev, gk20a); | 1353 | set_gk20a(dev, gk20a); |
1403 | gk20a->dev = dev; | 1354 | gk20a->dev = dev; |
@@ -1613,9 +1564,6 @@ static struct platform_driver gk20a_driver = { | |||
1613 | } | 1564 | } |
1614 | }; | 1565 | }; |
1615 | 1566 | ||
1616 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
1617 | |||
1618 | |||
1619 | static int _gk20a_init_domain(struct device_node *np, | 1567 | static int _gk20a_init_domain(struct device_node *np, |
1620 | struct generic_pm_domain *gpd) | 1568 | struct generic_pm_domain *gpd) |
1621 | { | 1569 | { |
@@ -1665,13 +1613,6 @@ static int gk20a_domain_init(struct of_device_id *matches) | |||
1665 | 1613 | ||
1666 | return ret; | 1614 | return ret; |
1667 | } | 1615 | } |
1668 | #else | ||
1669 | static int gk20a_domain_init(struct of_device_id *matches) | ||
1670 | { | ||
1671 | return 0; | ||
1672 | } | ||
1673 | #endif | ||
1674 | |||
1675 | 1616 | ||
1676 | static int __init gk20a_init(void) | 1617 | static int __init gk20a_init(void) |
1677 | { | 1618 | { |