ad73311.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * File: sound/soc/codec/ad73311.h
  3. * Based on:
  4. * Author: Cliff Cai <cliff.cai@analog.com>
  5. *
  6. * Created: Thur Sep 25, 2008
  7. * Description: definitions for AD73311 registers
  8. *
  9. *
  10. * Modified:
  11. * Copyright 2006 Analog Devices Inc.
  12. *
  13. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, see the file COPYING, or write
  27. * to the Free Software Foundation, Inc.,
  28. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #ifndef __AD73311_H__
  31. #define __AD73311_H__
  32. #define AD_CONTROL 0x8000
  33. #define AD_DATA 0x0000
  34. #define AD_READ 0x4000
  35. #define AD_WRITE 0x0000
  36. /* Control register A */
  37. #define CTRL_REG_A (0 << 8)
  38. #define REGA_MODE_PRO 0x00
  39. #define REGA_MODE_DATA 0x01
  40. #define REGA_MODE_MIXED 0x03
  41. #define REGA_DLB 0x04
  42. #define REGA_SLB 0x08
  43. #define REGA_DEVC(x) ((x & 0x7) << 4)
  44. #define REGA_RESET 0x80
  45. /* Control register B */
  46. #define CTRL_REG_B (1 << 8)
  47. #define REGB_DIRATE(x) (x & 0x3)
  48. #define REGB_SCDIV(x) ((x & 0x3) << 2)
  49. #define REGB_MCDIV(x) ((x & 0x7) << 4)
  50. #define REGB_CEE (1 << 7)
  51. /* Control register C */
  52. #define CTRL_REG_C (2 << 8)
  53. #define REGC_PUDEV (1 << 0)
  54. #define REGC_PUADC (1 << 3)
  55. #define REGC_PUDAC (1 << 4)
  56. #define REGC_PUREF (1 << 5)
  57. #define REGC_REFUSE (1 << 6)
  58. /* Control register D */
  59. #define CTRL_REG_D (3 << 8)
  60. #define REGD_IGS(x) (x & 0x7)
  61. #define REGD_RMOD (1 << 3)
  62. #define REGD_OGS(x) ((x & 0x7) << 4)
  63. #define REGD_MUTE (1 << 7)
  64. /* Control register E */
  65. #define CTRL_REG_E (4 << 8)
  66. #define REGE_DA(x) (x & 0x1f)
  67. #define REGE_IBYP (1 << 5)
  68. /* Control register F */
  69. #define CTRL_REG_F (5 << 8)
  70. #define REGF_SEEN (1 << 5)
  71. #define REGF_INV (1 << 6)
  72. #define REGF_ALB (1 << 7)
  73. #endif