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