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 | |
Kiran Kandi | 1f6fd72 | 2011-08-11 10:36:11 -0700 | [diff] [blame^] | 19 | #define TABLA_REG_VAL(reg, val) {reg, 0, val} |
| 20 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | extern const u8 tabla_reg_readable[TABLA_CACHE_SIZE]; |
| 22 | extern const u8 tabla_reg_defaults[TABLA_CACHE_SIZE]; |
| 23 | |
| 24 | enum tabla_micbias_num { |
| 25 | TABLA_MICBIAS1, |
| 26 | TABLA_MICBIAS2, |
| 27 | TABLA_MICBIAS3, |
| 28 | TABLA_MICBIAS4, |
| 29 | }; |
| 30 | |
| 31 | enum tabla_pid_current { |
| 32 | TABLA_PID_MIC_2P5_UA, |
| 33 | TABLA_PID_MIC_5_UA, |
| 34 | TABLA_PID_MIC_10_UA, |
| 35 | TABLA_PID_MIC_20_UA, |
| 36 | }; |
| 37 | |
| 38 | struct tabla_mbhc_calibration { |
| 39 | enum tabla_micbias_num bias; |
| 40 | int tldoh; |
| 41 | int bg_fast_settle; |
| 42 | enum tabla_pid_current mic_current; |
| 43 | int mic_pid; |
| 44 | enum tabla_pid_current hph_current; |
| 45 | int setup_plug_removal_delay; |
| 46 | int shutdown_plug_removal; |
| 47 | }; |
| 48 | |
Kiran Kandi | 1f6fd72 | 2011-08-11 10:36:11 -0700 | [diff] [blame^] | 49 | struct tabla_reg_mask_val { |
| 50 | u16 reg; |
| 51 | u8 mask; |
| 52 | u8 val; |
| 53 | }; |
| 54 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 55 | extern int tabla_hs_detect(struct snd_soc_codec *codec, |
Bradley Rubin | cb1e273 | 2011-06-23 16:49:20 -0700 | [diff] [blame] | 56 | struct snd_soc_jack *headset_jack, struct snd_soc_jack *button_jack, |
| 57 | struct tabla_mbhc_calibration *calibration); |
Bradley Rubin | a7096d0 | 2011-08-03 18:29:02 -0700 | [diff] [blame] | 58 | |
| 59 | struct anc_header { |
| 60 | u32 reserved[3]; |
| 61 | u32 num_anc_slots; |
| 62 | }; |