Lines Matching refs:mfc_dev

1112 static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev)  in s5p_mfc_configure_2port_memory()  argument
1114 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_2port_memory()
1124 mfc_dev->mem_dev[BANK_L_CTX] = s5p_mfc_alloc_memdev(dev, "left", in s5p_mfc_configure_2port_memory()
1126 if (!mfc_dev->mem_dev[BANK_L_CTX]) in s5p_mfc_configure_2port_memory()
1128 mfc_dev->mem_dev[BANK_R_CTX] = s5p_mfc_alloc_memdev(dev, "right", in s5p_mfc_configure_2port_memory()
1130 if (!mfc_dev->mem_dev[BANK_R_CTX]) { in s5p_mfc_configure_2port_memory()
1131 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1136 ret = s5p_mfc_alloc_firmware(mfc_dev); in s5p_mfc_configure_2port_memory()
1138 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_configure_2port_memory()
1139 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1143 mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->fw_buf.dma; in s5p_mfc_configure_2port_memory()
1145 bank2_virt = dma_alloc_coherent(mfc_dev->mem_dev[BANK_R_CTX], in s5p_mfc_configure_2port_memory()
1149 s5p_mfc_release_firmware(mfc_dev); in s5p_mfc_configure_2port_memory()
1150 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_configure_2port_memory()
1151 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_configure_2port_memory()
1159 mfc_dev->dma_base[BANK_R_CTX] = bank2_dma_addr - align_size; in s5p_mfc_configure_2port_memory()
1161 dma_free_coherent(mfc_dev->mem_dev[BANK_R_CTX], align_size, bank2_virt, in s5p_mfc_configure_2port_memory()
1164 vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX], in s5p_mfc_configure_2port_memory()
1166 vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX], in s5p_mfc_configure_2port_memory()
1172 static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_2port_memory() argument
1174 device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_unconfigure_2port_memory()
1175 device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_unconfigure_2port_memory()
1176 vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX]); in s5p_mfc_unconfigure_2port_memory()
1177 vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX]); in s5p_mfc_unconfigure_2port_memory()
1180 static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_configure_common_memory() argument
1182 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_common_memory()
1194 mfc_dev->mem_bitmap = kzalloc(bitmap_size, GFP_KERNEL); in s5p_mfc_configure_common_memory()
1195 if (!mfc_dev->mem_bitmap) in s5p_mfc_configure_common_memory()
1198 mfc_dev->mem_virt = dma_alloc_coherent(dev, mem_size, in s5p_mfc_configure_common_memory()
1199 &mfc_dev->mem_base, GFP_KERNEL); in s5p_mfc_configure_common_memory()
1200 if (!mfc_dev->mem_virt) { in s5p_mfc_configure_common_memory()
1201 kfree(mfc_dev->mem_bitmap); in s5p_mfc_configure_common_memory()
1206 mfc_dev->mem_size = mem_size; in s5p_mfc_configure_common_memory()
1207 mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->mem_base; in s5p_mfc_configure_common_memory()
1208 mfc_dev->dma_base[BANK_R_CTX] = mfc_dev->mem_base; in s5p_mfc_configure_common_memory()
1214 if (mfc_dev->mem_base == (dma_addr_t)0) { in s5p_mfc_configure_common_memory()
1217 bitmap_set(mfc_dev->mem_bitmap, 0, offset >> PAGE_SHIFT); in s5p_mfc_configure_common_memory()
1218 mfc_dev->dma_base[BANK_L_CTX] += offset; in s5p_mfc_configure_common_memory()
1219 mfc_dev->dma_base[BANK_R_CTX] += offset; in s5p_mfc_configure_common_memory()
1223 s5p_mfc_alloc_firmware(mfc_dev); in s5p_mfc_configure_common_memory()
1225 mfc_dev->mem_dev[BANK_L_CTX] = mfc_dev->mem_dev[BANK_R_CTX] = dev; in s5p_mfc_configure_common_memory()
1234 static void s5p_mfc_unconfigure_common_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_common_memory() argument
1236 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_unconfigure_common_memory()
1238 dma_free_coherent(dev, mfc_dev->mem_size, mfc_dev->mem_virt, in s5p_mfc_unconfigure_common_memory()
1239 mfc_dev->mem_base); in s5p_mfc_unconfigure_common_memory()
1240 kfree(mfc_dev->mem_bitmap); in s5p_mfc_unconfigure_common_memory()
1244 static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_configure_dma_memory() argument
1246 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_configure_dma_memory()
1248 if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) in s5p_mfc_configure_dma_memory()
1249 return s5p_mfc_configure_common_memory(mfc_dev); in s5p_mfc_configure_dma_memory()
1251 return s5p_mfc_configure_2port_memory(mfc_dev); in s5p_mfc_configure_dma_memory()
1254 static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) in s5p_mfc_unconfigure_dma_memory() argument
1256 struct device *dev = &mfc_dev->plat_dev->dev; in s5p_mfc_unconfigure_dma_memory()
1258 s5p_mfc_release_firmware(mfc_dev); in s5p_mfc_unconfigure_dma_memory()
1259 if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) in s5p_mfc_unconfigure_dma_memory()
1260 s5p_mfc_unconfigure_common_memory(mfc_dev); in s5p_mfc_unconfigure_dma_memory()
1262 s5p_mfc_unconfigure_2port_memory(mfc_dev); in s5p_mfc_unconfigure_dma_memory()