diff options
author | Vinod Koul <vinod.koul@intel.com> | 2011-02-09 11:14:34 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 17:32:53 -0500 |
commit | 36633237be60c0ec88b11e00d5fa22a305563d03 (patch) | |
tree | 1b2ae4b31f9cd19947e13f7225a67128da66be94 /sound/soc/codecs/sn95031.h | |
parent | 42aee9b43e76645cda59bce30a101e7574ce913e (diff) |
ASoC: sn95031: Add support for reading mic bias
This patch adds support to read the mic bias voltage
when a jack is inserted. It uses ADC to measure.
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/sn95031.h')
-rw-r--r-- | sound/soc/codecs/sn95031.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/codecs/sn95031.h b/sound/soc/codecs/sn95031.h index 2dbae614bac2..20376d234fb8 100644 --- a/sound/soc/codecs/sn95031.h +++ b/sound/soc/codecs/sn95031.h | |||
@@ -96,7 +96,31 @@ | |||
96 | #define SN95031_SSR5 0x384 | 96 | #define SN95031_SSR5 0x384 |
97 | #define SN95031_SSR6 0x385 | 97 | #define SN95031_SSR6 0x385 |
98 | 98 | ||
99 | /* ADC registers */ | ||
100 | |||
101 | #define SN95031_ADC1CNTL1 0x1C0 | ||
102 | #define SN95031_ADC_ENBL 0x10 | ||
103 | #define SN95031_ADC_START 0x08 | ||
104 | #define SN95031_ADC1CNTL3 0x1C2 | ||
105 | #define SN95031_ADCTHERM_ENBL 0x04 | ||
106 | #define SN95031_ADCRRDATA_ENBL 0x05 | ||
107 | #define SN95031_STOPBIT_MASK 16 | ||
108 | #define SN95031_ADCTHERM_MASK 4 | ||
109 | #define SN95031_ADC_CHANLS_MAX 15 /* Number of ADC channels */ | ||
110 | #define SN95031_ADC_LOOP_MAX (SN95031_ADC_CHANLS_MAX - 1) | ||
111 | #define SN95031_ADC_NO_LOOP 0x07 | ||
99 | #define SN95031_AUDIO_GPIO_CTRL 0x070 | 112 | #define SN95031_AUDIO_GPIO_CTRL 0x070 |
113 | |||
114 | /* ADC channel code values */ | ||
115 | #define SN95031_AUDIO_DETECT_CODE 0x06 | ||
116 | |||
117 | /* ADC base addresses */ | ||
118 | #define SN95031_ADC_CHNL_START_ADDR 0x1C5 /* increments by 1 */ | ||
119 | #define SN95031_ADC_DATA_START_ADDR 0x1D4 /* increments by 2 */ | ||
120 | /* multipier to convert to mV */ | ||
121 | #define SN95031_ADC_ONE_LSB_MULTIPLIER 2346 | ||
122 | |||
123 | |||
100 | struct mfld_jack_data { | 124 | struct mfld_jack_data { |
101 | int intr_id; | 125 | int intr_id; |
102 | int micbias_vol; | 126 | int micbias_vol; |