sof_sdw_common.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. * Copyright (c) 2020 Intel Corporation
  3. */
  4. /*
  5. * sof_sdw_common.h - prototypes for common helpers
  6. */
  7. #ifndef SND_SOC_SOF_SDW_COMMON_H
  8. #define SND_SOC_SOF_SDW_COMMON_H
  9. #include <linux/bits.h>
  10. #include <linux/types.h>
  11. #include <sound/soc.h>
  12. #include <sound/soc_sdw_utils.h>
  13. #include "sof_hdmi_common.h"
  14. #define MAX_HDMI_NUM 4
  15. #define SOC_SDW_MAX_CPU_DAIS 16
  16. #define SOC_SDW_INTEL_BIDIR_PDI_BASE 2
  17. /* 8 combinations with 4 links + unused group 0 */
  18. #define SDW_MAX_GROUPS 9
  19. enum {
  20. SOF_PRE_TGL_HDMI_COUNT = 3,
  21. SOF_TGL_HDMI_COUNT = 4,
  22. };
  23. enum {
  24. SOF_I2S_SSP0 = BIT(0),
  25. SOF_I2S_SSP1 = BIT(1),
  26. SOF_I2S_SSP2 = BIT(2),
  27. SOF_I2S_SSP3 = BIT(3),
  28. SOF_I2S_SSP4 = BIT(4),
  29. SOF_I2S_SSP5 = BIT(5),
  30. };
  31. /* Deprecated and no longer supported by the code */
  32. #define SOC_SDW_FOUR_SPK BIT(4)
  33. #define SOF_SDW_TGL_HDMI BIT(5)
  34. #define SOC_SDW_PCH_DMIC BIT(6)
  35. #define SOF_SSP_PORT(x) (((x) & GENMASK(5, 0)) << 7)
  36. #define SOF_SSP_GET_PORT(quirk) (((quirk) >> 7) & GENMASK(5, 0))
  37. /* Deprecated and no longer supported by the code */
  38. #define SOC_SDW_NO_AGGREGATION BIT(14)
  39. /* BT audio offload: reserve 3 bits for future */
  40. #define SOF_BT_OFFLOAD_SSP_SHIFT 15
  41. #define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(17, 15))
  42. #define SOF_BT_OFFLOAD_SSP(quirk) \
  43. (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK)
  44. #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18)
  45. struct intel_mc_ctx {
  46. struct sof_hdmi_private hdmi;
  47. /* To store SDW Pin index for each SoundWire link */
  48. unsigned int sdw_pin_index[SDW_INTEL_MAX_LINKS];
  49. };
  50. /* generic HDMI support */
  51. int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd);
  52. int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card);
  53. #endif