Go to the documentation of this file.
13 #ifndef _ASOC_ARIZONA_H
14 #define _ASOC_ARIZONA_H
20 #define ARIZONA_CLK_SYSCLK 1
21 #define ARIZONA_CLK_ASYNCCLK 2
22 #define ARIZONA_CLK_OPCLK 3
23 #define ARIZONA_CLK_ASYNC_OPCLK 4
25 #define ARIZONA_CLK_SRC_MCLK1 0x0
26 #define ARIZONA_CLK_SRC_MCLK2 0x1
27 #define ARIZONA_CLK_SRC_FLL1 0x4
28 #define ARIZONA_CLK_SRC_FLL2 0x5
29 #define ARIZONA_CLK_SRC_AIF1BCLK 0x8
30 #define ARIZONA_CLK_SRC_AIF2BCLK 0x9
31 #define ARIZONA_CLK_SRC_AIF3BCLK 0xa
33 #define ARIZONA_FLL_SRC_MCLK1 0
34 #define ARIZONA_FLL_SRC_MCLK2 1
35 #define ARIZONA_FLL_SRC_SLIMCLK 2
36 #define ARIZONA_FLL_SRC_FLL1 3
37 #define ARIZONA_FLL_SRC_FLL2 4
38 #define ARIZONA_FLL_SRC_AIF1BCLK 5
39 #define ARIZONA_FLL_SRC_AIF2BCLK 6
40 #define ARIZONA_FLL_SRC_AIF3BCLK 7
41 #define ARIZONA_FLL_SRC_AIF1LRCLK 8
42 #define ARIZONA_FLL_SRC_AIF2LRCLK 9
43 #define ARIZONA_FLL_SRC_AIF3LRCLK 10
45 #define ARIZONA_MIXER_VOL_MASK 0x00FE
46 #define ARIZONA_MIXER_VOL_SHIFT 1
47 #define ARIZONA_MIXER_VOL_WIDTH 7
49 #define ARIZONA_MAX_DAI 3
64 #define ARIZONA_NUM_MIXER_INPUTS 75
70 #define ARIZONA_MIXER_CONTROLS(name, base) \
71 SOC_SINGLE_RANGE_TLV(name " Input 1 Volume", base + 1, \
72 ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \
74 SOC_SINGLE_RANGE_TLV(name " Input 2 Volume", base + 3, \
75 ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \
77 SOC_SINGLE_RANGE_TLV(name " Input 3 Volume", base + 5, \
78 ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \
80 SOC_SINGLE_RANGE_TLV(name " Input 4 Volume", base + 7, \
81 ARIZONA_MIXER_VOL_SHIFT, 0x20, 0x50, 0, \
84 #define ARIZONA_MUX_ENUM_DECL(name, reg) \
85 SOC_VALUE_ENUM_SINGLE_DECL(name, reg, 0, 0xff, \
86 arizona_mixer_texts, arizona_mixer_values)
88 #define ARIZONA_MUX_CTL_DECL(name) \
89 const struct snd_kcontrol_new name##_mux = \
90 SOC_DAPM_VALUE_ENUM("Route", name##_enum)
92 #define ARIZONA_MIXER_ENUMS(name, base_reg) \
93 static ARIZONA_MUX_ENUM_DECL(name##_in1_enum, base_reg); \
94 static ARIZONA_MUX_ENUM_DECL(name##_in2_enum, base_reg + 2); \
95 static ARIZONA_MUX_ENUM_DECL(name##_in3_enum, base_reg + 4); \
96 static ARIZONA_MUX_ENUM_DECL(name##_in4_enum, base_reg + 6); \
97 static ARIZONA_MUX_CTL_DECL(name##_in1); \
98 static ARIZONA_MUX_CTL_DECL(name##_in2); \
99 static ARIZONA_MUX_CTL_DECL(name##_in3); \
100 static ARIZONA_MUX_CTL_DECL(name##_in4)
102 #define ARIZONA_MUX(name, ctrl) \
103 SND_SOC_DAPM_VALUE_MUX(name, SND_SOC_NOPM, 0, 0, ctrl)
105 #define ARIZONA_MIXER_WIDGETS(name, name_str) \
106 ARIZONA_MUX(name_str " Input 1", &name##_in1_mux), \
107 ARIZONA_MUX(name_str " Input 2", &name##_in2_mux), \
108 ARIZONA_MUX(name_str " Input 3", &name##_in3_mux), \
109 ARIZONA_MUX(name_str " Input 4", &name##_in4_mux), \
110 SND_SOC_DAPM_MIXER(name_str " Mixer", SND_SOC_NOPM, 0, 0, NULL, 0)
112 #define ARIZONA_MIXER_ROUTES(widget, name) \
113 { widget, NULL, name " Mixer" }, \
114 { name " Mixer", NULL, name " Input 1" }, \
115 { name " Mixer", NULL, name " Input 2" }, \
116 { name " Mixer", NULL, name " Input 3" }, \
117 { name " Mixer", NULL, name " Input 4" }, \
118 ARIZONA_MIXER_INPUT_ROUTES(name " Input 1"), \
119 ARIZONA_MIXER_INPUT_ROUTES(name " Input 2"), \
120 ARIZONA_MIXER_INPUT_ROUTES(name " Input 3"), \
121 ARIZONA_MIXER_INPUT_ROUTES(name " Input 4")
140 #define ARIZONA_FLL_NAME_LEN 20
155 int lock_irq,
int ok_irq,
struct arizona_fll *fll);
157 unsigned int Fref,
unsigned int Fout);