blob: 681b766eedb335752bee4ea6d089bacb8fc07358 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* 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 Kandi1f6fd722011-08-11 10:36:11 -070019#define TABLA_REG_VAL(reg, val) {reg, 0, val}
20
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070021extern const u8 tabla_reg_readable[TABLA_CACHE_SIZE];
22extern const u8 tabla_reg_defaults[TABLA_CACHE_SIZE];
23
24enum tabla_micbias_num {
25 TABLA_MICBIAS1,
26 TABLA_MICBIAS2,
27 TABLA_MICBIAS3,
28 TABLA_MICBIAS4,
29};
30
31enum 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
38struct 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 Kandi1f6fd722011-08-11 10:36:11 -070049struct tabla_reg_mask_val {
50 u16 reg;
51 u8 mask;
52 u8 val;
53};
54
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055extern int tabla_hs_detect(struct snd_soc_codec *codec,
Bradley Rubincb1e2732011-06-23 16:49:20 -070056 struct snd_soc_jack *headset_jack, struct snd_soc_jack *button_jack,
57 struct tabla_mbhc_calibration *calibration);
Bradley Rubina7096d02011-08-03 18:29:02 -070058
59struct anc_header {
60 u32 reserved[3];
61 u32 num_anc_slots;
62};