ispcsiphy.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * ispcsiphy.h
  3. *
  4. * TI OMAP3 ISP - CSI PHY module
  5. *
  6. * Copyright (C) 2010 Nokia Corporation
  7. * Copyright (C) 2009 Texas Instruments, Inc.
  8. *
  9. * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  10. * Sakari Ailus <sakari.ailus@iki.fi>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  24. * 02110-1301 USA
  25. */
  26. #ifndef OMAP3_ISP_CSI_PHY_H
  27. #define OMAP3_ISP_CSI_PHY_H
  28. struct isp_csi2_device;
  29. struct regulator;
  30. struct csiphy_lane {
  31. u8 pos;
  32. u8 pol;
  33. };
  34. #define ISP_CSIPHY2_NUM_DATA_LANES 2
  35. #define ISP_CSIPHY1_NUM_DATA_LANES 1
  36. struct isp_csiphy_lanes_cfg {
  37. struct csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
  38. struct csiphy_lane clk;
  39. };
  40. struct isp_csiphy_dphy_cfg {
  41. u8 ths_term;
  42. u8 ths_settle;
  43. u8 tclk_term;
  44. unsigned tclk_miss:1;
  45. u8 tclk_settle;
  46. };
  47. struct isp_csiphy {
  48. struct isp_device *isp;
  49. struct mutex mutex; /* serialize csiphy configuration */
  50. u8 phy_in_use;
  51. struct isp_csi2_device *csi2;
  52. struct regulator *vdd;
  53. /* mem resources - enums as defined in enum isp_mem_resources */
  54. unsigned int cfg_regs;
  55. unsigned int phy_regs;
  56. u8 num_data_lanes; /* number of CSI2 Data Lanes supported */
  57. struct isp_csiphy_lanes_cfg lanes;
  58. struct isp_csiphy_dphy_cfg dphy;
  59. };
  60. int omap3isp_csiphy_acquire(struct isp_csiphy *phy);
  61. void omap3isp_csiphy_release(struct isp_csiphy *phy);
  62. int omap3isp_csiphy_init(struct isp_device *isp);
  63. #endif /* OMAP3_ISP_CSI_PHY_H */