18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * ov772x Camera
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2008 Renesas Solutions Corp.
68c2ecf20Sopenharmony_ci * Kuninori Morimoto <morimoto.kuninori@renesas.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __OV772X_H__
108c2ecf20Sopenharmony_ci#define __OV772X_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/* for flags */
138c2ecf20Sopenharmony_ci#define OV772X_FLAG_VFLIP	(1 << 0) /* Vertical flip image */
148c2ecf20Sopenharmony_ci#define OV772X_FLAG_HFLIP	(1 << 1) /* Horizontal flip image */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci * for Edge ctrl
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * strength also control Auto or Manual Edge Control Mode
208c2ecf20Sopenharmony_ci * see also OV772X_MANUAL_EDGE_CTRL
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_cistruct ov772x_edge_ctrl {
238c2ecf20Sopenharmony_ci	unsigned char strength;
248c2ecf20Sopenharmony_ci	unsigned char threshold;
258c2ecf20Sopenharmony_ci	unsigned char upper;
268c2ecf20Sopenharmony_ci	unsigned char lower;
278c2ecf20Sopenharmony_ci};
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#define OV772X_MANUAL_EDGE_CTRL		0x80 /* un-used bit of strength */
308c2ecf20Sopenharmony_ci#define OV772X_EDGE_STRENGTH_MASK	0x1F
318c2ecf20Sopenharmony_ci#define OV772X_EDGE_THRESHOLD_MASK	0x0F
328c2ecf20Sopenharmony_ci#define OV772X_EDGE_UPPER_MASK		0xFF
338c2ecf20Sopenharmony_ci#define OV772X_EDGE_LOWER_MASK		0xFF
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define OV772X_AUTO_EDGECTRL(u, l)	\
368c2ecf20Sopenharmony_ci{					\
378c2ecf20Sopenharmony_ci	.upper = (u & OV772X_EDGE_UPPER_MASK),	\
388c2ecf20Sopenharmony_ci	.lower = (l & OV772X_EDGE_LOWER_MASK),	\
398c2ecf20Sopenharmony_ci}
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define OV772X_MANUAL_EDGECTRL(s, t)			\
428c2ecf20Sopenharmony_ci{							\
438c2ecf20Sopenharmony_ci	.strength  = (s & OV772X_EDGE_STRENGTH_MASK) |	\
448c2ecf20Sopenharmony_ci			OV772X_MANUAL_EDGE_CTRL,	\
458c2ecf20Sopenharmony_ci	.threshold = (t & OV772X_EDGE_THRESHOLD_MASK),	\
468c2ecf20Sopenharmony_ci}
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/**
498c2ecf20Sopenharmony_ci * ov772x_camera_info -	ov772x driver interface structure
508c2ecf20Sopenharmony_ci * @flags:		Sensor configuration flags
518c2ecf20Sopenharmony_ci * @edgectrl:		Sensor edge control
528c2ecf20Sopenharmony_ci */
538c2ecf20Sopenharmony_cistruct ov772x_camera_info {
548c2ecf20Sopenharmony_ci	unsigned long		flags;
558c2ecf20Sopenharmony_ci	struct ov772x_edge_ctrl	edgectrl;
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#endif /* __OV772X_H__ */
59