m5602_s5k4aa.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Driver for the s5k4aa sensor
  3. *
  4. * Copyright (C) 2008 Erik Andrén
  5. * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
  6. * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
  7. *
  8. * Portions of code to USB interface and ALi driver software,
  9. * Copyright (c) 2006 Willem Duinker
  10. * v4l2 interface modeled after the V4L2 driver
  11. * for SN9C10x PC Camera Controllers
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License as
  15. * published by the Free Software Foundation, version 2.
  16. *
  17. */
  18. #ifndef M5602_S5K4AA_H_
  19. #define M5602_S5K4AA_H_
  20. #include <linux/dmi.h>
  21. #include "m5602_sensor.h"
  22. /*****************************************************************************/
  23. #define S5K4AA_PAGE_MAP 0xec
  24. #define S5K4AA_PAGE_MAP_0 0x00
  25. #define S5K4AA_PAGE_MAP_1 0x01
  26. #define S5K4AA_PAGE_MAP_2 0x02
  27. /* Sensor register definitions for page 0x02 */
  28. #define S5K4AA_READ_MODE 0x03
  29. #define S5K4AA_ROWSTART_HI 0x04
  30. #define S5K4AA_ROWSTART_LO 0x05
  31. #define S5K4AA_COLSTART_HI 0x06
  32. #define S5K4AA_COLSTART_LO 0x07
  33. #define S5K4AA_WINDOW_HEIGHT_HI 0x08
  34. #define S5K4AA_WINDOW_HEIGHT_LO 0x09
  35. #define S5K4AA_WINDOW_WIDTH_HI 0x0a
  36. #define S5K4AA_WINDOW_WIDTH_LO 0x0b
  37. #define S5K4AA_GLOBAL_GAIN__ 0x0f
  38. /* sync lost, if too low, reduces frame rate if too high */
  39. #define S5K4AA_H_BLANK_HI__ 0x1d
  40. #define S5K4AA_H_BLANK_LO__ 0x1e
  41. #define S5K4AA_EXPOSURE_HI 0x17
  42. #define S5K4AA_EXPOSURE_LO 0x18
  43. #define S5K4AA_BRIGHTNESS 0x1f /* (digital?) gain : 5 bits */
  44. #define S5K4AA_GAIN 0x20 /* (analogue?) gain : 7 bits */
  45. #define S5K4AA_NOISE_SUPP 0x37
  46. #define S5K4AA_RM_ROW_SKIP_4X 0x08
  47. #define S5K4AA_RM_ROW_SKIP_2X 0x04
  48. #define S5K4AA_RM_COL_SKIP_4X 0x02
  49. #define S5K4AA_RM_COL_SKIP_2X 0x01
  50. #define S5K4AA_RM_H_FLIP 0x40
  51. #define S5K4AA_RM_V_FLIP 0x80
  52. #define S5K4AA_DEFAULT_GAIN 0x5f
  53. #define S5K4AA_DEFAULT_BRIGHTNESS 0x10
  54. /*****************************************************************************/
  55. /* Kernel module parameters */
  56. extern int force_sensor;
  57. extern bool dump_sensor;
  58. int s5k4aa_probe(struct sd *sd);
  59. int s5k4aa_init(struct sd *sd);
  60. int s5k4aa_init_controls(struct sd *sd);
  61. int s5k4aa_start(struct sd *sd);
  62. void s5k4aa_disconnect(struct sd *sd);
  63. static const struct m5602_sensor s5k4aa = {
  64. .name = "S5K4AA",
  65. .i2c_slave_id = 0x5a,
  66. .i2c_regW = 2,
  67. .probe = s5k4aa_probe,
  68. .init = s5k4aa_init,
  69. .init_controls = s5k4aa_init_controls,
  70. .start = s5k4aa_start,
  71. .disconnect = s5k4aa_disconnect,
  72. };
  73. #endif