waipio-port-config.h 2.7 KB

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