/* Deinitialize hardware */
void s5p_mfc_deinit_hw(struct s5p_mfc_dev *dev)
{
	mfc_debug(2, "mfc deinit start\n");

	if (!dev) {
		mfc_err("no mfc device to run\n");
		return;
	}

	if (!IS_MFCv7X(dev)) {
		s5p_mfc_clock_on();
		s5p_mfc_reset(dev);
		s5p_mfc_clock_off();
	}

	mfc_debug(2, "mfc deinit completed\n");
}
int s5p_mfc_sys_init_cmd(struct s5p_mfc_dev *dev,
					enum mfc_buf_usage_type buf_type)
{
	struct s5p_mfc_buf_size_v6 *buf_size;
	struct s5p_mfc_extra_buf *ctx_buf, *dis_shm_buf;
	int ret;

	mfc_debug_enter();

	if (!dev) {
		mfc_err("no mfc device to run\n");
		return -EINVAL;
	}

	buf_size = dev->variant->buf_size->buf;
	ctx_buf = &dev->ctx_buf;
	dis_shm_buf = &dev->dis_shm_buf;
#ifdef CONFIG_EXYNOS_CONTENT_PATH_PROTECTION
	if (buf_type == MFCBUF_DRM) {
		ctx_buf = &dev->ctx_buf_drm;
		dis_shm_buf = &dev->dis_shm_buf_drm;
	}
#endif
	s5p_mfc_write_reg(dev, ctx_buf->ofs, S5P_FIMV_CONTEXT_MEM_ADDR);
	s5p_mfc_write_reg(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE);
	if (IS_MFCv7X(dev)) {
		s5p_mfc_write_reg(dev, dis_shm_buf->ofs,
					S5P_FIMV_DIS_SHARED_MEM_ADDR);
		mfc_debug(2, "Setting shared memory = 0x%x\n",
					(unsigned int)dis_shm_buf->ofs);
	}

	ret = s5p_mfc_cmd_host2risc(dev, S5P_FIMV_H2R_CMD_SYS_INIT, NULL);

	mfc_debug_leave();

	return ret;
}