Lines Matching refs:mfc_dev

1116 static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev)  in s5p_mfc_configure_2port_memory()  argument
1118 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_2port_memory()
1128 mfc_dev->mem_dev[BANK_L_CTX] = s5p_mfc_alloc_memdev(dev, "left", in s5p_mfc_configure_2port_memory()
1130 if (!mfc_dev->mem_dev[BANK_L_CTX]) in s5p_mfc_configure_2port_memory()
1132 mfc_dev->mem_dev[BANK_R_CTX] = s5p_mfc_alloc_memdev(dev, "right", in s5p_mfc_configure_2port_memory()
1134 if (!mfc_dev->mem_dev[BANK_R_CTX]) { in s5p_mfc_configure_2port_memory()
1135 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1140 ret = s5p_mfc_alloc_firmware(mfc_dev); in s5p_mfc_configure_2port_memory()
1142 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_configure_2port_memory()
1143 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1147 mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->fw_buf.dma; in s5p_mfc_configure_2port_memory()
1149 bank2_virt = dma_alloc_coherent(mfc_dev->mem_dev[BANK_R_CTX], in s5p_mfc_configure_2port_memory()
1153 s5p_mfc_release_firmware(mfc_dev); in s5p_mfc_configure_2port_memory()
1154 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_configure_2port_memory()
1155 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1163 mfc_dev->dma_base[BANK_R_CTX] = bank2_dma_addr - align_size; in s5p_mfc_configure_2port_memory()
1165 dma_free_coherent(mfc_dev->mem_dev[BANK_R_CTX], align_size, bank2_virt, in s5p_mfc_configure_2port_memory()
1168 vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX], in s5p_mfc_configure_2port_memory()
1170 vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX], in s5p_mfc_configure_2port_memory()
1176 static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_2port_memory() argument
1178 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_unconfigure_2port_memory()
1179 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_unconfigure_2port_memory()
1180 vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_unconfigure_2port_memory()
1181 vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_unconfigure_2port_memory()
1184 static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_configure_common_memory() argument
1186 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_common_memory()
1198 mfc_dev->mem_bitmap = kzalloc(bitmap_size, GFP_KERNEL); in s5p_mfc_configure_common_memory()
1199 if (!mfc_dev->mem_bitmap) in s5p_mfc_configure_common_memory()
1202 mfc_dev->mem_virt = dma_alloc_coherent(dev, mem_size, in s5p_mfc_configure_common_memory()
1203 &mfc_dev->mem_base, GFP_KERNEL); in s5p_mfc_configure_common_memory()
1204 if (!mfc_dev->mem_virt) { in s5p_mfc_configure_common_memory()
1205 kfree(mfc_dev->mem_bitmap); in s5p_mfc_configure_common_memory()
1210 mfc_dev->mem_size = mem_size; in s5p_mfc_configure_common_memory()
1211 mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->mem_base; in s5p_mfc_configure_common_memory()
1212 mfc_dev->dma_base[BANK_R_CTX] = mfc_dev->mem_base; in s5p_mfc_configure_common_memory()
1218 if (mfc_dev->mem_base == (dma_addr_t)0) { in s5p_mfc_configure_common_memory()
1221 bitmap_set(mfc_dev->mem_bitmap, 0, offset >> PAGE_SHIFT); in s5p_mfc_configure_common_memory()
1222 mfc_dev->dma_base[BANK_L_CTX] += offset; in s5p_mfc_configure_common_memory()
1223 mfc_dev->dma_base[BANK_R_CTX] += offset; in s5p_mfc_configure_common_memory()
1227 s5p_mfc_alloc_firmware(mfc_dev); in s5p_mfc_configure_common_memory()
1229 mfc_dev->mem_dev[BANK_L_CTX] = mfc_dev->mem_dev[BANK_R_CTX] = dev; in s5p_mfc_configure_common_memory()
1238 static void s5p_mfc_unconfigure_common_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_common_memory() argument
1240 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_unconfigure_common_memory()
1242 dma_free_coherent(dev, mfc_dev->mem_size, mfc_dev->mem_virt, in s5p_mfc_unconfigure_common_memory()
1243 mfc_dev->mem_base); in s5p_mfc_unconfigure_common_memory()
1244 kfree(mfc_dev->mem_bitmap); in s5p_mfc_unconfigure_common_memory()
1248 static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_configure_dma_memory() argument
1250 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_dma_memory()
1252 if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) in s5p_mfc_configure_dma_memory()
1253 return s5p_mfc_configure_common_memory(mfc_dev); in s5p_mfc_configure_dma_memory()
1255 return s5p_mfc_configure_2port_memory(mfc_dev); in s5p_mfc_configure_dma_memory()
1258 static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_dma_memory() argument
1260 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_unconfigure_dma_memory()
1262 s5p_mfc_release_firmware(mfc_dev); in s5p_mfc_unconfigure_dma_memory()
1263 if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) in s5p_mfc_unconfigure_dma_memory()
1264 s5p_mfc_unconfigure_common_memory(mfc_dev); in s5p_mfc_unconfigure_dma_memory()
1266 s5p_mfc_unconfigure_2port_memory(mfc_dev); in s5p_mfc_unconfigure_dma_memory()