Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
smiapp-reg.h
Go to the documentation of this file.
1 /*
2  * drivers/media/i2c/smiapp/smiapp-reg.h
3  *
4  * Generic driver for SMIA/SMIA++ compliant camera modules
5  *
6  * Copyright (C) 2011--2012 Nokia Corporation
7  * Contact: Sakari Ailus <[email protected]>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * version 2 as published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef __SMIAPP_REG_H_
26 #define __SMIAPP_REG_H_
27 
28 #include "smiapp-reg-defs.h"
29 
30 /* Bits for above register */
31 #define SMIAPP_IMAGE_ORIENTATION_HFLIP (1 << 0)
32 #define SMIAPP_IMAGE_ORIENTATION_VFLIP (1 << 1)
33 
34 #define SMIAPP_DATA_TRANSFER_IF_1_CTRL_EN (1 << 0)
35 #define SMIAPP_DATA_TRANSFER_IF_1_CTRL_RD_EN (0 << 1)
36 #define SMIAPP_DATA_TRANSFER_IF_1_CTRL_WR_EN (1 << 1)
37 #define SMIAPP_DATA_TRANSFER_IF_1_CTRL_ERR_CLEAR (1 << 2)
38 #define SMIAPP_DATA_TRANSFER_IF_1_STATUS_RD_READY (1 << 0)
39 #define SMIAPP_DATA_TRANSFER_IF_1_STATUS_WR_READY (1 << 1)
40 #define SMIAPP_DATA_TRANSFER_IF_1_STATUS_EDATA (1 << 2)
41 #define SMIAPP_DATA_TRANSFER_IF_1_STATUS_EUSAGE (1 << 3)
42 
43 #define SMIAPP_SOFTWARE_RESET (1 << 0)
44 
45 #define SMIAPP_FLASH_MODE_CAPABILITY_SINGLE_STROBE (1 << 0)
46 #define SMIAPP_FLASH_MODE_CAPABILITY_MULTIPLE_STROBE (1 << 1)
47 
48 #define SMIAPP_DPHY_CTRL_AUTOMATIC 0
49 /* DPHY control based on REQUESTED_LINK_BIT_RATE_MBPS */
50 #define SMIAPP_DPHY_CTRL_UI 1
51 #define SMIAPP_DPHY_CTRL_REGISTER 2
52 
53 #define SMIAPP_COMPRESSION_MODE_SIMPLE_PREDICTOR 1
54 #define SMIAPP_COMPRESSION_MODE_ADVANCED_PREDICTOR 2
55 
56 #define SMIAPP_MODE_SELECT_SOFTWARE_STANDBY 0
57 #define SMIAPP_MODE_SELECT_STREAMING 1
58 
59 #define SMIAPP_SCALING_MODE_NONE 0
60 #define SMIAPP_SCALING_MODE_HORIZONTAL 1
61 #define SMIAPP_SCALING_MODE_BOTH 2
62 
63 #define SMIAPP_SCALING_CAPABILITY_NONE 0
64 #define SMIAPP_SCALING_CAPABILITY_HORIZONTAL 1
65 #define SMIAPP_SCALING_CAPABILITY_BOTH 2 /* horizontal/both */
66 
67 /* digital crop right before scaler */
68 #define SMIAPP_DIGITAL_CROP_CAPABILITY_NONE 0
69 #define SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP 1
70 
71 #define SMIAPP_BINNING_CAPABILITY_NO 0
72 #define SMIAPP_BINNING_CAPABILITY_YES 1
73 
74 /* Maximum number of binning subtypes */
75 #define SMIAPP_BINNING_SUBTYPES 253
76 
77 #define SMIAPP_PIXEL_ORDER_GRBG 0
78 #define SMIAPP_PIXEL_ORDER_RGGB 1
79 #define SMIAPP_PIXEL_ORDER_BGGR 2
80 #define SMIAPP_PIXEL_ORDER_GBRG 3
81 
82 #define SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL 1
83 #define SMIAPP_DATA_FORMAT_MODEL_TYPE_EXTENDED 2
84 #define SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL_N 8
85 #define SMIAPP_DATA_FORMAT_MODEL_TYPE_EXTENDED_N 16
86 
87 #define SMIAPP_FRAME_FORMAT_MODEL_TYPE_2BYTE 0x01
88 #define SMIAPP_FRAME_FORMAT_MODEL_TYPE_4BYTE 0x02
89 #define SMIAPP_FRAME_FORMAT_MODEL_SUBTYPE_NROWS_MASK 0x0f
90 #define SMIAPP_FRAME_FORMAT_MODEL_SUBTYPE_NCOLS_MASK 0xf0
91 #define SMIAPP_FRAME_FORMAT_MODEL_SUBTYPE_NCOLS_SHIFT 4
92 
93 #define SMIAPP_FRAME_FORMAT_DESC_2_PIXELCODE_MASK 0xf000
94 #define SMIAPP_FRAME_FORMAT_DESC_2_PIXELCODE_SHIFT 12
95 #define SMIAPP_FRAME_FORMAT_DESC_2_PIXELS_MASK 0x0fff
96 
97 #define SMIAPP_FRAME_FORMAT_DESC_4_PIXELCODE_MASK 0xf0000000
98 #define SMIAPP_FRAME_FORMAT_DESC_4_PIXELCODE_SHIFT 28
99 #define SMIAPP_FRAME_FORMAT_DESC_4_PIXELS_MASK 0x0000ffff
100 
101 #define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_EMBEDDED 1
102 #define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_DUMMY 2
103 #define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_BLACK 3
104 #define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_DARK 4
105 #define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_VISIBLE 5
106 
107 #define SMIAPP_FAST_STANDBY_CTRL_COMPLETE_FRAMES 0
108 #define SMIAPP_FAST_STANDBY_CTRL_IMMEDIATE 1
109 
110 /* Scaling N factor */
111 #define SMIAPP_SCALE_N 16
112 
113 /* Image statistics registers */
114 /* Registers 0x2000 to 0x2fff are reserved for future
115  * use for statistics features.
116  */
117 
118 /* Manufacturer Specific Registers: 0x3000 to 0x3fff
119  * The manufacturer specifies these as a black box.
120  */
121 
122 #endif /* __SMIAPP_REG_H_ */