tas5720.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * tas5720.h - ALSA SoC Texas Instruments TAS5720 Mono Audio Amplifier
  3. *
  4. * Copyright (C)2015-2016 Texas Instruments Incorporated - http://www.ti.com
  5. *
  6. * Author: Andreas Dannenberg <dannenberg@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __TAS5720_H__
  18. #define __TAS5720_H__
  19. /* Register Address Map */
  20. #define TAS5720_DEVICE_ID_REG 0x00
  21. #define TAS5720_POWER_CTRL_REG 0x01
  22. #define TAS5720_DIGITAL_CTRL1_REG 0x02
  23. #define TAS5720_DIGITAL_CTRL2_REG 0x03
  24. #define TAS5720_VOLUME_CTRL_REG 0x04
  25. #define TAS5720_ANALOG_CTRL_REG 0x06
  26. #define TAS5720_FAULT_REG 0x08
  27. #define TAS5720_DIGITAL_CLIP2_REG 0x10
  28. #define TAS5720_DIGITAL_CLIP1_REG 0x11
  29. #define TAS5720_MAX_REG TAS5720_DIGITAL_CLIP1_REG
  30. /* TAS5720_DEVICE_ID_REG */
  31. #define TAS5720_DEVICE_ID 0x01
  32. /* TAS5720_POWER_CTRL_REG */
  33. #define TAS5720_DIG_CLIP_MASK GENMASK(7, 2)
  34. #define TAS5720_SLEEP BIT(1)
  35. #define TAS5720_SDZ BIT(0)
  36. /* TAS5720_DIGITAL_CTRL1_REG */
  37. #define TAS5720_HPF_BYPASS BIT(7)
  38. #define TAS5720_TDM_CFG_SRC BIT(6)
  39. #define TAS5720_SSZ_DS BIT(3)
  40. #define TAS5720_SAIF_RIGHTJ_24BIT (0x0)
  41. #define TAS5720_SAIF_RIGHTJ_20BIT (0x1)
  42. #define TAS5720_SAIF_RIGHTJ_18BIT (0x2)
  43. #define TAS5720_SAIF_RIGHTJ_16BIT (0x3)
  44. #define TAS5720_SAIF_I2S (0x4)
  45. #define TAS5720_SAIF_LEFTJ (0x5)
  46. #define TAS5720_SAIF_FORMAT_MASK GENMASK(2, 0)
  47. /* TAS5720_DIGITAL_CTRL2_REG */
  48. #define TAS5720_MUTE BIT(4)
  49. #define TAS5720_TDM_SLOT_SEL_MASK GENMASK(2, 0)
  50. /* TAS5720_ANALOG_CTRL_REG */
  51. #define TAS5720_PWM_RATE_6_3_FSYNC (0x0 << 4)
  52. #define TAS5720_PWM_RATE_8_4_FSYNC (0x1 << 4)
  53. #define TAS5720_PWM_RATE_10_5_FSYNC (0x2 << 4)
  54. #define TAS5720_PWM_RATE_12_6_FSYNC (0x3 << 4)
  55. #define TAS5720_PWM_RATE_14_7_FSYNC (0x4 << 4)
  56. #define TAS5720_PWM_RATE_16_8_FSYNC (0x5 << 4)
  57. #define TAS5720_PWM_RATE_20_10_FSYNC (0x6 << 4)
  58. #define TAS5720_PWM_RATE_24_12_FSYNC (0x7 << 4)
  59. #define TAS5720_PWM_RATE_MASK GENMASK(6, 4)
  60. #define TAS5720_ANALOG_GAIN_19_2DBV (0x0 << 2)
  61. #define TAS5720_ANALOG_GAIN_20_7DBV (0x1 << 2)
  62. #define TAS5720_ANALOG_GAIN_23_5DBV (0x2 << 2)
  63. #define TAS5720_ANALOG_GAIN_26_3DBV (0x3 << 2)
  64. #define TAS5720_ANALOG_GAIN_MASK GENMASK(3, 2)
  65. #define TAS5720_ANALOG_GAIN_SHIFT (0x2)
  66. /* TAS5720_FAULT_REG */
  67. #define TAS5720_OC_THRESH_100PCT (0x0 << 4)
  68. #define TAS5720_OC_THRESH_75PCT (0x1 << 4)
  69. #define TAS5720_OC_THRESH_50PCT (0x2 << 4)
  70. #define TAS5720_OC_THRESH_25PCT (0x3 << 4)
  71. #define TAS5720_OC_THRESH_MASK GENMASK(5, 4)
  72. #define TAS5720_CLKE BIT(3)
  73. #define TAS5720_OCE BIT(2)
  74. #define TAS5720_DCE BIT(1)
  75. #define TAS5720_OTE BIT(0)
  76. #define TAS5720_FAULT_MASK GENMASK(3, 0)
  77. /* TAS5720_DIGITAL_CLIP1_REG */
  78. #define TAS5720_CLIP1_MASK GENMASK(7, 2)
  79. #define TAS5720_CLIP1_SHIFT (0x2)
  80. #endif /* __TAS5720_H__ */