upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / samsung / mfc5x / mfc_cmd.h
1 /*
2  * linux/drivers/media/video/samsung/mfc5x/mfc_cmd.h
3  *
4  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5  *              http://www.samsung.com/
6  *
7  * Command interface for Samsung MFC (Multi Function Codec - FIMV) driver
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #ifndef __MFC_CMD_H
15 #define __MFC_CMD_H __FILE__
16
17 #include <linux/interrupt.h>
18
19 #include "mfc_dev.h"
20
21 #define MAX_H2R_ARG             4
22 #define H2R_CMD_TIMEOUT         100     /* ms */
23 #define H2R_INT_TIMEOUT         5000    /* ms */
24 #define CODEC_INT_TIMEOUT       1000    /* ms */
25
26 enum mfc_h2r_cmd {
27         H2R_NOP         = 0,
28         OPEN_CH         = 1,
29         CLOSE_CH        = 2,
30         SYS_INIT        = 3,
31         FLUSH           = 4,
32         SLEEP           = 5,
33         WAKEUP          = 6,
34         CONTINUE_ENC    = 7,
35         ABORT_ENC       = 8,
36 };
37
38 enum mfc_codec_cmd {
39         SEQ_HEADER              = 1,
40         FRAME_START             = 2,
41         LAST_SEQ                = 3,
42         INIT_BUFFERS            = 4,
43         FRAME_START_REALLOC     = 5,
44         FRAME_BATCH_START       = 6,
45 };
46
47 enum mfc_r2h_ret {
48         R2H_NOP                 = 0,
49         OPEN_CH_RET             = 1,
50         CLOSE_CH_RET            = 2,
51
52         SEQ_DONE_RET            = 4,
53         FRAME_DONE_RET          = 5,
54         SLICE_DONE_RET          = 6,
55         ENC_COMPLETE_RET        = 7,
56         SYS_INIT_RET            = 8,
57         FW_STATUS_RET           = 9,
58         SLEEP_RET               = 10,
59         WAKEUP_RET              = 11,
60         FLUSH_CMD_RET           = 12,
61         ABORT_RET               = 13,
62         BATCH_ENC_RET           = 14,
63         INIT_BUFFERS_RET        = 15,
64         EDFU_INIT_RET           = 16,
65
66         ERR_RET                 = 32,
67 };
68
69 struct mfc_cmd_args {
70         unsigned int    arg[MAX_H2R_ARG];
71 };
72
73 irqreturn_t mfc_irq(int irq, void *dev_id);
74
75 int mfc_cmd_fw_start(struct mfc_dev *dev);
76 int mfc_cmd_sys_init(struct mfc_dev *dev);
77 int mfc_cmd_sys_sleep(struct mfc_dev *dev);
78 int mfc_cmd_sys_wakeup(struct mfc_dev *dev);
79
80 int mfc_cmd_inst_open(struct mfc_inst_ctx *ctx);
81 int mfc_cmd_inst_close(struct mfc_inst_ctx *ctx);
82 int mfc_cmd_seq_start(struct mfc_inst_ctx *ctx);
83 int mfc_cmd_init_buffers(struct mfc_inst_ctx *ctx);
84 int mfc_cmd_frame_start(struct mfc_inst_ctx *ctx);
85
86 #endif /* __MFC_CMD_H */