dp_audio.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  5. */
  6. #ifndef _DP_AUDIO_H_
  7. #define _DP_AUDIO_H_
  8. #include <linux/platform_device.h>
  9. #include "dp_panel.h"
  10. #include "dp_catalog.h"
  11. /**
  12. * struct dp_audio
  13. * @lane_count: number of lanes configured in current session
  14. * @bw_code: link rate's bandwidth code for current session
  15. * @tui_active: set to true if TUI is active in the system
  16. */
  17. struct dp_audio {
  18. u32 lane_count;
  19. u32 bw_code;
  20. bool tui_active;
  21. /**
  22. * on()
  23. *
  24. * Notifies user mode clients that DP is powered on, and that audio
  25. * playback can start on the external display.
  26. *
  27. * @dp_audio: an instance of struct dp_audio.
  28. *
  29. * Returns the error code in case of failure, 0 in success case.
  30. */
  31. int (*on)(struct dp_audio *dp_audio);
  32. /**
  33. * off()
  34. *
  35. * Notifies user mode clients that DP is shutting down, and audio
  36. * playback should be stopped on the external display.
  37. *
  38. * @dp_audio: an instance of struct dp_audio.
  39. * @skip_wait: flag to skip any waits
  40. *
  41. * Returns the error code in case of failure, 0 in success case.
  42. */
  43. int (*off)(struct dp_audio *dp_audio, bool skip_wait);
  44. };
  45. /**
  46. * dp_audio_get()
  47. *
  48. * Creates and instance of dp audio.
  49. *
  50. * @pdev: caller's platform device instance.
  51. * @panel: an instance of dp_panel module.
  52. * @catalog: an instance of dp_catalog_audio module.
  53. *
  54. * Returns the error code in case of failure, otherwize
  55. * an instance of newly created dp_module.
  56. */
  57. struct dp_audio *dp_audio_get(struct platform_device *pdev,
  58. struct dp_panel *panel,
  59. struct dp_catalog_audio *catalog);
  60. /**
  61. * dp_audio_put()
  62. *
  63. * Cleans the dp_audio instance.
  64. *
  65. * @dp_audio: an instance of dp_audio.
  66. */
  67. void dp_audio_put(struct dp_audio *dp_audio);
  68. #endif /* _DP_AUDIO_H_ */