ov772x.h 1.4 KB

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