Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #include <sound/soc.h> |
| 14 | |
| 15 | #define TABLA_NUM_REGISTERS 0x400 |
| 16 | #define TABLA_MAX_REGISTER (TABLA_NUM_REGISTERS-1) |
| 17 | #define TABLA_CACHE_SIZE TABLA_NUM_REGISTERS |
| 18 | |
| 19 | extern const u8 tabla_reg_readable[TABLA_CACHE_SIZE]; |
| 20 | extern const u8 tabla_reg_defaults[TABLA_CACHE_SIZE]; |
| 21 | |
| 22 | enum tabla_micbias_num { |
| 23 | TABLA_MICBIAS1, |
| 24 | TABLA_MICBIAS2, |
| 25 | TABLA_MICBIAS3, |
| 26 | TABLA_MICBIAS4, |
| 27 | }; |
| 28 | |
| 29 | enum tabla_pid_current { |
| 30 | TABLA_PID_MIC_2P5_UA, |
| 31 | TABLA_PID_MIC_5_UA, |
| 32 | TABLA_PID_MIC_10_UA, |
| 33 | TABLA_PID_MIC_20_UA, |
| 34 | }; |
| 35 | |
| 36 | struct tabla_mbhc_calibration { |
| 37 | enum tabla_micbias_num bias; |
| 38 | int tldoh; |
| 39 | int bg_fast_settle; |
| 40 | enum tabla_pid_current mic_current; |
| 41 | int mic_pid; |
| 42 | enum tabla_pid_current hph_current; |
| 43 | int setup_plug_removal_delay; |
| 44 | int shutdown_plug_removal; |
| 45 | }; |
| 46 | |
| 47 | extern int tabla_hs_detect(struct snd_soc_codec *codec, |
| 48 | struct snd_soc_jack *jack, struct tabla_mbhc_calibration *calibration); |