ad73311.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * File: sound/soc/codec/ad73311.h
  4. * Based on:
  5. * Author: Cliff Cai <cliff.cai@analog.com>
  6. *
  7. * Created: Thur Sep 25, 2008
  8. * Description: definitions for AD73311 registers
  9. *
  10. * Modified:
  11. * Copyright 2006 Analog Devices Inc.
  12. *
  13. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  14. */
  15. #ifndef __AD73311_H__
  16. #define __AD73311_H__
  17. #define AD_CONTROL 0x8000
  18. #define AD_DATA 0x0000
  19. #define AD_READ 0x4000
  20. #define AD_WRITE 0x0000
  21. /* Control register A */
  22. #define CTRL_REG_A (0 << 8)
  23. #define REGA_MODE_PRO 0x00
  24. #define REGA_MODE_DATA 0x01
  25. #define REGA_MODE_MIXED 0x03
  26. #define REGA_DLB 0x04
  27. #define REGA_SLB 0x08
  28. #define REGA_DEVC(x) ((x & 0x7) << 4)
  29. #define REGA_RESET 0x80
  30. /* Control register B */
  31. #define CTRL_REG_B (1 << 8)
  32. #define REGB_DIRATE(x) (x & 0x3)
  33. #define REGB_SCDIV(x) ((x & 0x3) << 2)
  34. #define REGB_MCDIV(x) ((x & 0x7) << 4)
  35. #define REGB_CEE (1 << 7)
  36. /* Control register C */
  37. #define CTRL_REG_C (2 << 8)
  38. #define REGC_PUDEV (1 << 0)
  39. #define REGC_PUADC (1 << 3)
  40. #define REGC_PUDAC (1 << 4)
  41. #define REGC_PUREF (1 << 5)
  42. #define REGC_REFUSE (1 << 6)
  43. /* Control register D */
  44. #define CTRL_REG_D (3 << 8)
  45. #define REGD_IGS(x) (x & 0x7)
  46. #define REGD_RMOD (1 << 3)
  47. #define REGD_OGS(x) ((x & 0x7) << 4)
  48. #define REGD_MUTE (1 << 7)
  49. /* Control register E */
  50. #define CTRL_REG_E (4 << 8)
  51. #define REGE_DA(x) (x & 0x1f)
  52. #define REGE_IBYP (1 << 5)
  53. /* Control register F */
  54. #define CTRL_REG_F (5 << 8)
  55. #define REGF_SEEN (1 << 5)
  56. #define REGF_INV (1 << 6)
  57. #define REGF_ALB (1 << 7)
  58. #endif