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 | |
| 15 | #include <media/soc_camera.h> |
| 16 | |
Kuninori Morimoto | 0514891 | 2009-02-23 12:12:58 -0300 | [diff] [blame] | 17 | /* for flags */ |
| 18 | #define OV772X_FLAG_VFLIP 0x00000001 /* Vertical flip image */ |
| 19 | #define OV772X_FLAG_HFLIP 0x00000002 /* Horizontal flip image */ |
| 20 | |
Kuninori Morimoto | db6cbc8 | 2009-03-31 03:44:22 -0300 | [diff] [blame] | 21 | /* |
| 22 | * for Edge ctrl |
| 23 | * |
| 24 | * strength also control Auto or Manual Edge Control Mode |
| 25 | * see also OV772X_MANUAL_EDGE_CTRL |
| 26 | */ |
| 27 | struct ov772x_edge_ctrl { |
| 28 | unsigned char strength; |
| 29 | unsigned char threshold; |
| 30 | unsigned char upper; |
| 31 | unsigned char lower; |
| 32 | }; |
| 33 | |
| 34 | #define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */ |
| 35 | #define EDGE_STRENGTH_MASK 0x1F |
| 36 | #define EDGE_THRESHOLD_MASK 0x0F |
| 37 | #define EDGE_UPPER_MASK 0xFF |
| 38 | #define EDGE_LOWER_MASK 0xFF |
| 39 | |
| 40 | #define OV772X_AUTO_EDGECTRL(u, l) \ |
| 41 | { \ |
| 42 | .upper = (u & EDGE_UPPER_MASK), \ |
| 43 | .lower = (l & EDGE_LOWER_MASK), \ |
| 44 | } |
| 45 | |
| 46 | #define OV772X_MANUAL_EDGECTRL(s, t) \ |
| 47 | { \ |
| 48 | .strength = (s & EDGE_STRENGTH_MASK) | OV772X_MANUAL_EDGE_CTRL,\ |
| 49 | .threshold = (t & EDGE_THRESHOLD_MASK), \ |
| 50 | } |
| 51 | |
| 52 | /* |
| 53 | * ov772x camera info |
| 54 | */ |
Kuninori Morimoto | 08a66ae | 2008-10-24 15:43:07 -0300 | [diff] [blame] | 55 | struct ov772x_camera_info { |
| 56 | unsigned long buswidth; |
Kuninori Morimoto | 0514891 | 2009-02-23 12:12:58 -0300 | [diff] [blame] | 57 | unsigned long flags; |
Kuninori Morimoto | db6cbc8 | 2009-03-31 03:44:22 -0300 | [diff] [blame] | 58 | struct ov772x_edge_ctrl edgectrl; |
Kuninori Morimoto | 08a66ae | 2008-10-24 15:43:07 -0300 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | #endif /* __OV772X_H__ */ |