2 * linux/drivers/media/video/s5p-mfc/s5p_mfc_inst.c
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
13 #include "s5p_mfc_common.h"
14 #include "s5p_mfc_cmd.h"
15 #include "s5p_mfc_debug.h"
16 #include "s5p_mfc_intr.h"
18 int s5p_mfc_open_inst(struct s5p_mfc_ctx *ctx)
20 struct s5p_mfc_dev *dev = ctx->dev;
23 /* Preparing decoding - getting instance number */
24 mfc_debug(2, "Getting instance number\n");
25 dev->curr_ctx = ctx->num;
26 s5p_mfc_clean_ctx_int_flags(ctx);
27 ret = s5p_mfc_open_inst_cmd(ctx);
29 mfc_err("Failed to create a new instance.\n");
30 ctx->state = MFCINST_ERROR;
35 int s5p_mfc_close_inst(struct s5p_mfc_ctx *ctx)
37 struct s5p_mfc_dev *dev = ctx->dev;
40 /* Closing decoding instance */
41 mfc_debug(2, "Returning instance number\n");
42 dev->curr_ctx = ctx->num;
43 s5p_mfc_clean_ctx_int_flags(ctx);
44 ret = s5p_mfc_close_inst_cmd(ctx);
46 mfc_err("Failed to return an instance.\n");
47 ctx->state = MFCINST_ERROR;