]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/media/ov772x.h
[media] V4L: ov772x: rename macros to not pollute the global namespace
[karo-tx-linux.git] / include / media / ov772x.h
1 /*
2  * ov772x Camera
3  *
4  * Copyright (C) 2008 Renesas Solutions Corp.
5  * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11
12 #ifndef __OV772X_H__
13 #define __OV772X_H__
14
15 /* for flags */
16 #define OV772X_FLAG_VFLIP       (1 << 0) /* Vertical flip image */
17 #define OV772X_FLAG_HFLIP       (1 << 1) /* Horizontal flip image */
18 #define OV772X_FLAG_8BIT        (1 << 2) /* default 10 bit */
19
20 /*
21  * for Edge ctrl
22  *
23  * strength also control Auto or Manual Edge Control Mode
24  * see also OV772X_MANUAL_EDGE_CTRL
25  */
26 struct ov772x_edge_ctrl {
27         unsigned char strength;
28         unsigned char threshold;
29         unsigned char upper;
30         unsigned char lower;
31 };
32
33 #define OV772X_MANUAL_EDGE_CTRL         0x80 /* un-used bit of strength */
34 #define OV772X_EDGE_STRENGTH_MASK       0x1F
35 #define OV772X_EDGE_THRESHOLD_MASK      0x0F
36 #define OV772X_EDGE_UPPER_MASK          0xFF
37 #define OV772X_EDGE_LOWER_MASK          0xFF
38
39 #define OV772X_AUTO_EDGECTRL(u, l)      \
40 {                                       \
41         .upper = (u & OV772X_EDGE_UPPER_MASK),  \
42         .lower = (l & OV772X_EDGE_LOWER_MASK),  \
43 }
44
45 #define OV772X_MANUAL_EDGECTRL(s, t)                    \
46 {                                                       \
47         .strength  = (s & OV772X_EDGE_STRENGTH_MASK) |  \
48                         OV772X_MANUAL_EDGE_CTRL,        \
49         .threshold = (t & OV772X_EDGE_THRESHOLD_MASK),  \
50 }
51
52 /*
53  * ov772x camera info
54  */
55 struct ov772x_camera_info {
56         unsigned long           flags;
57         struct ov772x_edge_ctrl edgectrl;
58 };
59
60 #endif /* __OV772X_H__ */