Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Kiran Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 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 | #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 Park | a889026 | 2012-10-15 12:04:27 -0700 | [diff] [blame] | 18 | #include "wcd9xxx-mbhc.h" |
| 19 | #include "wcd9xxx-resmgr.h" |
Kiran Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 20 | |
| 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 Sudhir | a41630a | 2012-10-27 00:57:31 -0700 | [diff] [blame] | 26 | #define TAIKO_MCLK_ID 0 |
Kiran Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 27 | |
Kiran Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 28 | extern const u8 taiko_reg_readable[TAIKO_CACHE_SIZE]; |
Kiran Kandi | 7b7d2ff | 2012-09-14 14:52:14 -0700 | [diff] [blame] | 29 | extern const u8 taiko_reset_reg_defaults[TAIKO_CACHE_SIZE]; |
Joonwoo Park | a889026 | 2012-10-15 12:04:27 -0700 | [diff] [blame] | 30 | struct taiko_codec_dai_data { |
| 31 | u32 rate; |
| 32 | u32 *ch_num; |
| 33 | u32 ch_act; |
| 34 | u32 ch_tot; |
Kiran Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | enum 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 Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 44 | enum 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 Wang | 906ac47 | 2012-07-09 12:54:44 -0700 | [diff] [blame] | 50 | /* Number of input and output Slimbus port */ |
| 51 | enum { |
| 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 | |
| 68 | enum { |
| 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 Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 88 | struct anc_header { |
| 89 | u32 reserved[3]; |
| 90 | u32 num_anc_slots; |
| 91 | }; |
| 92 | |
| 93 | extern int taiko_mclk_enable(struct snd_soc_codec *codec, int mclk_enable, |
| 94 | bool dapm); |
Joonwoo Park | a889026 | 2012-10-15 12:04:27 -0700 | [diff] [blame] | 95 | extern int taiko_hs_detect(struct snd_soc_codec *codec, |
| 96 | struct wcd9xxx_mbhc_config *mbhc_cfg); |
Kiran Kandi | c3b2440 | 2012-06-11 00:05:59 -0700 | [diff] [blame] | 97 | |
| 98 | #endif |