ovcamchip.h 2.8 KB

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