ovcamchip.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. /* --------------------------------- */
  18. /* ENUMERATIONS */
  19. /* --------------------------------- */
  20. /* Controls */
  21. enum {
  22. OVCAMCHIP_CID_CONT, /* Contrast */
  23. OVCAMCHIP_CID_BRIGHT, /* Brightness */
  24. OVCAMCHIP_CID_SAT, /* Saturation */
  25. OVCAMCHIP_CID_HUE, /* Hue */
  26. OVCAMCHIP_CID_EXP, /* Exposure */
  27. OVCAMCHIP_CID_FREQ, /* Light frequency */
  28. OVCAMCHIP_CID_BANDFILT, /* Banding filter */
  29. OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */
  30. OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */
  31. OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */
  32. OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */
  33. };
  34. /* Chip types */
  35. #define NUM_CC_TYPES 9
  36. enum {
  37. CC_UNKNOWN,
  38. CC_OV76BE,
  39. CC_OV7610,
  40. CC_OV7620,
  41. CC_OV7620AE,
  42. CC_OV6620,
  43. CC_OV6630,
  44. CC_OV6630AE,
  45. CC_OV6630AF,
  46. };
  47. /* --------------------------------- */
  48. /* I2C ADDRESSES */
  49. /* --------------------------------- */
  50. #define OV7xx0_SID (0x42 >> 1)
  51. #define OV6xx0_SID (0xC0 >> 1)
  52. /* --------------------------------- */
  53. /* API */
  54. /* --------------------------------- */
  55. struct ovcamchip_control {
  56. __u32 id;
  57. __s32 value;
  58. };
  59. struct ovcamchip_window {
  60. int x;
  61. int y;
  62. int width;
  63. int height;
  64. int format;
  65. int quarter; /* Scale width and height down 2x */
  66. /* This stuff will be removed eventually */
  67. int clockdiv; /* Clock divisor setting */
  68. };
  69. /* Commands */
  70. #define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int)
  71. #define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int)
  72. /* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */
  73. #define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control)
  74. #define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control)
  75. #define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window)
  76. #define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f)
  77. #endif