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