smiapp.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * include/media/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. #define SMIAPP_NO_XSHUTDOWN -1
  34. /*
  35. * Sometimes due to board layout considerations the camera module can be
  36. * mounted rotated. The typical rotation used is 180 degrees which can be
  37. * corrected by giving a default H-FLIP and V-FLIP in the sensor readout.
  38. * FIXME: rotation also changes the bayer pattern.
  39. */
  40. enum smiapp_module_board_orient {
  41. SMIAPP_MODULE_BOARD_ORIENT_0 = 0,
  42. SMIAPP_MODULE_BOARD_ORIENT_180,
  43. };
  44. struct smiapp_flash_strobe_parms {
  45. u8 mode;
  46. u32 strobe_width_high_us;
  47. u16 strobe_delay;
  48. u16 stobe_start_point;
  49. u8 trigger;
  50. };
  51. struct smiapp_platform_data {
  52. /*
  53. * Change the cci address if i2c_addr_alt is set.
  54. * Both default and alternate cci addr need to be present
  55. */
  56. unsigned short i2c_addr_dfl; /* Default i2c addr */
  57. unsigned short i2c_addr_alt; /* Alternate i2c addr */
  58. uint32_t nvm_size; /* bytes */
  59. uint32_t ext_clk; /* sensor external clk */
  60. unsigned int lanes; /* Number of CSI-2 lanes */
  61. uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */
  62. uint64_t *op_sys_clock;
  63. enum smiapp_module_board_orient module_board_orient;
  64. struct smiapp_flash_strobe_parms *strobe_setup;
  65. int (*set_xclk)(struct v4l2_subdev *sd, int hz);
  66. int32_t xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */
  67. };
  68. #endif /* __SMIAPP_H_ */