Lines Matching defs:ldev
241 static void lima_fini_ip(struct lima_device *ldev, int index)
244 struct lima_ip *ip = ldev->ip + index;
250 static int lima_resume_ip(struct lima_device *ldev, int index)
253 struct lima_ip *ip = ldev->ip + index;
262 static void lima_suspend_ip(struct lima_device *ldev, int index)
265 struct lima_ip *ip = ldev->ip + index;
276 pipe->ldev = dev;
308 pipe->ldev = dev;
354 int lima_device_init(struct lima_device *ldev)
356 struct platform_device *pdev = to_platform_device(ldev->dev);
359 dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
360 dma_set_max_seg_size(ldev->dev, UINT_MAX);
362 err = lima_clk_init(ldev);
366 err = lima_regulator_init(ldev);
370 ldev->empty_vm = lima_vm_create(ldev);
371 if (!ldev->empty_vm) {
376 ldev->va_start = 0;
377 if (ldev->id == lima_gpu_mali450) {
378 ldev->va_end = LIMA_VA_RESERVE_START;
379 ldev->dlbu_cpu = dma_alloc_wc(
380 ldev->dev, LIMA_PAGE_SIZE,
381 &ldev->dlbu_dma, GFP_KERNEL | __GFP_NOWARN);
382 if (!ldev->dlbu_cpu) {
387 ldev->va_end = LIMA_VA_RESERVE_END;
389 ldev->iomem = devm_platform_ioremap_resource(pdev, 0);
390 if (IS_ERR(ldev->iomem)) {
391 dev_err(ldev->dev, "fail to ioremap iomem\n");
392 err = PTR_ERR(ldev->iomem);
397 err = lima_init_ip(ldev, i);
402 err = lima_init_gp_pipe(ldev);
406 err = lima_init_pp_pipe(ldev);
410 ldev->dump.magic = LIMA_DUMP_MAGIC;
411 ldev->dump.version_major = LIMA_DUMP_MAJOR;
412 ldev->dump.version_minor = LIMA_DUMP_MINOR;
413 INIT_LIST_HEAD(&ldev->error_task_list);
414 mutex_init(&ldev->error_task_list_lock);
416 dev_info(ldev->dev, "bus rate = %lu\n", clk_get_rate(ldev->clk_bus));
417 dev_info(ldev->dev, "mod rate = %lu", clk_get_rate(ldev->clk_gpu));
422 lima_fini_gp_pipe(ldev);
425 lima_fini_ip(ldev, i);
427 if (ldev->dlbu_cpu)
428 dma_free_wc(ldev->dev, LIMA_PAGE_SIZE,
429 ldev->dlbu_cpu, ldev->dlbu_dma);
431 lima_vm_put(ldev->empty_vm);
433 lima_regulator_fini(ldev);
435 lima_clk_fini(ldev);
439 void lima_device_fini(struct lima_device *ldev)
444 list_for_each_entry_safe(et, tmp, &ldev->error_task_list, list) {
448 mutex_destroy(&ldev->error_task_list_lock);
450 lima_fini_pp_pipe(ldev);
451 lima_fini_gp_pipe(ldev);
454 lima_fini_ip(ldev, i);
456 if (ldev->dlbu_cpu)
457 dma_free_wc(ldev->dev, LIMA_PAGE_SIZE,
458 ldev->dlbu_cpu, ldev->dlbu_dma);
460 lima_vm_put(ldev->empty_vm);
462 lima_regulator_fini(ldev);
464 lima_clk_fini(ldev);
469 struct lima_device *ldev = dev_get_drvdata(dev);
472 err = lima_clk_enable(ldev);
478 err = lima_regulator_enable(ldev);
485 err = lima_resume_ip(ldev, i);
492 err = lima_devfreq_resume(&ldev->devfreq);
502 lima_suspend_ip(ldev, i);
503 lima_regulator_disable(ldev);
505 lima_clk_disable(ldev);
511 struct lima_device *ldev = dev_get_drvdata(dev);
516 if (atomic_read(&ldev->pipe[i].base.hw_rq_count))
520 err = lima_devfreq_suspend(&ldev->devfreq);
527 lima_suspend_ip(ldev, i);
529 lima_regulator_disable(ldev);
531 lima_clk_disable(ldev);