dsi-host-uclass.c 872 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #define LOG_CATEGORY UCLASS_DSI_HOST
  8. #include <common.h>
  9. #include <dm.h>
  10. #include <dsi_host.h>
  11. int dsi_host_init(struct udevice *dev,
  12. struct mipi_dsi_device *device,
  13. struct display_timing *timings,
  14. unsigned int max_data_lanes,
  15. const struct mipi_dsi_phy_ops *phy_ops)
  16. {
  17. struct dsi_host_ops *ops = dsi_host_get_ops(dev);
  18. if (!ops->init)
  19. return -ENOSYS;
  20. return ops->init(dev, device, timings, max_data_lanes, phy_ops);
  21. }
  22. int dsi_host_enable(struct udevice *dev)
  23. {
  24. struct dsi_host_ops *ops = dsi_host_get_ops(dev);
  25. if (!ops->enable)
  26. return -ENOSYS;
  27. return ops->enable(dev);
  28. }
  29. UCLASS_DRIVER(dsi_host) = {
  30. .id = UCLASS_DSI_HOST,
  31. .name = "dsi_host",
  32. };