tpa6130a2.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * ALSA SoC TPA6130A2 amplifier driver
  3. *
  4. * Copyright (C) Nokia Corporation
  5. *
  6. * Author: Peter Ujfalusi <peter.ujfalusi@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. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __TPA6130A2_H__
  24. #define __TPA6130A2_H__
  25. /* Register addresses */
  26. #define TPA6130A2_REG_CONTROL 0x01
  27. #define TPA6130A2_REG_VOL_MUTE 0x02
  28. #define TPA6130A2_REG_OUT_IMPEDANCE 0x03
  29. #define TPA6130A2_REG_VERSION 0x04
  30. #define TPA6130A2_CACHEREGNUM (TPA6130A2_REG_VERSION + 1)
  31. /* Register bits */
  32. /* TPA6130A2_REG_CONTROL (0x01) */
  33. #define TPA6130A2_SWS (0x01 << 0)
  34. #define TPA6130A2_TERMAL (0x01 << 1)
  35. #define TPA6130A2_MODE(x) (x << 4)
  36. #define TPA6130A2_MODE_STEREO (0x00)
  37. #define TPA6130A2_MODE_DUAL_MONO (0x01)
  38. #define TPA6130A2_MODE_BRIDGE (0x02)
  39. #define TPA6130A2_MODE_MASK (0x03)
  40. #define TPA6130A2_HP_EN_R (0x01 << 6)
  41. #define TPA6130A2_HP_EN_L (0x01 << 7)
  42. /* TPA6130A2_REG_VOL_MUTE (0x02) */
  43. #define TPA6130A2_VOLUME(x) ((x & 0x3f) << 0)
  44. #define TPA6130A2_MUTE_R (0x01 << 6)
  45. #define TPA6130A2_MUTE_L (0x01 << 7)
  46. /* TPA6130A2_REG_OUT_IMPEDANCE (0x03) */
  47. #define TPA6130A2_HIZ_R (0x01 << 0)
  48. #define TPA6130A2_HIZ_L (0x01 << 1)
  49. /* TPA6130A2_REG_VERSION (0x04) */
  50. #define TPA6130A2_VERSION_MASK (0x0f)
  51. extern int tpa6130a2_add_controls(struct snd_soc_codec *codec);
  52. extern int tpa6130a2_stereo_enable(struct snd_soc_codec *codec, int enable);
  53. #endif /* __TPA6130A2_H__ */