ov772x.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * ov772x Camera
  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. #ifndef __OV772X_H__
  12. #define __OV772X_H__
  13. /* for flags */
  14. #define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */
  15. #define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */
  16. /*
  17. * for Edge ctrl
  18. *
  19. * strength also control Auto or Manual Edge Control Mode
  20. * see also OV772X_MANUAL_EDGE_CTRL
  21. */
  22. struct ov772x_edge_ctrl {
  23. unsigned char strength;
  24. unsigned char threshold;
  25. unsigned char upper;
  26. unsigned char lower;
  27. };
  28. #define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */
  29. #define OV772X_EDGE_STRENGTH_MASK 0x1F
  30. #define OV772X_EDGE_THRESHOLD_MASK 0x0F
  31. #define OV772X_EDGE_UPPER_MASK 0xFF
  32. #define OV772X_EDGE_LOWER_MASK 0xFF
  33. #define OV772X_AUTO_EDGECTRL(u, l) \
  34. { \
  35. .upper = (u & OV772X_EDGE_UPPER_MASK), \
  36. .lower = (l & OV772X_EDGE_LOWER_MASK), \
  37. }
  38. #define OV772X_MANUAL_EDGECTRL(s, t) \
  39. { \
  40. .strength = (s & OV772X_EDGE_STRENGTH_MASK) | \
  41. OV772X_MANUAL_EDGE_CTRL, \
  42. .threshold = (t & OV772X_EDGE_THRESHOLD_MASK), \
  43. }
  44. /*
  45. * ov772x camera info
  46. */
  47. struct ov772x_camera_info {
  48. unsigned long flags;
  49. struct ov772x_edge_ctrl edgectrl;
  50. };
  51. #endif /* __OV772X_H__ */