blob: f9e27c0ce901759ab00343e7c0be46150077570c [file] [log] [blame]
Guennadi Liakhovetski5d28d522009-12-11 11:15:05 -03001/*
2 * ov772x Camera
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -03003 *
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
Kuninori Morimoto05148912009-02-23 12:12:58 -030015/* for flags */
Kuninori Morimoto3675c752010-01-06 18:42:16 +090016#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 */
Kuninori Morimoto05148912009-02-23 12:12:58 -030019
Kuninori Morimotodb6cbc82009-03-31 03:44:22 -030020/*
21 * for Edge ctrl
22 *
23 * strength also control Auto or Manual Edge Control Mode
24 * see also OV772X_MANUAL_EDGE_CTRL
25 */
26struct ov772x_edge_ctrl {
27 unsigned char strength;
28 unsigned char threshold;
29 unsigned char upper;
30 unsigned char lower;
31};
32
Guennadi Liakhovetski2891f372011-07-26 12:20:42 -030033#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
Kuninori Morimotodb6cbc82009-03-31 03:44:22 -030038
39#define OV772X_AUTO_EDGECTRL(u, l) \
40{ \
Guennadi Liakhovetski2891f372011-07-26 12:20:42 -030041 .upper = (u & OV772X_EDGE_UPPER_MASK), \
42 .lower = (l & OV772X_EDGE_LOWER_MASK), \
Kuninori Morimotodb6cbc82009-03-31 03:44:22 -030043}
44
Guennadi Liakhovetski2891f372011-07-26 12:20:42 -030045#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), \
Kuninori Morimotodb6cbc82009-03-31 03:44:22 -030050}
51
52/*
53 * ov772x camera info
54 */
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -030055struct ov772x_camera_info {
Kuninori Morimoto3675c752010-01-06 18:42:16 +090056 unsigned long flags;
57 struct ov772x_edge_ctrl edgectrl;
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -030058};
59
60#endif /* __OV772X_H__ */