smiapp.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. */
  19. #ifndef __SMIAPP_H_
  20. #define __SMIAPP_H_
  21. #include <media/v4l2-subdev.h>
  22. #define SMIAPP_NAME "smiapp"
  23. #define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */
  24. #define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */
  25. #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK 0
  26. #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE 1
  27. #define SMIAPP_CSI_SIGNALLING_MODE_CSI2 2
  28. /*
  29. * Sometimes due to board layout considerations the camera module can be
  30. * mounted rotated. The typical rotation used is 180 degrees which can be
  31. * corrected by giving a default H-FLIP and V-FLIP in the sensor readout.
  32. * FIXME: rotation also changes the bayer pattern.
  33. */
  34. enum smiapp_module_board_orient {
  35. SMIAPP_MODULE_BOARD_ORIENT_0 = 0,
  36. SMIAPP_MODULE_BOARD_ORIENT_180,
  37. };
  38. struct smiapp_flash_strobe_parms {
  39. u8 mode;
  40. u32 strobe_width_high_us;
  41. u16 strobe_delay;
  42. u16 stobe_start_point;
  43. u8 trigger;
  44. };
  45. struct smiapp_hwconfig {
  46. /*
  47. * Change the cci address if i2c_addr_alt is set.
  48. * Both default and alternate cci addr need to be present
  49. */
  50. unsigned short i2c_addr_dfl; /* Default i2c addr */
  51. unsigned short i2c_addr_alt; /* Alternate i2c addr */
  52. uint32_t nvm_size; /* bytes */
  53. uint32_t ext_clk; /* sensor external clk */
  54. unsigned int lanes; /* Number of CSI-2 lanes */
  55. uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */
  56. uint64_t *op_sys_clock;
  57. enum smiapp_module_board_orient module_board_orient;
  58. struct smiapp_flash_strobe_parms *strobe_setup;
  59. };
  60. #endif /* __SMIAPP_H_ */