blob: 30d9629198ef6170e42450fbfc8255c17dc8c821 [file] [log] [blame]
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -03001/* ov772x Camera
2 *
3 * Copyright (C) 2008 Renesas Solutions Corp.
4 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __OV772X_H__
12#define __OV772X_H__
13
14#include <media/soc_camera.h>
15
Kuninori Morimoto05148912009-02-23 12:12:58 -030016/* for flags */
17#define OV772X_FLAG_VFLIP 0x00000001 /* Vertical flip image */
18#define OV772X_FLAG_HFLIP 0x00000002 /* Horizontal flip image */
19
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
33#define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */
34#define EDGE_STRENGTH_MASK 0x1F
35#define EDGE_THRESHOLD_MASK 0x0F
36#define EDGE_UPPER_MASK 0xFF
37#define EDGE_LOWER_MASK 0xFF
38
39#define OV772X_AUTO_EDGECTRL(u, l) \
40{ \
41 .upper = (u & EDGE_UPPER_MASK), \
42 .lower = (l & EDGE_LOWER_MASK), \
43}
44
45#define OV772X_MANUAL_EDGECTRL(s, t) \
46{ \
47 .strength = (s & EDGE_STRENGTH_MASK) | OV772X_MANUAL_EDGE_CTRL,\
48 .threshold = (t & EDGE_THRESHOLD_MASK), \
49}
50
51/*
52 * ov772x camera info
53 */
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -030054struct ov772x_camera_info {
55 unsigned long buswidth;
Kuninori Morimoto05148912009-02-23 12:12:58 -030056 unsigned long flags;
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -030057 struct soc_camera_link link;
Kuninori Morimotodb6cbc82009-03-31 03:44:22 -030058 struct ov772x_edge_ctrl edgectrl;
Kuninori Morimoto08a66ae2008-10-24 15:43:07 -030059};
60
61#endif /* __OV772X_H__ */