• Home
  • Raw
  • Download

Lines Matching refs:region

688 	struct knav_region *region;  in kdesc_fill_pool()  local
691 region = pool->region; in kdesc_fill_pool()
692 pool->desc_size = region->desc_size; in kdesc_fill_pool()
697 dma_addr = region->dma_start + (region->desc_size * index); in kdesc_fill_pool()
736 return pool->region->dma_start + (virt - pool->region->virt_start); in knav_pool_desc_virt_to_dma()
743 return pool->region->virt_start + (dma - pool->region->dma_start); in knav_pool_desc_dma_to_virt()
760 struct knav_region *reg_itr, *region = NULL; in knav_pool_create() local
782 region = reg_itr; in knav_pool_create()
786 if (!region) { in knav_pool_create()
807 if (num_desc > (region->num_desc - region->used_desc)) { in knav_pool_create()
820 node = &region->pools; in knav_pool_create()
821 list_for_each_entry(pi, &region->pools, region_inst) { in knav_pool_create()
831 pool->region = region; in knav_pool_create()
834 region->used_desc += num_desc; in knav_pool_create()
868 if (!pool->region) in knav_pool_destroy()
874 pool->region->used_desc -= pool->num_desc; in knav_pool_destroy()
915 knav_queue_push(pool->queue, dma, pool->region->desc_size, 0); in knav_pool_desc_put()
934 size = min(size, pool->region->desc_size); in knav_pool_desc_map()
961 desc_sz = min(dma_sz, pool->region->desc_size); in knav_pool_desc_unmap()
982 struct knav_region *region) in knav_queue_setup_region() argument
988 int id = region->id; in knav_queue_setup_region()
992 if (!region->num_desc) { in knav_queue_setup_region()
993 dev_warn(kdev->dev, "unused region %s\n", region->name); in knav_queue_setup_region()
998 hw_num_desc = ilog2(region->num_desc - 1) + 1; in knav_queue_setup_region()
1001 if (region->num_desc < 32) { in knav_queue_setup_region()
1002 region->num_desc = 0; in knav_queue_setup_region()
1004 region->name); in knav_queue_setup_region()
1008 size = region->num_desc * region->desc_size; in knav_queue_setup_region()
1009 region->virt_start = alloc_pages_exact(size, GFP_KERNEL | GFP_DMA | in knav_queue_setup_region()
1011 if (!region->virt_start) { in knav_queue_setup_region()
1012 region->num_desc = 0; in knav_queue_setup_region()
1014 region->name); in knav_queue_setup_region()
1017 region->virt_end = region->virt_start + size; in knav_queue_setup_region()
1018 page = virt_to_page(region->virt_start); in knav_queue_setup_region()
1020 region->dma_start = dma_map_page(kdev->dev, page, 0, size, in knav_queue_setup_region()
1022 if (dma_mapping_error(kdev->dev, region->dma_start)) { in knav_queue_setup_region()
1024 region->name); in knav_queue_setup_region()
1027 region->dma_end = region->dma_start + size; in knav_queue_setup_region()
1035 pool->region_offset = region->num_desc; in knav_queue_setup_region()
1036 list_add(&pool->region_inst, &region->pools); in knav_queue_setup_region()
1040 region->name, id, region->desc_size, region->num_desc, in knav_queue_setup_region()
1041 region->link_index, &region->dma_start, &region->dma_end, in knav_queue_setup_region()
1042 region->virt_start, region->virt_end); in knav_queue_setup_region()
1044 hw_desc_size = (region->desc_size / 16) - 1; in knav_queue_setup_region()
1049 writel_relaxed((u32)region->dma_start, &regs->base); in knav_queue_setup_region()
1050 writel_relaxed(region->link_index, &regs->start_index); in knav_queue_setup_region()
1057 if (region->dma_start) in knav_queue_setup_region()
1058 dma_unmap_page(kdev->dev, region->dma_start, size, in knav_queue_setup_region()
1060 if (region->virt_start) in knav_queue_setup_region()
1061 free_pages_exact(region->virt_start, size); in knav_queue_setup_region()
1062 region->num_desc = 0; in knav_queue_setup_region()
1081 struct knav_region *region; in knav_queue_setup_regions() local
1087 region = devm_kzalloc(dev, sizeof(*region), GFP_KERNEL); in knav_queue_setup_regions()
1088 if (!region) { in knav_queue_setup_regions()
1093 region->name = knav_queue_find_name(child); in knav_queue_setup_regions()
1094 of_property_read_u32(child, "id", &region->id); in knav_queue_setup_regions()
1097 region->num_desc = temp[0]; in knav_queue_setup_regions()
1098 region->desc_size = temp[1]; in knav_queue_setup_regions()
1100 dev_err(dev, "invalid region info %s\n", region->name); in knav_queue_setup_regions()
1101 devm_kfree(dev, region); in knav_queue_setup_regions()
1106 dev_err(dev, "No link info for %s\n", region->name); in knav_queue_setup_regions()
1107 devm_kfree(dev, region); in knav_queue_setup_regions()
1111 &region->link_index); in knav_queue_setup_regions()
1114 region->name); in knav_queue_setup_regions()
1115 devm_kfree(dev, region); in knav_queue_setup_regions()
1119 INIT_LIST_HEAD(&region->pools); in knav_queue_setup_regions()
1120 list_add_tail(&region->list, &kdev->regions); in knav_queue_setup_regions()
1128 for_each_region(kdev, region) in knav_queue_setup_regions()
1129 knav_queue_setup_region(kdev, region); in knav_queue_setup_regions()
1350 struct knav_region *region; in knav_queue_free_regions() local
1355 region = first_region(kdev); in knav_queue_free_regions()
1356 if (!region) in knav_queue_free_regions()
1358 list_for_each_entry_safe(pool, tmp, &region->pools, region_inst) in knav_queue_free_regions()
1361 size = region->virt_end - region->virt_start; in knav_queue_free_regions()
1363 free_pages_exact(region->virt_start, size); in knav_queue_free_regions()
1364 list_del(&region->list); in knav_queue_free_regions()
1365 devm_kfree(kdev->dev, region); in knav_queue_free_regions()