ovcamchip.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* OmniVision* camera chip driver API
  2. *
  3. * Copyright (c) 1999-2004 Mark McClelland
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied.
  9. *
  10. * * OmniVision is a trademark of OmniVision Technologies, Inc. This driver
  11. * is not sponsored or developed by them.
  12. */
  13. #ifndef __LINUX_OVCAMCHIP_H
  14. #define __LINUX_OVCAMCHIP_H
  15. #include <linux/videodev.h>
  16. #include <media/v4l2-common.h>
  17. #include <linux/i2c.h>
  18. /* --------------------------------- */
  19. /* ENUMERATIONS */
  20. /* --------------------------------- */
  21. /* Controls */
  22. enum {
  23. OVCAMCHIP_CID_CONT, /* Contrast */
  24. OVCAMCHIP_CID_BRIGHT, /* Brightness */
  25. OVCAMCHIP_CID_SAT, /* Saturation */
  26. OVCAMCHIP_CID_HUE, /* Hue */
  27. OVCAMCHIP_CID_EXP, /* Exposure */
  28. OVCAMCHIP_CID_FREQ, /* Light frequency */
  29. OVCAMCHIP_CID_BANDFILT, /* Banding filter */
  30. OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */
  31. OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */
  32. OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */
  33. OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */
  34. };
  35. /* Chip types */
  36. #define NUM_CC_TYPES 9
  37. enum {
  38. CC_UNKNOWN,
  39. CC_OV76BE,
  40. CC_OV7610,
  41. CC_OV7620,
  42. CC_OV7620AE,
  43. CC_OV6620,
  44. CC_OV6630,
  45. CC_OV6630AE,
  46. CC_OV6630AF,
  47. };
  48. /* --------------------------------- */
  49. /* I2C ADDRESSES */
  50. /* --------------------------------- */
  51. #define OV7xx0_SID (0x42 >> 1)
  52. #define OV6xx0_SID (0xC0 >> 1)
  53. /* --------------------------------- */
  54. /* API */
  55. /* --------------------------------- */
  56. struct ovcamchip_control {
  57. __u32 id;
  58. __s32 value;
  59. };
  60. struct ovcamchip_window {
  61. int x;
  62. int y;
  63. int width;
  64. int height;
  65. int format;
  66. int quarter; /* Scale width and height down 2x */
  67. /* This stuff will be removed eventually */
  68. int clockdiv; /* Clock divisor setting */
  69. };
  70. /* Commands */
  71. #define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int)
  72. #define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int)
  73. /* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */
  74. #define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control)
  75. #define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control)
  76. #define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window)
  77. #define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f)
  78. #endif