ov772x.h 1.4 KB

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