dsi_host.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2019 STMicroelectronics - All Rights Reserved
  4. * Author(s): Yannick Fertre <yannick.fertre@st.com> for STMicroelectronics.
  5. *
  6. */
  7. #ifndef _DSI_HOST_H
  8. #define _DSI_HOST_H
  9. #include <mipi_dsi.h>
  10. struct dsi_host_ops {
  11. /**
  12. * init() - initialized the dsi_host
  13. *
  14. * @dev: dsi host device
  15. * @device: DSI peripheral device
  16. * @timing: Display timings
  17. * @max_data_lanes: maximum number of data lines
  18. * @phy_ops: set of function pointers for performing physical operations
  19. * @return 0 if OK, -ve on error
  20. */
  21. int (*init)(struct udevice *dev,
  22. struct mipi_dsi_device *device,
  23. struct display_timing *timings,
  24. unsigned int max_data_lanes,
  25. const struct mipi_dsi_phy_ops *phy_ops);
  26. /**
  27. * enable() - Enable the dsi_host
  28. *
  29. * @dev: dsi host device
  30. * @return 0 if OK, -ve on error
  31. */
  32. int (*enable)(struct udevice *dev);
  33. /**
  34. * disable() - Disable the dsi_host
  35. *
  36. * @dev: dsi host device
  37. * @return 0 if OK, -ve on error
  38. */
  39. int (*disable)(struct udevice *dev);
  40. };
  41. #define dsi_host_get_ops(dev) ((struct dsi_host_ops *)(dev)->driver->ops)
  42. /**
  43. * dsi_host_init
  44. *
  45. * @dev: dsi host device
  46. * @device: DSI peripheral device
  47. * @timing: Display timings
  48. * @max_data_lanes: maximum number of data lines
  49. * @phy_ops: set of function pointers for performing physical operations
  50. * @return 0 if OK, -ve on error
  51. */
  52. int dsi_host_init(struct udevice *dev,
  53. struct mipi_dsi_device *device,
  54. struct display_timing *timings,
  55. unsigned int max_data_lanes,
  56. const struct mipi_dsi_phy_ops *phy_ops);
  57. /**
  58. * dsi_host_enable
  59. *
  60. * @dev: dsi host device
  61. * @return 0 if OK, -ve on error
  62. */
  63. int dsi_host_enable(struct udevice *dev);
  64. #endif