From 5e8385995e4d6c1811a1b8e5e819094658cdb77c Mon Sep 17 00:00:00 2001
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Date: Tue, 31 Mar 2009 08:44:22 +0200
Subject: ov772x: add edge contrl support From: Kuninori Morimoto
 <morimoto.kuninori@renesas.com>

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/media/video/ov772x.c |   63 +++++++++++++++++++++++++++++++++++++++--
 include/media/ov772x.h       |   35 +++++++++++++++++++++++
 2 files changed, 94 insertions(+), 4 deletions(-)
---
 linux/include/media/ov772x.h | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

(limited to 'linux/include/media/ov772x.h')

diff --git a/linux/include/media/ov772x.h b/linux/include/media/ov772x.h
index 57db48dd8..30d962919 100644
--- a/linux/include/media/ov772x.h
+++ b/linux/include/media/ov772x.h
@@ -17,10 +17,45 @@
 #define OV772X_FLAG_VFLIP     0x00000001 /* Vertical flip image */
 #define OV772X_FLAG_HFLIP     0x00000002 /* Horizontal flip image */
 
+/*
+ * for Edge ctrl
+ *
+ * strength also control Auto or Manual Edge Control Mode
+ * see also OV772X_MANUAL_EDGE_CTRL
+ */
+struct ov772x_edge_ctrl {
+	unsigned char strength;
+	unsigned char threshold;
+	unsigned char upper;
+	unsigned char lower;
+};
+
+#define OV772X_MANUAL_EDGE_CTRL	0x80 /* un-used bit of strength */
+#define EDGE_STRENGTH_MASK	0x1F
+#define EDGE_THRESHOLD_MASK	0x0F
+#define EDGE_UPPER_MASK		0xFF
+#define EDGE_LOWER_MASK		0xFF
+
+#define OV772X_AUTO_EDGECTRL(u, l)	\
+{					\
+	.upper = (u & EDGE_UPPER_MASK),	\
+	.lower = (l & EDGE_LOWER_MASK),	\
+}
+
+#define OV772X_MANUAL_EDGECTRL(s, t)					\
+{									\
+	.strength  = (s & EDGE_STRENGTH_MASK) | OV772X_MANUAL_EDGE_CTRL,\
+	.threshold = (t & EDGE_THRESHOLD_MASK),				\
+}
+
+/*
+ * ov772x camera info
+ */
 struct ov772x_camera_info {
 	unsigned long          buswidth;
 	unsigned long          flags;
 	struct soc_camera_link link;
+	struct ov772x_edge_ctrl edgectrl;
 };
 
 #endif /* __OV772X_H__ */
-- 
cgit v1.2.3