dp_audio.h 1.7 KB

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