2 * Common header of MARU Virtual Camera device.
\r
4 * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
\r
7 * JinHyung Jo <jinhyung.jo@samsung.com>
\r
8 * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
\r
10 * This program is free software; you can redistribute it and/or
\r
11 * modify it under the terms of the GNU General Public License
\r
12 * as published by the Free Software Foundation; either version 2
\r
13 * of the License, or (at your option) any later version.
\r
15 * This program is distributed in the hope that it will be useful,
\r
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
18 * GNU General Public License for more details.
\r
20 * You should have received a copy of the GNU General Public License
\r
21 * along with this program; if not, write to the Free Software
\r
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
29 #ifndef _MARU_CAMERA_COMMON_H_
\r
30 #define _MARU_CAMERA_COMMON_H_
\r
33 #include "qemu-thread.h"
\r
35 #define MARUCAM_MAX_PARAM 20
\r
36 #define MARUCAM_SKIPFRAMES 2
\r
38 /* must sync with GUEST camera_driver */
\r
39 #define MARUCAM_CMD_INIT 0x00
\r
40 #define MARUCAM_CMD_OPEN 0x04
\r
41 #define MARUCAM_CMD_CLOSE 0x08
\r
42 #define MARUCAM_CMD_ISR 0x0C
\r
43 #define MARUCAM_CMD_START_PREVIEW 0x10
\r
44 #define MARUCAM_CMD_STOP_PREVIEW 0x14
\r
45 #define MARUCAM_CMD_S_PARAM 0x18
\r
46 #define MARUCAM_CMD_G_PARAM 0x1C
\r
47 #define MARUCAM_CMD_ENUM_FMT 0x20
\r
48 #define MARUCAM_CMD_TRY_FMT 0x24
\r
49 #define MARUCAM_CMD_S_FMT 0x28
\r
50 #define MARUCAM_CMD_G_FMT 0x2C
\r
51 #define MARUCAM_CMD_QCTRL 0x30
\r
52 #define MARUCAM_CMD_S_CTRL 0x34
\r
53 #define MARUCAM_CMD_G_CTRL 0x38
\r
54 #define MARUCAM_CMD_ENUM_FSIZES 0x3C
\r
55 #define MARUCAM_CMD_ENUM_FINTV 0x40
\r
56 #define MARUCAM_CMD_S_DATA 0x44
\r
57 #define MARUCAM_CMD_G_DATA 0x48
\r
58 #define MARUCAM_CMD_DATACLR 0x50
\r
59 #define MARUCAM_CMD_REQFRAME 0x54
\r
61 typedef struct MaruCamState MaruCamState;
\r
62 typedef struct MaruCamParam MaruCamParam;
\r
64 struct MaruCamParam {
\r
68 uint32_t stack[MARUCAM_MAX_PARAM];
\r
71 struct MaruCamState {
\r
73 MaruCamParam *param;
\r
74 QemuThread thread_id;
\r
75 QemuMutex thread_mutex;;
\r
76 QemuCond thread_cond;
\r
80 void *vaddr; /* vram ptr */
\r
90 /* ------------------------------------------------------------------------- */
\r
91 /* Fucntion prototype */
\r
92 /* ------------------------------------------------------------------------- */
\r
93 int marucam_device_check(int log_flag);
\r
94 void marucam_device_init(MaruCamState *state);
\r
95 void marucam_device_exit(MaruCamState *state);
\r
96 void marucam_device_open(MaruCamState *state);
\r
97 void marucam_device_close(MaruCamState *state);
\r
98 void marucam_device_start_preview(MaruCamState *state);
\r
99 void marucam_device_stop_preview(MaruCamState *state);
\r
100 void marucam_device_s_param(MaruCamState *state);
\r
101 void marucam_device_g_param(MaruCamState *state);
\r
102 void marucam_device_s_fmt(MaruCamState *state);
\r
103 void marucam_device_g_fmt(MaruCamState *state);
\r
104 void marucam_device_try_fmt(MaruCamState *state);
\r
105 void marucam_device_enum_fmt(MaruCamState *state);
\r
106 void marucam_device_qctrl(MaruCamState *state);
\r
107 void marucam_device_s_ctrl(MaruCamState *state);
\r
108 void marucam_device_g_ctrl(MaruCamState *state);
\r
109 void marucam_device_enum_fsizes(MaruCamState *state);
\r
110 void marucam_device_enum_fintv(MaruCamState *state);
\r
112 int maru_camera_pci_init(PCIBus *bus);
\r
114 #endif /* _MARU_CAMERA_COMMON_H_ */
\r