1
2
3
4
5
6
7
8 #ifndef _ARIZONA_PDATA_H
9 #define _ARIZONA_PDATA_H
10
11 #include <dt-bindings/mfd/arizona.h>
12 #include <linux/regulator/arizona-ldo1.h>
13 #include <linux/regulator/arizona-micsupp.h>
14
15 #define ARIZONA_GPN_DIR_MASK 0x8000
16 #define ARIZONA_GPN_DIR_SHIFT 15
17 #define ARIZONA_GPN_DIR_WIDTH 1
18 #define ARIZONA_GPN_PU_MASK 0x4000
19 #define ARIZONA_GPN_PU_SHIFT 14
20 #define ARIZONA_GPN_PU_WIDTH 1
21 #define ARIZONA_GPN_PD_MASK 0x2000
22 #define ARIZONA_GPN_PD_SHIFT 13
23 #define ARIZONA_GPN_PD_WIDTH 1
24 #define ARIZONA_GPN_LVL_MASK 0x0800
25 #define ARIZONA_GPN_LVL_SHIFT 11
26 #define ARIZONA_GPN_LVL_WIDTH 1
27 #define ARIZONA_GPN_POL_MASK 0x0400
28 #define ARIZONA_GPN_POL_SHIFT 10
29 #define ARIZONA_GPN_POL_WIDTH 1
30 #define ARIZONA_GPN_OP_CFG_MASK 0x0200
31 #define ARIZONA_GPN_OP_CFG_SHIFT 9
32 #define ARIZONA_GPN_OP_CFG_WIDTH 1
33 #define ARIZONA_GPN_DB_MASK 0x0100
34 #define ARIZONA_GPN_DB_SHIFT 8
35 #define ARIZONA_GPN_DB_WIDTH 1
36 #define ARIZONA_GPN_FN_MASK 0x007F
37 #define ARIZONA_GPN_FN_SHIFT 0
38 #define ARIZONA_GPN_FN_WIDTH 7
39
40 #define ARIZONA_MAX_GPIO 5
41
42 #define ARIZONA_MAX_INPUT 4
43
44 #define ARIZONA_MAX_MICBIAS 3
45
46 #define ARIZONA_MAX_OUTPUT 6
47
48 #define ARIZONA_MAX_AIF 3
49
50 #define ARIZONA_HAP_ACT_ERM 0
51 #define ARIZONA_HAP_ACT_LRA 2
52
53 #define ARIZONA_MAX_PDM_SPK 2
54
55 struct regulator_init_data;
56 struct gpio_desc;
57
58 struct arizona_micbias {
59 int mV;
60 unsigned int ext_cap:1;
61 unsigned int discharge:1;
62 unsigned int soft_start:1;
63 unsigned int bypass:1;
64 };
65
66 struct arizona_micd_config {
67 unsigned int src;
68 unsigned int bias;
69 bool gpio;
70 };
71
72 struct arizona_micd_range {
73 int max;
74 int key;
75 };
76
77 struct arizona_pdata {
78 struct gpio_desc *reset;
79
80
81 struct arizona_micsupp_pdata micvdd;
82
83
84 struct arizona_ldo1_pdata ldo1;
85
86
87 int clk32k_src;
88
89
90 unsigned int irq_flags;
91
92
93 int gpio_base;
94
95
96 unsigned int gpio_defaults[ARIZONA_MAX_GPIO];
97
98
99
100
101
102
103 unsigned int max_channels_clocked[ARIZONA_MAX_AIF];
104
105
106 bool jd_gpio5;
107
108
109 bool jd_gpio5_nopull;
110
111
112 bool jd_invert;
113
114
115 bool hpdet_acc_id;
116
117
118 bool hpdet_acc_id_line;
119
120
121 int hpdet_id_gpio;
122
123
124 unsigned int hpdet_channel;
125
126
127 bool micd_software_compare;
128
129
130 unsigned int micd_detect_debounce;
131
132
133 int micd_pol_gpio;
134
135
136 unsigned int micd_bias_start_time;
137
138
139 unsigned int micd_rate;
140
141
142 unsigned int micd_dbtime;
143
144
145 unsigned int micd_timeout;
146
147
148 bool micd_force_micbias;
149
150
151 const struct arizona_micd_range *micd_ranges;
152 int num_micd_ranges;
153
154
155 struct arizona_micd_config *micd_configs;
156 int num_micd_configs;
157
158
159 int dmic_ref[ARIZONA_MAX_INPUT];
160
161
162 struct arizona_micbias micbias[ARIZONA_MAX_MICBIAS];
163
164
165
166
167
168
169
170 int inmode[ARIZONA_MAX_INPUT];
171
172
173 int out_mono[ARIZONA_MAX_OUTPUT];
174
175
176 unsigned int out_vol_limit[2 * ARIZONA_MAX_OUTPUT];
177
178
179 unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
180
181
182 unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK];
183
184
185 unsigned int hap_act;
186
187
188 int irq_gpio;
189
190
191 unsigned int gpsw;
192 };
193
194 #endif