Lines Matching refs:ldev

242 static void lima_fini_ip(struct lima_device *ldev, int index)
245 struct lima_ip *ip = ldev->ip + index;
251 static int lima_resume_ip(struct lima_device *ldev, int index)
254 struct lima_ip *ip = ldev->ip + index;
263 static void lima_suspend_ip(struct lima_device *ldev, int index)
266 struct lima_ip *ip = ldev->ip + index;
277 pipe->ldev = dev;
309 pipe->ldev = dev;
355 int lima_device_init(struct lima_device *ldev)
357 struct platform_device *pdev = to_platform_device(ldev->dev);
360 dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
361 dma_set_max_seg_size(ldev->dev, UINT_MAX);
363 err = lima_clk_init(ldev);
367 err = lima_regulator_init(ldev);
371 ldev->empty_vm = lima_vm_create(ldev);
372 if (!ldev->empty_vm) {
377 ldev->va_start = 0;
378 if (ldev->id == lima_gpu_mali450) {
379 ldev->va_end = LIMA_VA_RESERVE_START;
380 ldev->dlbu_cpu = dma_alloc_wc(
381 ldev->dev, LIMA_PAGE_SIZE,
382 &ldev->dlbu_dma, GFP_KERNEL | __GFP_NOWARN);
383 if (!ldev->dlbu_cpu) {
388 ldev->va_end = LIMA_VA_RESERVE_END;
390 ldev->iomem = devm_platform_ioremap_resource(pdev, 0);
391 if (IS_ERR(ldev->iomem)) {
392 dev_err(ldev->dev, "fail to ioremap iomem\n");
393 err = PTR_ERR(ldev->iomem);
398 err = lima_init_ip(ldev, i);
403 err = lima_init_gp_pipe(ldev);
407 err = lima_init_pp_pipe(ldev);
411 ldev->dump.magic = LIMA_DUMP_MAGIC;
412 ldev->dump.version_major = LIMA_DUMP_MAJOR;
413 ldev->dump.version_minor = LIMA_DUMP_MINOR;
414 INIT_LIST_HEAD(&ldev->error_task_list);
415 mutex_init(&ldev->error_task_list_lock);
417 dev_info(ldev->dev, "bus rate = %lu\n", clk_get_rate(ldev->clk_bus));
418 dev_info(ldev->dev, "mod rate = %lu", clk_get_rate(ldev->clk_gpu));
423 lima_fini_gp_pipe(ldev);
426 lima_fini_ip(ldev, i);
428 if (ldev->dlbu_cpu)
429 dma_free_wc(ldev->dev, LIMA_PAGE_SIZE,
430 ldev->dlbu_cpu, ldev->dlbu_dma);
432 lima_vm_put(ldev->empty_vm);
434 lima_regulator_fini(ldev);
436 lima_clk_fini(ldev);
440 void lima_device_fini(struct lima_device *ldev)
445 list_for_each_entry_safe(et, tmp, &ldev->error_task_list, list) {
449 mutex_destroy(&ldev->error_task_list_lock);
451 lima_fini_pp_pipe(ldev);
452 lima_fini_gp_pipe(ldev);
455 lima_fini_ip(ldev, i);
457 if (ldev->dlbu_cpu)
458 dma_free_wc(ldev->dev, LIMA_PAGE_SIZE,
459 ldev->dlbu_cpu, ldev->dlbu_dma);
461 lima_vm_put(ldev->empty_vm);
463 lima_regulator_fini(ldev);
465 lima_clk_fini(ldev);
470 struct lima_device *ldev = dev_get_drvdata(dev);
473 err = lima_clk_enable(ldev);
479 err = lima_regulator_enable(ldev);
486 err = lima_resume_ip(ldev, i);
493 err = lima_devfreq_resume(&ldev->devfreq);
503 lima_suspend_ip(ldev, i);
504 lima_regulator_disable(ldev);
506 lima_clk_disable(ldev);
512 struct lima_device *ldev = dev_get_drvdata(dev);
517 if (atomic_read(&ldev->pipe[i].base.credit_count))
521 err = lima_devfreq_suspend(&ldev->devfreq);
528 lima_suspend_ip(ldev, i);
530 lima_regulator_disable(ldev);
532 lima_clk_disable(ldev);