Guennadi Liakhovetski | 5d28d52 | 2009-12-11 11:15:05 -0300 | [diff] [blame] | 1 | /* |
| 2 | * ov772x Camera |
Kuninori Morimoto | 08a66ae | 2008-10-24 15:43:07 -0300 | [diff] [blame] | 3 | * |
| 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 Morimoto | 0514891 | 2009-02-23 12:12:58 -0300 | [diff] [blame] | 15 | /* for flags */ |
Kuninori Morimoto | 3675c75 | 2010-01-06 18:42:16 +0900 | [diff] [blame] | 16 | #define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */ |
| 17 | #define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */ |
Kuninori Morimoto | 0514891 | 2009-02-23 12:12:58 -0300 | [diff] [blame] | 18 | |
Kuninori Morimoto | db6cbc8 | 2009-03-31 03:44:22 -0300 | [diff] [blame] | 19 | /* |
| 20 | * for Edge ctrl |
| 21 | * |
| 22 | * strength also control Auto or Manual Edge Control Mode |
| 23 | * see also OV772X_MANUAL_EDGE_CTRL |
| 24 | */ |
| 25 | struct ov772x_edge_ctrl { |
| 26 | unsigned char strength; |
| 27 | unsigned char threshold; |
| 28 | unsigned char upper; |
| 29 | unsigned char lower; |
| 30 | }; |
| 31 | |
Guennadi Liakhovetski | 2891f37 | 2011-07-26 12:20:42 -0300 | [diff] [blame] | 32 | #define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */ |
| 33 | #define OV772X_EDGE_STRENGTH_MASK 0x1F |
| 34 | #define OV772X_EDGE_THRESHOLD_MASK 0x0F |
| 35 | #define OV772X_EDGE_UPPER_MASK 0xFF |
| 36 | #define OV772X_EDGE_LOWER_MASK 0xFF |
Kuninori Morimoto | db6cbc8 | 2009-03-31 03:44:22 -0300 | [diff] [blame] | 37 | |
| 38 | #define OV772X_AUTO_EDGECTRL(u, l) \ |
| 39 | { \ |
Guennadi Liakhovetski | 2891f37 | 2011-07-26 12:20:42 -0300 | [diff] [blame] | 40 | .upper = (u & OV772X_EDGE_UPPER_MASK), \ |
| 41 | .lower = (l & OV772X_EDGE_LOWER_MASK), \ |
Kuninori Morimoto | db6cbc8 | 2009-03-31 03:44:22 -0300 | [diff] [blame] | 42 | } |
| 43 | |
Guennadi Liakhovetski | 2891f37 | 2011-07-26 12:20:42 -0300 | [diff] [blame] | 44 | #define OV772X_MANUAL_EDGECTRL(s, t) \ |
| 45 | { \ |
| 46 | .strength = (s & OV772X_EDGE_STRENGTH_MASK) | \ |
| 47 | OV772X_MANUAL_EDGE_CTRL, \ |
| 48 | .threshold = (t & OV772X_EDGE_THRESHOLD_MASK), \ |
Kuninori Morimoto | db6cbc8 | 2009-03-31 03:44:22 -0300 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | /* |
| 52 | * ov772x camera info |
| 53 | */ |
Kuninori Morimoto | 08a66ae | 2008-10-24 15:43:07 -0300 | [diff] [blame] | 54 | struct ov772x_camera_info { |
Kuninori Morimoto | 3675c75 | 2010-01-06 18:42:16 +0900 | [diff] [blame] | 55 | unsigned long flags; |
| 56 | struct ov772x_edge_ctrl edgectrl; |
Kuninori Morimoto | 08a66ae | 2008-10-24 15:43:07 -0300 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | #endif /* __OV772X_H__ */ |