Merge branch 'for-4.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[linux-2.6-block.git] / drivers / staging / media / atomisp / pci / atomisp2 / atomisp_common.h
1 /*
2  * Support for Medifield PNW Camera Imaging ISP subsystem.
3  *
4  * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
5  *
6  * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License version
10  * 2 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  *
18  */
19
20 #ifndef __ATOMISP_COMMON_H__
21 #define __ATOMISP_COMMON_H__
22
23 #include "../../include/linux/atomisp.h"
24
25 #include <linux/v4l2-mediabus.h>
26
27 #include <media/videobuf-core.h>
28
29 #include "atomisp_compat.h"
30
31 #include "ia_css.h"
32
33 extern int dbg_level;
34 extern int dbg_func;
35 extern int mipicsi_flag;
36 extern int pad_w;
37 extern int pad_h;
38
39 #define CSS_DTRACE_VERBOSITY_LEVEL      5       /* Controls trace verbosity */
40 #define CSS_DTRACE_VERBOSITY_TIMEOUT    9       /* Verbosity on ISP timeout */
41 #define MRFLD_MAX_ZOOM_FACTOR   1024
42 #ifdef ISP2401
43 #define ATOMISP_CSS_ISP_PIPE_VERSION_2_2    0
44 #define ATOMISP_CSS_ISP_PIPE_VERSION_2_7    1
45 #endif
46
47 #define IS_ISP2401(isp)                                                 \
48         (((isp)->media_dev.hw_revision & ATOMISP_HW_REVISION_MASK)      \
49          >= (ATOMISP_HW_REVISION_ISP2401_LEGACY << ATOMISP_HW_REVISION_SHIFT))
50
51 struct atomisp_format_bridge {
52         unsigned int pixelformat;
53         unsigned int depth;
54         u32 mbus_code;
55         enum atomisp_css_frame_format sh_fmt;
56         unsigned char description[32];  /* the same as struct v4l2_fmtdesc */
57         bool planar;
58 };
59
60 struct atomisp_fmt {
61         u32 pixelformat;
62         u32 depth;
63         u32 bytesperline;
64         u32 framesize;
65         u32 imagesize;
66         u32 width;
67         u32 height;
68         u32 bayer_order;
69 };
70
71 struct atomisp_buffer {
72         struct videobuf_buffer  vb;
73 };
74
75 #endif