dp_audio.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-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. #include <sound/hdmi-codec.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. */
  16. struct dp_audio {
  17. u32 lane_count;
  18. u32 bw_code;
  19. };
  20. /**
  21. * dp_audio_get()
  22. *
  23. * Creates and instance of dp audio.
  24. *
  25. * @pdev: caller's platform device instance.
  26. * @panel: an instance of dp_panel module.
  27. * @catalog: an instance of dp_catalog module.
  28. *
  29. * Returns the error code in case of failure, otherwize
  30. * an instance of newly created dp_module.
  31. */
  32. struct dp_audio *dp_audio_get(struct platform_device *pdev,
  33. struct dp_panel *panel,
  34. struct dp_catalog *catalog);
  35. /**
  36. * dp_register_audio_driver()
  37. *
  38. * Registers DP device with hdmi_codec interface.
  39. *
  40. * @dev: DP device instance.
  41. * @dp_audio: an instance of dp_audio module.
  42. *
  43. *
  44. * Returns the error code in case of failure, otherwise
  45. * zero on success.
  46. */
  47. int dp_register_audio_driver(struct device *dev,
  48. struct dp_audio *dp_audio);
  49. void dp_unregister_audio_driver(struct device *dev, struct dp_audio *dp_audio);
  50. /**
  51. * dp_audio_put()
  52. *
  53. * Cleans the dp_audio instance.
  54. *
  55. * @dp_audio: an instance of dp_audio.
  56. */
  57. void dp_audio_put(struct dp_audio *dp_audio);
  58. int dp_audio_hw_params(struct device *dev,
  59. void *data,
  60. struct hdmi_codec_daifmt *daifmt,
  61. struct hdmi_codec_params *params);
  62. #endif /* _DP_AUDIO_H_ */