summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/sn95031.h
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2011-02-09 17:14:34 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-09 23:32:53 +0100
commit36633237be60c0ec88b11e00d5fa22a305563d03 (patch)
tree1b2ae4b31f9cd19947e13f7225a67128da66be94 /sound/soc/codecs/sn95031.h
parentASoC: mfld_machine: Add support for jack detection (diff)
downloadlinux-36633237be60c0ec88b11e00d5fa22a305563d03.tar.xz
linux-36633237be60c0ec88b11e00d5fa22a305563d03.zip
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.h24
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 @@
#define SN95031_SSR5 0x384
#define SN95031_SSR6 0x385
+/* ADC registers */
+
+#define SN95031_ADC1CNTL1 0x1C0
+#define SN95031_ADC_ENBL 0x10
+#define SN95031_ADC_START 0x08
+#define SN95031_ADC1CNTL3 0x1C2
+#define SN95031_ADCTHERM_ENBL 0x04
+#define SN95031_ADCRRDATA_ENBL 0x05
+#define SN95031_STOPBIT_MASK 16
+#define SN95031_ADCTHERM_MASK 4
+#define SN95031_ADC_CHANLS_MAX 15 /* Number of ADC channels */
+#define SN95031_ADC_LOOP_MAX (SN95031_ADC_CHANLS_MAX - 1)
+#define SN95031_ADC_NO_LOOP 0x07
#define SN95031_AUDIO_GPIO_CTRL 0x070
+
+/* ADC channel code values */
+#define SN95031_AUDIO_DETECT_CODE 0x06
+
+/* ADC base addresses */
+#define SN95031_ADC_CHNL_START_ADDR 0x1C5 /* increments by 1 */
+#define SN95031_ADC_DATA_START_ADDR 0x1D4 /* increments by 2 */
+/* multipier to convert to mV */
+#define SN95031_ADC_ONE_LSB_MULTIPLIER 2346
+
+
struct mfld_jack_data {
int intr_id;
int micbias_vol;