^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * ov772x Camera
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2008 Renesas Solutions Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Kuninori Morimoto <morimoto.kuninori@renesas.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef __OV772X_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define __OV772X_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /* for flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * for Edge ctrl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * strength also control Auto or Manual Edge Control Mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * see also OV772X_MANUAL_EDGE_CTRL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct ov772x_edge_ctrl {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) unsigned char strength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) unsigned char threshold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) unsigned char upper;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) unsigned char lower;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define OV772X_EDGE_STRENGTH_MASK 0x1F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define OV772X_EDGE_THRESHOLD_MASK 0x0F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define OV772X_EDGE_UPPER_MASK 0xFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define OV772X_EDGE_LOWER_MASK 0xFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define OV772X_AUTO_EDGECTRL(u, l) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) .upper = (u & OV772X_EDGE_UPPER_MASK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) .lower = (l & OV772X_EDGE_LOWER_MASK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define OV772X_MANUAL_EDGECTRL(s, t) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) .strength = (s & OV772X_EDGE_STRENGTH_MASK) | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) OV772X_MANUAL_EDGE_CTRL, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) .threshold = (t & OV772X_EDGE_THRESHOLD_MASK), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * ov772x_camera_info - ov772x driver interface structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * @flags: Sensor configuration flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * @edgectrl: Sensor edge control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct ov772x_camera_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct ov772x_edge_ctrl edgectrl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #endif /* __OV772X_H__ */