rt1316-sdw.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * rt1316-sdw.h -- RT1316 SDCA ALSA SoC audio driver header
  4. *
  5. * Copyright(c) 2021 Realtek Semiconductor Corp.
  6. */
  7. #ifndef __RT1316_SDW_H__
  8. #define __RT1316_SDW_H__
  9. #include <linux/regmap.h>
  10. #include <linux/soundwire/sdw.h>
  11. #include <linux/soundwire/sdw_type.h>
  12. #include <linux/soundwire/sdw_registers.h>
  13. #include <sound/soc.h>
  14. /* RT1316 SDCA Control - function number */
  15. #define FUNC_NUM_SMART_AMP 0x04
  16. /* RT1316 SDCA entity */
  17. #define RT1316_SDCA_ENT_PDE23 0x31
  18. #define RT1316_SDCA_ENT_PDE27 0x32
  19. #define RT1316_SDCA_ENT_PDE22 0x33
  20. #define RT1316_SDCA_ENT_PDE24 0x34
  21. #define RT1316_SDCA_ENT_XU24 0x24
  22. #define RT1316_SDCA_ENT_FU21 0x03
  23. #define RT1316_SDCA_ENT_UDMPU21 0x02
  24. /* RT1316 SDCA control */
  25. #define RT1316_SDCA_CTL_SAMPLE_FREQ_INDEX 0x10
  26. #define RT1316_SDCA_CTL_REQ_POWER_STATE 0x01
  27. #define RT1316_SDCA_CTL_BYPASS 0x01
  28. #define RT1316_SDCA_CTL_FU_MUTE 0x01
  29. #define RT1316_SDCA_CTL_FU_VOLUME 0x02
  30. #define RT1316_SDCA_CTL_UDMPU_CLUSTER 0x10
  31. /* RT1316 SDCA channel */
  32. #define CH_L 0x01
  33. #define CH_R 0x02
  34. struct rt1316_sdw_priv {
  35. struct snd_soc_component *component;
  36. struct regmap *regmap;
  37. struct sdw_slave *sdw_slave;
  38. enum sdw_slave_status status;
  39. struct sdw_bus_params params;
  40. bool hw_init;
  41. bool first_hw_init;
  42. };
  43. struct sdw_stream_data {
  44. struct sdw_stream_runtime *sdw_stream;
  45. };
  46. #endif /* __RT1316_SDW_H__ */