blob: 89a0b9f1c6ee83913a4c8765ea378f63edd835e2 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
Kiran Kandic3b24402012-06-11 00:05:59 -07002 *
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#ifndef WCD9320_H
13#define WCD9320_H
14
15#include <sound/soc.h>
16#include <sound/jack.h>
17#include <linux/mfd/wcd9xxx/wcd9xxx-slimslave.h>
Joonwoo Parka8890262012-10-15 12:04:27 -070018#include "wcd9xxx-mbhc.h"
19#include "wcd9xxx-resmgr.h"
Kiran Kandic3b24402012-06-11 00:05:59 -070020
21#define TAIKO_NUM_REGISTERS 0x400
22#define TAIKO_MAX_REGISTER (TAIKO_NUM_REGISTERS-1)
23#define TAIKO_CACHE_SIZE TAIKO_NUM_REGISTERS
24
25#define TAIKO_REG_VAL(reg, val) {reg, 0, val}
Venkat Sudhira41630a2012-10-27 00:57:31 -070026#define TAIKO_MCLK_ID 0
Kiran Kandic3b24402012-06-11 00:05:59 -070027
Kiran Kandic3b24402012-06-11 00:05:59 -070028extern const u8 taiko_reg_readable[TAIKO_CACHE_SIZE];
Kiran Kandi7b7d2ff2012-09-14 14:52:14 -070029extern const u8 taiko_reset_reg_defaults[TAIKO_CACHE_SIZE];
Joonwoo Parka8890262012-10-15 12:04:27 -070030struct taiko_codec_dai_data {
31 u32 rate;
32 u32 *ch_num;
33 u32 ch_act;
34 u32 ch_tot;
Kiran Kandic3b24402012-06-11 00:05:59 -070035};
36
37enum taiko_pid_current {
38 TAIKO_PID_MIC_2P5_UA,
39 TAIKO_PID_MIC_5_UA,
40 TAIKO_PID_MIC_10_UA,
41 TAIKO_PID_MIC_20_UA,
42};
43
Kiran Kandic3b24402012-06-11 00:05:59 -070044enum taiko_mbhc_analog_pwr_cfg {
45 TAIKO_ANALOG_PWR_COLLAPSED = 0,
46 TAIKO_ANALOG_PWR_ON,
47 TAIKO_NUM_ANALOG_PWR_CONFIGS,
48};
49
Kuirong Wang906ac472012-07-09 12:54:44 -070050/* Number of input and output Slimbus port */
51enum {
52 TAIKO_RX1 = 0,
53 TAIKO_RX2,
54 TAIKO_RX3,
55 TAIKO_RX4,
56 TAIKO_RX5,
57 TAIKO_RX6,
58 TAIKO_RX7,
59 TAIKO_RX8,
60 TAIKO_RX9,
61 TAIKO_RX10,
62 TAIKO_RX11,
63 TAIKO_RX12,
64 TAIKO_RX13,
65 TAIKO_RX_MAX,
66};
67
68enum {
69 TAIKO_TX1 = 0,
70 TAIKO_TX2,
71 TAIKO_TX3,
72 TAIKO_TX4,
73 TAIKO_TX5,
74 TAIKO_TX6,
75 TAIKO_TX7,
76 TAIKO_TX8,
77 TAIKO_TX9,
78 TAIKO_TX10,
79 TAIKO_TX11,
80 TAIKO_TX12,
81 TAIKO_TX13,
82 TAIKO_TX14,
83 TAIKO_TX15,
84 TAIKO_TX16,
85 TAIKO_TX_MAX,
86};
87
Kiran Kandic3b24402012-06-11 00:05:59 -070088struct anc_header {
89 u32 reserved[3];
90 u32 num_anc_slots;
91};
92
93extern int taiko_mclk_enable(struct snd_soc_codec *codec, int mclk_enable,
94 bool dapm);
Joonwoo Parka8890262012-10-15 12:04:27 -070095extern int taiko_hs_detect(struct snd_soc_codec *codec,
96 struct wcd9xxx_mbhc_config *mbhc_cfg);
Kiran Kandic3b24402012-06-11 00:05:59 -070097
98#endif