88pm860x-codec.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * 88pm860x-codec.h -- 88PM860x ALSA SoC Audio Driver
  3. *
  4. * Copyright 2010 Marvell International Ltd.
  5. * Haojian Zhuang <haojian.zhuang@marvell.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef __88PM860X_H
  12. #define __88PM860X_H
  13. /* The offset of these registers are 0xb0 */
  14. #define PM860X_PCM_IFACE_1 0x00
  15. #define PM860X_PCM_IFACE_2 0x01
  16. #define PM860X_PCM_IFACE_3 0x02
  17. #define PM860X_PCM_RATE 0x03
  18. #define PM860X_EC_PATH 0x04
  19. #define PM860X_SIDETONE_L_GAIN 0x05
  20. #define PM860X_SIDETONE_R_GAIN 0x06
  21. #define PM860X_SIDETONE_SHIFT 0x07
  22. #define PM860X_ADC_OFFSET_1 0x08
  23. #define PM860X_ADC_OFFSET_2 0x09
  24. #define PM860X_DMIC_DELAY 0x0a
  25. #define PM860X_I2S_IFACE_1 0x0b
  26. #define PM860X_I2S_IFACE_2 0x0c
  27. #define PM860X_I2S_IFACE_3 0x0d
  28. #define PM860X_I2S_IFACE_4 0x0e
  29. #define PM860X_EQUALIZER_N0_1 0x0f
  30. #define PM860X_EQUALIZER_N0_2 0x10
  31. #define PM860X_EQUALIZER_N1_1 0x11
  32. #define PM860X_EQUALIZER_N1_2 0x12
  33. #define PM860X_EQUALIZER_D1_1 0x13
  34. #define PM860X_EQUALIZER_D1_2 0x14
  35. #define PM860X_LOFI_GAIN_LEFT 0x15
  36. #define PM860X_LOFI_GAIN_RIGHT 0x16
  37. #define PM860X_HIFIL_GAIN_LEFT 0x17
  38. #define PM860X_HIFIL_GAIN_RIGHT 0x18
  39. #define PM860X_HIFIR_GAIN_LEFT 0x19
  40. #define PM860X_HIFIR_GAIN_RIGHT 0x1a
  41. #define PM860X_DAC_OFFSET 0x1b
  42. #define PM860X_OFFSET_LEFT_1 0x1c
  43. #define PM860X_OFFSET_LEFT_2 0x1d
  44. #define PM860X_OFFSET_RIGHT_1 0x1e
  45. #define PM860X_OFFSET_RIGHT_2 0x1f
  46. #define PM860X_ADC_ANA_1 0x20
  47. #define PM860X_ADC_ANA_2 0x21
  48. #define PM860X_ADC_ANA_3 0x22
  49. #define PM860X_ADC_ANA_4 0x23
  50. #define PM860X_ANA_TO_ANA 0x24
  51. #define PM860X_HS1_CTRL 0x25
  52. #define PM860X_HS2_CTRL 0x26
  53. #define PM860X_LO1_CTRL 0x27
  54. #define PM860X_LO2_CTRL 0x28
  55. #define PM860X_EAR_CTRL_1 0x29
  56. #define PM860X_EAR_CTRL_2 0x2a
  57. #define PM860X_AUDIO_SUPPLIES_1 0x2b
  58. #define PM860X_AUDIO_SUPPLIES_2 0x2c
  59. #define PM860X_ADC_EN_1 0x2d
  60. #define PM860X_ADC_EN_2 0x2e
  61. #define PM860X_DAC_EN_1 0x2f
  62. #define PM860X_DAC_EN_2 0x31
  63. #define PM860X_AUDIO_CAL_1 0x32
  64. #define PM860X_AUDIO_CAL_2 0x33
  65. #define PM860X_AUDIO_CAL_3 0x34
  66. #define PM860X_AUDIO_CAL_4 0x35
  67. #define PM860X_AUDIO_CAL_5 0x36
  68. #define PM860X_ANA_INPUT_SEL_1 0x37
  69. #define PM860X_ANA_INPUT_SEL_2 0x38
  70. #define PM860X_PCM_IFACE_4 0x39
  71. #define PM860X_I2S_IFACE_5 0x3a
  72. #define PM860X_SHORTS 0x3b
  73. #define PM860X_PLL_ADJ_1 0x3c
  74. #define PM860X_PLL_ADJ_2 0x3d
  75. /* bits definition */
  76. #define PM860X_CLK_DIR_IN 0
  77. #define PM860X_CLK_DIR_OUT 1
  78. #define PM860X_DET_HEADSET (1 << 0)
  79. #define PM860X_DET_MIC (1 << 1)
  80. #define PM860X_DET_HOOK (1 << 2)
  81. #define PM860X_SHORT_HEADSET (1 << 3)
  82. #define PM860X_SHORT_LINEOUT (1 << 4)
  83. #define PM860X_DET_MASK 0x1F
  84. extern int pm860x_hs_jack_detect(struct snd_soc_codec *, struct snd_soc_jack *,
  85. int, int, int, int);
  86. extern int pm860x_mic_jack_detect(struct snd_soc_codec *, struct snd_soc_jack *,
  87. int);
  88. #endif /* __88PM860X_H */