blob: 38383e0222116068f48367e16fe6ca4440f1ed0b [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
19extern const u8 tabla_reg_readable[TABLA_CACHE_SIZE];
20extern const u8 tabla_reg_defaults[TABLA_CACHE_SIZE];
21
22enum tabla_micbias_num {
23 TABLA_MICBIAS1,
24 TABLA_MICBIAS2,
25 TABLA_MICBIAS3,
26 TABLA_MICBIAS4,
27};
28
29enum 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
36struct 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
47extern int tabla_hs_detect(struct snd_soc_codec *codec,
Bradley Rubincb1e2732011-06-23 16:49:20 -070048 struct snd_soc_jack *headset_jack, struct snd_soc_jack *button_jack,
49 struct tabla_mbhc_calibration *calibration);
Bradley Rubina7096d02011-08-03 18:29:02 -070050
51struct anc_header {
52 u32 reserved[3];
53 u32 num_anc_slots;
54};