smiapp.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * include/media/i2c/smiapp.h
  3. *
  4. * Generic driver for SMIA/SMIA++ compliant camera modules
  5. *
  6. * Copyright (C) 2011--2012 Nokia Corporation
  7. * Contact: Sakari Ailus <sakari.ailus@iki.fi>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #ifndef __SMIAPP_H_
  25. #define __SMIAPP_H_
  26. #include <media/v4l2-subdev.h>
  27. #define SMIAPP_NAME "smiapp"
  28. #define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */
  29. #define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */
  30. #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK 0
  31. #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE 1
  32. #define SMIAPP_CSI_SIGNALLING_MODE_CSI2 2
  33. /*
  34. * Sometimes due to board layout considerations the camera module can be
  35. * mounted rotated. The typical rotation used is 180 degrees which can be
  36. * corrected by giving a default H-FLIP and V-FLIP in the sensor readout.
  37. * FIXME: rotation also changes the bayer pattern.
  38. */
  39. enum smiapp_module_board_orient {
  40. SMIAPP_MODULE_BOARD_ORIENT_0 = 0,
  41. SMIAPP_MODULE_BOARD_ORIENT_180,
  42. };
  43. struct smiapp_flash_strobe_parms {
  44. u8 mode;
  45. u32 strobe_width_high_us;
  46. u16 strobe_delay;
  47. u16 stobe_start_point;
  48. u8 trigger;
  49. };
  50. struct smiapp_hwconfig {
  51. /*
  52. * Change the cci address if i2c_addr_alt is set.
  53. * Both default and alternate cci addr need to be present
  54. */
  55. unsigned short i2c_addr_dfl; /* Default i2c addr */
  56. unsigned short i2c_addr_alt; /* Alternate i2c addr */
  57. uint32_t nvm_size; /* bytes */
  58. uint32_t ext_clk; /* sensor external clk */
  59. unsigned int lanes; /* Number of CSI-2 lanes */
  60. uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */
  61. uint64_t *op_sys_clock;
  62. enum smiapp_module_board_orient module_board_orient;
  63. struct smiapp_flash_strobe_parms *strobe_setup;
  64. };
  65. #endif /* __SMIAPP_H_ */