dp_audio.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2019, 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. */
  15. struct dp_audio {
  16. u32 lane_count;
  17. u32 bw_code;
  18. /**
  19. * on()
  20. *
  21. * Enables the audio by notifying the user module.
  22. *
  23. * @dp_audio: an instance of struct dp_audio.
  24. *
  25. * Returns the error code in case of failure, 0 in success case.
  26. */
  27. int (*on)(struct dp_audio *dp_audio);
  28. /**
  29. * off()
  30. *
  31. * Disables the audio by notifying the user module.
  32. *
  33. * @dp_audio: an instance of struct dp_audio.
  34. *
  35. * Returns the error code in case of failure, 0 in success case.
  36. */
  37. int (*off)(struct dp_audio *dp_audio);
  38. };
  39. /**
  40. * dp_audio_get()
  41. *
  42. * Creates and instance of dp audio.
  43. *
  44. * @pdev: caller's platform device instance.
  45. * @panel: an instance of dp_panel module.
  46. * @catalog: an instance of dp_catalog_audio module.
  47. *
  48. * Returns the error code in case of failure, otherwize
  49. * an instance of newly created dp_module.
  50. */
  51. struct dp_audio *dp_audio_get(struct platform_device *pdev,
  52. struct dp_panel *panel,
  53. struct dp_catalog_audio *catalog);
  54. /**
  55. * dp_audio_put()
  56. *
  57. * Cleans the dp_audio instance.
  58. *
  59. * @dp_audio: an instance of dp_audio.
  60. */
  61. void dp_audio_put(struct dp_audio *dp_audio);
  62. #endif /* _DP_AUDIO_H_ */