Merge branch develop-3.10
[firefly-linux-kernel-4.4.55.git] / sound / soc / codecs / cx2070x.h
1 /*
2  * ALSA SoC CX2070X Channel codec driver
3  *
4  * Copyright:   (C) 2009/2010 Conexant Systems
5  *
6  * Based on sound/soc/codecs/tlv320aic2x.c by Vladimir Barinov
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12 #ifndef _CX2070X_H
13 #define _CX2070X_H
14
15
16 #define CONFIG_SND_DIGICOLOR_SOC_CHANNEL_VER_4_30F 1
17
18 #ifdef CONFIG_SND_SOC_CNXT_FW_UPDATE
19 #define CONFIG_SND_CX2070X_LOAD_FW 1
20 #endif
21 //#define CONFIG_SND_CX2070X_USE_FW_H 1
22 //#define CONFIG_CNXT_USING_SPI_BUS 1
23
24 #ifdef CONFIG_SND_SOC_CNXT_JACKSENSE
25 #define CONFIG_SND_CX2070X_GPIO_JACKSENSE 1
26 #endif 
27 //#define CONFIG_SND_CX2070X_GPIO_RESET    1
28 #define CONFIG_SND_CXLIFEGUARD 1
29 //#define CONFIG_CXNT_SOFTWOARE_SIMULATION      1
30 #define  DBG_MONITOR_REG  1
31
32 //#define GPIO_HP_JACKSENSE 178 //Tegra 250
33 //.#define JACK_SENSE_GPIO_PIN    178 // Tegra
34 //#define CODEC_RESET_GPIO_PIN   184 //  Tegra
35
36 #define JACK_SENSE_GPIO_PIN   151 //s5pc110 GPH2_5
37 #define CODEC_RESET_GPIO_PIN  157 //s5pc110 reset pin.
38 #define FOR_MID 0
39
40 #if (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) ) && !defined(CONFIG_CNXT_USING_SPI_BUS)
41 #define USING_I2C 1
42 #endif 
43
44 #if defined(CONFIG_SPI_MASTER) && defined(CONFIG_CNXT_USING_SPI_BUS)
45 #define USING_SPI 1
46 #endif 
47
48
49 enum Cx_INPUT_SEL{
50     Cx_INPUT_SEL_BY_GPIO = 0,
51     Cx_INPUT_SEL_MIC,
52     Cx_INPUT_SEL_LINE,
53     Cx_INPUT_SEL_DPORT2,
54 };
55
56 enum Cx_OUTPUT_SEL{
57     Cx_OUTPUT_SEL_BY_GPIO = 0,
58     Cx_OUTPUT_SEL_SPK,
59     Cx_OUTPUT_SEL_LINE,
60     Cx_OUTPUT_SEL_HP,
61     Cx_OUTPUT_SEL_DPORT2,
62 };
63
64 enum {
65         OFF,
66         RCV,
67         SPK_PATH,
68         HP_PATH,
69         HP_NO_MIC,
70         BT,
71         SPK_HP,
72         RING_SPK,
73         RING_HP,
74         RING_HP_NO_MIC,
75         RING_SPK_HP,
76 };
77
78 enum {
79         MIC_OFF,
80         Main_Mic,
81         Hands_Free_Mic,
82         BT_Sco_Mic,
83 };
84
85 #define CX2070X_I2C_DRIVER_NAME "cx2070x-i2c"
86 #define CX2070X_SPI_DRIVER_NAME "cx2070x-spi"
87 #define CX2070X_FIRMWARE_FILENAME "cnxt/cx2070x.fw"
88 #define AUDDRV_VERSION(major0,major1, minor, build ) ((major0)<<24|(major1)<<16| (minor)<<8 |(build))
89
90 #endif