Lines Matching refs:mfc_dev

1135 static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev)  in s5p_mfc_configure_2port_memory()  argument
1137 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_2port_memory()
1147 mfc_dev->mem_dev[BANK_L_CTX] = s5p_mfc_alloc_memdev(dev, "left", in s5p_mfc_configure_2port_memory()
1149 if (!mfc_dev->mem_dev[BANK_L_CTX]) in s5p_mfc_configure_2port_memory()
1151 mfc_dev->mem_dev[BANK_R_CTX] = s5p_mfc_alloc_memdev(dev, "right", in s5p_mfc_configure_2port_memory()
1153 if (!mfc_dev->mem_dev[BANK_R_CTX]) { in s5p_mfc_configure_2port_memory()
1154 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1159 ret = s5p_mfc_alloc_firmware(mfc_dev); in s5p_mfc_configure_2port_memory()
1161 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_configure_2port_memory()
1162 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1166 mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->fw_buf.dma; in s5p_mfc_configure_2port_memory()
1168 bank2_virt = dma_alloc_coherent(mfc_dev->mem_dev[BANK_R_CTX], in s5p_mfc_configure_2port_memory()
1171 s5p_mfc_release_firmware(mfc_dev); in s5p_mfc_configure_2port_memory()
1172 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_configure_2port_memory()
1173 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1181 mfc_dev->dma_base[BANK_R_CTX] = bank2_dma_addr - align_size; in s5p_mfc_configure_2port_memory()
1183 dma_free_coherent(mfc_dev->mem_dev[BANK_R_CTX], align_size, bank2_virt, in s5p_mfc_configure_2port_memory()
1186 vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX], in s5p_mfc_configure_2port_memory()
1188 vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX], in s5p_mfc_configure_2port_memory()
1194 static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_2port_memory() argument
1196 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_unconfigure_2port_memory()
1197 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_unconfigure_2port_memory()
1198 vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_unconfigure_2port_memory()
1199 vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_unconfigure_2port_memory()
1202 static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_configure_common_memory() argument
1204 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_common_memory()
1213 mfc_dev->mem_bitmap = bitmap_zalloc(mem_size >> PAGE_SHIFT, GFP_KERNEL); in s5p_mfc_configure_common_memory()
1214 if (!mfc_dev->mem_bitmap) in s5p_mfc_configure_common_memory()
1217 mfc_dev->mem_virt = dma_alloc_coherent(dev, mem_size, in s5p_mfc_configure_common_memory()
1218 &mfc_dev->mem_base, GFP_KERNEL); in s5p_mfc_configure_common_memory()
1219 if (!mfc_dev->mem_virt) { in s5p_mfc_configure_common_memory()
1220 bitmap_free(mfc_dev->mem_bitmap); in s5p_mfc_configure_common_memory()
1225 mfc_dev->mem_size = mem_size; in s5p_mfc_configure_common_memory()
1226 mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->mem_base; in s5p_mfc_configure_common_memory()
1227 mfc_dev->dma_base[BANK_R_CTX] = mfc_dev->mem_base; in s5p_mfc_configure_common_memory()
1233 if (mfc_dev->mem_base == (dma_addr_t)0) { in s5p_mfc_configure_common_memory()
1236 bitmap_set(mfc_dev->mem_bitmap, 0, offset >> PAGE_SHIFT); in s5p_mfc_configure_common_memory()
1237 mfc_dev->dma_base[BANK_L_CTX] += offset; in s5p_mfc_configure_common_memory()
1238 mfc_dev->dma_base[BANK_R_CTX] += offset; in s5p_mfc_configure_common_memory()
1242 s5p_mfc_alloc_firmware(mfc_dev); in s5p_mfc_configure_common_memory()
1244 mfc_dev->mem_dev[BANK_L_CTX] = mfc_dev->mem_dev[BANK_R_CTX] = dev; in s5p_mfc_configure_common_memory()
1253 static void s5p_mfc_unconfigure_common_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_common_memory() argument
1255 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_unconfigure_common_memory()
1257 dma_free_coherent(dev, mfc_dev->mem_size, mfc_dev->mem_virt, in s5p_mfc_unconfigure_common_memory()
1258 mfc_dev->mem_base); in s5p_mfc_unconfigure_common_memory()
1259 bitmap_free(mfc_dev->mem_bitmap); in s5p_mfc_unconfigure_common_memory()
1263 static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_configure_dma_memory() argument
1265 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_dma_memory()
1267 if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) in s5p_mfc_configure_dma_memory()
1268 return s5p_mfc_configure_common_memory(mfc_dev); in s5p_mfc_configure_dma_memory()
1270 return s5p_mfc_configure_2port_memory(mfc_dev); in s5p_mfc_configure_dma_memory()
1273 static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_dma_memory() argument
1275 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_unconfigure_dma_memory()
1277 s5p_mfc_release_firmware(mfc_dev); in s5p_mfc_unconfigure_dma_memory()
1278 if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) in s5p_mfc_unconfigure_dma_memory()
1279 s5p_mfc_unconfigure_common_memory(mfc_dev); in s5p_mfc_unconfigure_dma_memory()
1281 s5p_mfc_unconfigure_2port_memory(mfc_dev); in s5p_mfc_unconfigure_dma_memory()