aiu.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
  2. /*
  3. * Copyright (c) 2018 BayLibre, SAS.
  4. * Author: Jerome Brunet <jbrunet@baylibre.com>
  5. */
  6. #ifndef _MESON_AIU_H
  7. #define _MESON_AIU_H
  8. struct clk;
  9. struct clk_bulk_data;
  10. struct device;
  11. struct of_phandle_args;
  12. struct snd_soc_dai;
  13. struct snd_soc_dai_ops;
  14. enum aiu_clk_ids {
  15. PCLK = 0,
  16. AOCLK,
  17. MCLK,
  18. MIXER
  19. };
  20. struct aiu_interface {
  21. struct clk_bulk_data *clks;
  22. unsigned int clk_num;
  23. int irq;
  24. };
  25. struct aiu_platform_data {
  26. bool has_acodec;
  27. bool has_clk_ctrl_more_i2s_div;
  28. };
  29. struct aiu {
  30. struct clk *pclk;
  31. struct clk *spdif_mclk;
  32. struct aiu_interface i2s;
  33. struct aiu_interface spdif;
  34. const struct aiu_platform_data *platform;
  35. };
  36. #define AIU_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
  37. SNDRV_PCM_FMTBIT_S20_LE | \
  38. SNDRV_PCM_FMTBIT_S24_LE)
  39. int aiu_of_xlate_dai_name(struct snd_soc_component *component,
  40. struct of_phandle_args *args,
  41. const char **dai_name,
  42. unsigned int component_id);
  43. int aiu_hdmi_ctrl_register_component(struct device *dev);
  44. int aiu_acodec_ctrl_register_component(struct device *dev);
  45. int aiu_fifo_i2s_dai_probe(struct snd_soc_dai *dai);
  46. int aiu_fifo_spdif_dai_probe(struct snd_soc_dai *dai);
  47. extern const struct snd_soc_dai_ops aiu_fifo_i2s_dai_ops;
  48. extern const struct snd_soc_dai_ops aiu_fifo_spdif_dai_ops;
  49. extern const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops;
  50. extern const struct snd_soc_dai_ops aiu_encoder_spdif_dai_ops;
  51. #define AIU_IEC958_BPF 0x000
  52. #define AIU_958_MISC 0x010
  53. #define AIU_IEC958_DCU_FF_CTRL 0x01c
  54. #define AIU_958_CHSTAT_L0 0x020
  55. #define AIU_958_CHSTAT_L1 0x024
  56. #define AIU_958_CTRL 0x028
  57. #define AIU_I2S_SOURCE_DESC 0x034
  58. #define AIU_I2S_DAC_CFG 0x040
  59. #define AIU_I2S_SYNC 0x044
  60. #define AIU_I2S_MISC 0x048
  61. #define AIU_RST_SOFT 0x054
  62. #define AIU_CLK_CTRL 0x058
  63. #define AIU_CLK_CTRL_MORE 0x064
  64. #define AIU_CODEC_DAC_LRCLK_CTRL 0x0a0
  65. #define AIU_HDMI_CLK_DATA_CTRL 0x0a8
  66. #define AIU_ACODEC_CTRL 0x0b0
  67. #define AIU_958_CHSTAT_R0 0x0c0
  68. #define AIU_958_CHSTAT_R1 0x0c4
  69. #define AIU_MEM_I2S_START 0x180
  70. #define AIU_MEM_I2S_MASKS 0x18c
  71. #define AIU_MEM_I2S_CONTROL 0x190
  72. #define AIU_MEM_IEC958_START 0x194
  73. #define AIU_MEM_IEC958_CONTROL 0x1a4
  74. #define AIU_MEM_I2S_BUF_CNTL 0x1d8
  75. #define AIU_MEM_IEC958_BUF_CNTL 0x1fc
  76. #endif /* _MESON_AIU_H */