dp_ctrl.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  5. */
  6. #ifndef _DP_CTRL_H_
  7. #define _DP_CTRL_H_
  8. #include "dp_aux.h"
  9. #include "dp_panel.h"
  10. #include "dp_link.h"
  11. #include "dp_parser.h"
  12. #include "dp_power.h"
  13. #include "dp_catalog.h"
  14. #include "dp_debug.h"
  15. struct dp_ctrl {
  16. int (*init)(struct dp_ctrl *dp_ctrl, bool flip, bool reset);
  17. void (*deinit)(struct dp_ctrl *dp_ctrl);
  18. int (*on)(struct dp_ctrl *dp_ctrl, bool mst_mode, bool fec_en,
  19. bool dsc_en, bool shallow);
  20. void (*off)(struct dp_ctrl *dp_ctrl);
  21. void (*abort)(struct dp_ctrl *dp_ctrl, bool abort);
  22. void (*isr)(struct dp_ctrl *dp_ctrl);
  23. bool (*handle_sink_request)(struct dp_ctrl *dp_ctrl);
  24. void (*process_phy_test_request)(struct dp_ctrl *dp_ctrl);
  25. int (*link_maintenance)(struct dp_ctrl *dp_ctrl);
  26. int (*stream_on)(struct dp_ctrl *dp_ctrl, struct dp_panel *panel);
  27. void (*stream_off)(struct dp_ctrl *dp_ctrl, struct dp_panel *panel);
  28. void (*stream_pre_off)(struct dp_ctrl *dp_ctrl, struct dp_panel *panel);
  29. void (*set_mst_channel_info)(struct dp_ctrl *dp_ctrl,
  30. enum dp_stream_id strm,
  31. u32 ch_start_slot, u32 ch_tot_slots);
  32. void (*set_sim_mode)(struct dp_ctrl *dp_ctrl, bool en);
  33. int (*setup_misr)(struct dp_ctrl *dp_ctrl);
  34. int (*read_misr)(struct dp_ctrl *dp_ctrl, struct dp_misr40_data *data);
  35. };
  36. struct dp_ctrl_in {
  37. struct device *dev;
  38. struct dp_panel *panel;
  39. struct dp_aux *aux;
  40. struct dp_link *link;
  41. struct dp_parser *parser;
  42. struct dp_power *power;
  43. struct dp_catalog_ctrl *catalog;
  44. struct dp_pll *pll;
  45. #if defined(CONFIG_SECDP)
  46. struct secdp_misc *sec;
  47. #endif
  48. };
  49. struct dp_ctrl *dp_ctrl_get(struct dp_ctrl_in *in);
  50. void dp_ctrl_put(struct dp_ctrl *dp_ctrl);
  51. #if defined(CONFIG_SECDP)
  52. bool secdp_get_link_train_status(struct dp_ctrl *dp_ctrl);
  53. #endif
  54. #endif /* _DP_CTRL_H_ */