mtk-afe-common.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * mtk_afe_common.h -- Mediatek audio driver common definitions
  3. *
  4. * Copyright (c) 2015 MediaTek Inc.
  5. * Author: Koro Chen <koro.chen@mediatek.com>
  6. * Sascha Hauer <s.hauer@pengutronix.de>
  7. * Hidalgo Huang <hidalgo.huang@mediatek.com>
  8. * Ir Lian <ir.lian@mediatek.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 and
  12. * only version 2 as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. */
  19. #ifndef _MTK_AFE_COMMON_H_
  20. #define _MTK_AFE_COMMON_H_
  21. #include <linux/clk.h>
  22. #include <linux/regmap.h>
  23. enum {
  24. MTK_AFE_MEMIF_DL1,
  25. MTK_AFE_MEMIF_DL2,
  26. MTK_AFE_MEMIF_VUL,
  27. MTK_AFE_MEMIF_DAI,
  28. MTK_AFE_MEMIF_AWB,
  29. MTK_AFE_MEMIF_MOD_DAI,
  30. MTK_AFE_MEMIF_HDMI,
  31. MTK_AFE_MEMIF_NUM,
  32. MTK_AFE_IO_MOD_PCM1 = MTK_AFE_MEMIF_NUM,
  33. MTK_AFE_IO_MOD_PCM2,
  34. MTK_AFE_IO_PMIC,
  35. MTK_AFE_IO_I2S,
  36. MTK_AFE_IO_2ND_I2S,
  37. MTK_AFE_IO_HW_GAIN1,
  38. MTK_AFE_IO_HW_GAIN2,
  39. MTK_AFE_IO_MRG_O,
  40. MTK_AFE_IO_MRG_I,
  41. MTK_AFE_IO_DAIBT,
  42. MTK_AFE_IO_HDMI,
  43. };
  44. enum {
  45. MTK_AFE_IRQ_1,
  46. MTK_AFE_IRQ_2,
  47. MTK_AFE_IRQ_3,
  48. MTK_AFE_IRQ_4,
  49. MTK_AFE_IRQ_5,
  50. MTK_AFE_IRQ_6,
  51. MTK_AFE_IRQ_7,
  52. MTK_AFE_IRQ_8,
  53. MTK_AFE_IRQ_NUM,
  54. };
  55. enum {
  56. MTK_CLK_INFRASYS_AUD,
  57. MTK_CLK_TOP_PDN_AUD,
  58. MTK_CLK_TOP_PDN_AUD_BUS,
  59. MTK_CLK_I2S0_M,
  60. MTK_CLK_I2S1_M,
  61. MTK_CLK_I2S2_M,
  62. MTK_CLK_I2S3_M,
  63. MTK_CLK_I2S3_B,
  64. MTK_CLK_BCK0,
  65. MTK_CLK_BCK1,
  66. MTK_CLK_NUM
  67. };
  68. struct mtk_afe;
  69. struct snd_pcm_substream;
  70. struct mtk_afe_memif_data {
  71. int id;
  72. const char *name;
  73. int reg_ofs_base;
  74. int reg_ofs_cur;
  75. int fs_shift;
  76. int mono_shift;
  77. int enable_shift;
  78. int irq_reg_cnt;
  79. int irq_cnt_shift;
  80. int irq_en_shift;
  81. int irq_fs_shift;
  82. int irq_clr_shift;
  83. };
  84. struct mtk_afe_memif {
  85. unsigned int phys_buf_addr;
  86. int buffer_size;
  87. unsigned int hw_ptr; /* Previous IRQ's HW ptr */
  88. struct snd_pcm_substream *substream;
  89. const struct mtk_afe_memif_data *data;
  90. const struct mtk_afe_irq_data *irqdata;
  91. };
  92. #endif