lahaina-port-config.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _LAHAINA_PORT_CONFIG
  6. #define _LAHAINA_PORT_CONFIG
  7. #include <soc/swr-common.h>
  8. #include <soc/soundwire.h>
  9. #define WSA_MSTR_PORT_MASK 0xFF
  10. /*
  11. * Add port configuration in the format
  12. *{ si, off1, off2, hstart, hstop, wd_len, bp_mode, bgp_ctrl, lane_ctrl, dir,
  13. * stream_type}
  14. */
  15. static struct port_params wsa_frame_params_default[SWR_MSTR_PORT_LEN] = {
  16. {7, 1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00},
  17. {31, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00},
  18. {63, 12, 31, 0xFF, 0xFF, 0xFF, 0x1, 0xFF, 0xFF, 0x00, 0x00},
  19. {7, 6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00},
  20. {31, 18, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00},
  21. {63, 13, 31, 0xFF, 0xFF, 0xFF, 0x1, 0xFF, 0xFF, 0x00, 0x00},
  22. {15, 7, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00},
  23. {15, 10, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00},
  24. };
  25. static struct port_params rx_frame_params_dsd[SWR_MSTR_PORT_LEN] = {
  26. {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1, 0x00, 0x00},
  27. {31, 0, 0, 3, 6, 7, 0, 0xFF, 0, 0x00, 0x00},
  28. {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0, 0x00, 0x00},
  29. {7, 9, 0, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0, 0x00, 0x00},
  30. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 3, 0, 0x00, 0x00},
  31. };
  32. /* Headset + PCM Haptics */
  33. static struct port_params rx_frame_params_default[SWR_MSTR_PORT_LEN] = {
  34. {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1, 0x00, 0x00}, /* HPH/EAR */
  35. {31, 0, 0, 3, 6, 7, 0, 0xFF, 0, 0x00, 0x00}, /* HPH_CLH */
  36. {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0, 0x00, 0x00}, /* HPH_CMP */
  37. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* LO/AUX */
  38. {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0x00, 0x00}, /* DSD */
  39. {0x18F, 0, 0, 0x8, 0x8, 0x0F, 0x00, 0, 0, 0x00, 0x01}, /* PCM_OUT */
  40. };
  41. /* Headset(44.1K) + PCM Haptics */
  42. static struct port_params rx_frame_params_44p1KHz[SWR_MSTR_PORT_LEN] = {
  43. {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1, 0x00, 0x00}, /* HPH/EAR */
  44. {63, 0, 0, 3, 6, 7, 0, 0xFF, 0, 0x00, 0x00}, /* HPH_CLH */
  45. {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0, 0x00, 0x00}, /* HPH_CMP */
  46. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0, 0x00, 0x00}, /* LO/AUX */
  47. {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0x00, 0x00}, /* DSD */
  48. {0x1FF, 0, 0, 0x8, 0x8, 0x0F, 0, 0, 0, 0x00, 0x01}, /* PCM_OUT */
  49. };
  50. static struct swr_mstr_port_map sm_port_map[] = {
  51. {RX_MACRO, SWR_UC0, rx_frame_params_default},
  52. {RX_MACRO, SWR_UC1, rx_frame_params_dsd},
  53. {RX_MACRO, SWR_UC2, rx_frame_params_44p1KHz},
  54. {WSA_MACRO, SWR_UC0, wsa_frame_params_default},
  55. };
  56. static struct swr_mstr_port_map sm_port_map_shima[] = {
  57. {RX_MACRO, SWR_UC0, rx_frame_params_default},
  58. {RX_MACRO, SWR_UC1, rx_frame_params_dsd},
  59. {RX_MACRO, SWR_UC2, rx_frame_params_44p1KHz},
  60. {WSA_MACRO, SWR_UC0, wsa_frame_params_default},
  61. };
  62. #endif /* _LAHAINA_PORT_CONFIG */