blob: faaf67b10161594c3f82b01a96cf270464ac3194 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * dcl_pmic6326_sw.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file is for PMIC 6326
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 *
62 * removed!
63 * removed!
64 * removed!
65 *
66 * removed!
67 * removed!
68 * removed!
69 *
70 * removed!
71 * removed!
72 * removed!
73 *
74 * removed!
75 * removed!
76 * removed!
77 *
78 * removed!
79 * removed!
80 * removed!
81 *
82 * removed!
83 * removed!
84 * removed!
85 *
86 * removed!
87 * removed!
88 * removed!
89 *
90 * removed!
91 * removed!
92 * removed!
93 *
94 * removed!
95 * removed!
96 * removed!
97 *
98 * removed!
99 * removed!
100 * removed!
101 *
102 *
103 *------------------------------------------------------------------------------
104 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
105 *============================================================================
106 ****************************************************************************/
107
108
109
110#ifndef __DCL_PMU6326_SW_H_STRUCT__
111#define __DCL_PMU6326_SW_H_STRUCT__
112
113#include "dcl_pmic_features.h"
114
115#ifdef PMIC_6326_REG_API
116
117
118/*
119// debug 1
120// Define to keep chaging when assert
121// This flag is only for debug purpose
122//#define DRV_MISC_PMIC_ASSERT_KEEP_CHARGING
123//#define DEBUG_PMIC6326_NO_CHARGER_WATCHDOG_TIMER
124
125
126// debug 2
127// Define to enable PMIC6326 charger watch dog timer kick
128// When enable charger, PMIC6326 will enable a watch dog timer
129// We need to kick the timer periodically, to ontify PMIC6326 that BB is alive
130// If timeout, PMIC6326 will disable charge automatically
131// #### If this is NOT enabled, we will disable the watch dog timer function at boot time
132//#define ENABLE_PMIC_DRIVER_KICK_CHARGER_WATCHDOG_TIMER ==> Move to be activated by BMT charging algorithm, do NOT use this anymore
133*/
134
135
136#define PMIC6326_ECO_1_VERSION 0x01
137#define PMIC6326_ECO_2_VERSION 0x02
138#define PMIC6326_ECO_3_VERSION 0x03
139#define PMIC6326_ECO_4_VERSION 0x04
140
141
142#ifndef PMIC_OLD_STRUCTURE
143#define PMIC_OLD_STRUCTURE
144
145typedef enum
146{
147 AC_CHR=0,
148 USB_CHR
149}chr_type;
150
151// Common PMIC structures
152
153// Charger type
154typedef enum
155{
156 PMIC_AC_CHR=0,
157 PMIC_USB_CHR
158}pmic_chr_type;
159
160typedef enum
161{
162 PMIC_ADPT_AC_CHR=0,
163 PMIC_ADPT_USB_CHR,
164 PMIC_ADPT_AC_NON_STD_CHR,
165 PMIC_ADPT_USB_CHARGING_HOST_CHR,
166 PMIC_ADPT_NO_CHR // Indicate NO charger
167}pmic_adpt_chr_type;
168
169
170typedef enum
171{
172 PMIC_VSIM_1_8=0,
173 PMIC_VSIM_3_0
174}pmic_adpt_vsim_volt;
175
176
177typedef enum
178{
179 PMIC_ADPT_VCAMA_1_5=0,
180 PMIC_ADPT_VCAMA_1_8,
181 PMIC_ADPT_VCAMA_2_5,
182 PMIC_ADPT_VCAMA_2_8
183}pmic_adpt_vcama_volt;
184
185typedef enum
186{
187 PMIC_ADPT_VCAMD_1_3=0,
188 PMIC_ADPT_VCAMD_1_5,
189 PMIC_ADPT_VCAMD_1_8,
190 PMIC_ADPT_VCAMD_2_5,
191 PMIC_ADPT_VCAMD_2_8,
192 PMIC_ADPT_VCAMD_3_0,
193 PMIC_ADPT_VCAMD_3_3
194}pmic_adpt_vcamd_volt;
195
196typedef struct
197{
198 kal_uint32 chr_current;
199 kal_uint32 reg_index;
200}pmic_adpt_chr_curr_reg_idx_entry;
201
202#define PMIC_ADPT_MAX_CHARGE_CURRENT_LEVEL_NUM 16
203typedef struct
204{
205 kal_uint32 chr_current_level_num;
206 pmic_adpt_chr_curr_reg_idx_entry entry_table[PMIC_ADPT_MAX_CHARGE_CURRENT_LEVEL_NUM];
207}pmic_adpt_chr_curr_table;
208
209typedef struct
210{
211 kal_int32 chr_current_offset;
212 kal_uint32 reg_index;
213}pmic_adpt_chr_curr_offset_reg_idx_entry;
214
215#define PMIC_ADPT_MAX_CHARGE_CURRENT_OFFSET_NUM 8
216typedef struct
217{
218 kal_uint32 chr_current_offset_num;
219 pmic_adpt_chr_curr_offset_reg_idx_entry entry_table[PMIC_ADPT_MAX_CHARGE_CURRENT_OFFSET_NUM];
220}pmic_adpt_chr_curr_offset_table;
221
222////////////////////////////////////////////////////////
223
224typedef enum
225{
226 PMIC_ADPT_LDO_CTRL_CONTROLLER = 0,
227 PMIC_ADPT_LDO_CTRL_LDO_CON
228}pmic_adpt_ldo_ctrl_mode_enum;
229
230typedef enum
231{
232 PMIC_ADPT_BL_MODE_0 = 0,
233 PMIC_ADPT_BL_MODE_1,
234 PMIC_ADPT_BL_MODE_2,
235 PMIC_ADPT_BL_MODE_3,
236 PMIC_ADPT_BL_MODE_NUM
237}pmic_adpt_bl_mode_enum;
238
239typedef enum
240{
241 PMIC_ADPT_SPK_MODE_0 = 0,
242 PMIC_ADPT_SPK_MODE_1,
243 PMIC_ADPT_SPK_MODE_2,
244 PMIC_ADPT_SPK_MODE_3,
245 PMIC_ADPT_SPK_MODE_NUM
246}pmic_adpt_spk_mode_enum;
247
248typedef enum
249{
250 PMIC_ADPT_CHARGE_CURRENT_0_MA = 0,
251 PMIC_ADPT_CHARGE_CURRENT_50_MA = 50,
252 PMIC_ADPT_CHARGE_CURRENT_75_MA = 75,
253 PMIC_ADPT_CHARGE_CURRENT_100_MA = 100,
254 PMIC_ADPT_CHARGE_CURRENT_150_MA = 150,
255 PMIC_ADPT_CHARGE_CURRENT_200_MA = 200,
256 PMIC_ADPT_CHARGE_CURRENT_250_MA = 250,
257 PMIC_ADPT_CHARGE_CURRENT_300_MA = 300,
258 PMIC_ADPT_CHARGE_CURRENT_350_MA = 350,
259 PMIC_ADPT_CHARGE_CURRENT_400_MA = 400,
260 PMIC_ADPT_CHARGE_CURRENT_450_MA = 450,
261 PMIC_ADPT_CHARGE_CURRENT_500_MA = 500,
262 PMIC_ADPT_CHARGE_CURRENT_550_MA = 550,
263 PMIC_ADPT_CHARGE_CURRENT_600_MA = 600,
264 PMIC_ADPT_CHARGE_CURRENT_650_MA = 650,
265 PMIC_ADPT_CHARGE_CURRENT_700_MA = 700,
266 PMIC_ADPT_CHARGE_CURRENT_750_MA = 750,
267 PMIC_ADPT_CHARGE_CURRENT_800_MA = 800,
268 PMIC_ADPT_CHARGE_CURRENT_850_MA = 850,
269 PMIC_ADPT_CHARGE_CURRENT_900_MA = 900,
270 PMIC_ADPT_CHARGE_CURRENT_950_MA = 950,
271 PMIC_ADPT_CHARGE_CURRENT_1000_MA = 1000,
272 PMIC_ADPT_CHARGE_CURRENT_1200_MA = 1200,
273 PMIC_ADPT_CHARGE_CURRENT_1500_MA = 1500,
274 PMIC_ADPT_CHARGE_CURRENT_1800_MA = 1800,
275 PMIC_ADPT_CHARGE_CURRENT_2000_MA = 2000,
276 PMIC_ADPT_CHARGE_CURRENT_MAX
277}pmic_adpt_chr_current_enum;
278
279
280
281
282// Unified PMIC voltage data type
283// The unit value is 1uV ==> 1000000 means 1V
284typedef enum
285{
286 PMIC_ADPT_VOLT_00_000000_V = 0,
287 PMIC_ADPT_VOLT_00_100000_V = 100000,
288 PMIC_ADPT_VOLT_00_200000_V = 200000,
289 PMIC_ADPT_VOLT_00_300000_V = 300000,
290 PMIC_ADPT_VOLT_00_400000_V = 400000,
291 PMIC_ADPT_VOLT_00_500000_V = 500000,
292 PMIC_ADPT_VOLT_00_600000_V = 600000,
293 PMIC_ADPT_VOLT_00_700000_V = 700000,
294 PMIC_ADPT_VOLT_00_800000_V = 800000,
295 PMIC_ADPT_VOLT_00_825000_V = 825000,
296 PMIC_ADPT_VOLT_00_850000_V = 850000,
297 PMIC_ADPT_VOLT_00_875000_V = 875000,
298 PMIC_ADPT_VOLT_00_900000_V = 900000,
299 PMIC_ADPT_VOLT_00_925000_V = 925000,
300 PMIC_ADPT_VOLT_00_950000_V = 950000,
301 PMIC_ADPT_VOLT_00_975000_V = 975000,
302 PMIC_ADPT_VOLT_01_000000_V = 1000000,
303 PMIC_ADPT_VOLT_01_025000_V = 1025000,
304 PMIC_ADPT_VOLT_01_050000_V = 1050000,
305 PMIC_ADPT_VOLT_01_075000_V = 1075000,
306 PMIC_ADPT_VOLT_01_100000_V = 1100000,
307 PMIC_ADPT_VOLT_01_125000_V = 1125000,
308 PMIC_ADPT_VOLT_01_150000_V = 1150000,
309 PMIC_ADPT_VOLT_01_175000_V = 1175000,
310 PMIC_ADPT_VOLT_01_200000_V = 1200000,
311 PMIC_ADPT_VOLT_01_225000_V = 1225000,
312 PMIC_ADPT_VOLT_01_250000_V = 1250000,
313 PMIC_ADPT_VOLT_01_275000_V = 1275000,
314 PMIC_ADPT_VOLT_01_300000_V = 1300000,
315 PMIC_ADPT_VOLT_01_325000_V = 1325000,
316 PMIC_ADPT_VOLT_01_350000_V = 1350000,
317 PMIC_ADPT_VOLT_01_375000_V = 1375000,
318 PMIC_ADPT_VOLT_01_400000_V = 1400000,
319 PMIC_ADPT_VOLT_01_425000_V = 1425000,
320 PMIC_ADPT_VOLT_01_450000_V = 1450000,
321 PMIC_ADPT_VOLT_01_475000_V = 1475000,
322 PMIC_ADPT_VOLT_01_500000_V = 1500000,
323 PMIC_ADPT_VOLT_01_525000_V = 1525000,
324 PMIC_ADPT_VOLT_01_550000_V = 1550000,
325 PMIC_ADPT_VOLT_01_575000_V = 1575000,
326 PMIC_ADPT_VOLT_01_600000_V = 1600000,
327 PMIC_ADPT_VOLT_01_625000_V = 1625000,
328 PMIC_ADPT_VOLT_01_650000_V = 1650000,
329 PMIC_ADPT_VOLT_01_675000_V = 1675000,
330 PMIC_ADPT_VOLT_01_700000_V = 1700000,
331 PMIC_ADPT_VOLT_01_725000_V = 1725000,
332 PMIC_ADPT_VOLT_01_750000_V = 1750000,
333 PMIC_ADPT_VOLT_01_775000_V = 1775000,
334 PMIC_ADPT_VOLT_01_800000_V = 1800000,
335 PMIC_ADPT_VOLT_01_825000_V = 1825000,
336 PMIC_ADPT_VOLT_01_850000_V = 1850000,
337 PMIC_ADPT_VOLT_01_875000_V = 1875000,
338 PMIC_ADPT_VOLT_01_900000_V = 1900000,
339 PMIC_ADPT_VOLT_01_925000_V = 1925000,
340 PMIC_ADPT_VOLT_01_950000_V = 1950000,
341 PMIC_ADPT_VOLT_01_975000_V = 1975000,
342 PMIC_ADPT_VOLT_02_000000_V = 2000000,
343 PMIC_ADPT_VOLT_02_500000_V = 2500000,
344 PMIC_ADPT_VOLT_02_750000_V = 2750000,
345 PMIC_ADPT_VOLT_02_800000_V = 2800000,
346 PMIC_ADPT_VOLT_02_850000_V = 2850000,
347 PMIC_ADPT_VOLT_02_900000_V = 2900000,
348 PMIC_ADPT_VOLT_03_000000_V = 3000000,
349 PMIC_ADPT_VOLT_03_100000_V = 3100000,
350 PMIC_ADPT_VOLT_03_250000_V = 3250000,
351 PMIC_ADPT_VOLT_03_275000_V = 3275000,
352 PMIC_ADPT_VOLT_03_300000_V = 3300000,
353 PMIC_ADPT_VOLT_03_325000_V = 3325000,
354 PMIC_ADPT_VOLT_04_000000_V = 4000000,
355 PMIC_ADPT_VOLT_04_012500_V = 4012500,
356 PMIC_ADPT_VOLT_04_025000_V = 4025000,
357 PMIC_ADPT_VOLT_04_037500_V = 4037500,
358 PMIC_ADPT_VOLT_04_050000_V = 4050000,
359 PMIC_ADPT_VOLT_04_062500_V = 4062500,
360 PMIC_ADPT_VOLT_04_067500_V = 4067500,
361 PMIC_ADPT_VOLT_04_075000_V = 4075000,
362 PMIC_ADPT_VOLT_04_087500_V = 4087500,
363 PMIC_ADPT_VOLT_04_100000_V = 4100000,
364 PMIC_ADPT_VOLT_04_112500_V = 4112500,
365 PMIC_ADPT_VOLT_04_116000_V = 4116000,
366 PMIC_ADPT_VOLT_04_125000_V = 4125000,
367 PMIC_ADPT_VOLT_04_137500_V = 4137500,
368 PMIC_ADPT_VOLT_04_150000_V = 4150000,
369 PMIC_ADPT_VOLT_04_162500_V = 4162500,
370 PMIC_ADPT_VOLT_04_175000_V = 4175000,
371 PMIC_ADPT_VOLT_04_187500_V = 4187500,
372 PMIC_ADPT_VOLT_04_200000_V = 4200000,
373 PMIC_ADPT_VOLT_04_212500_V = 4212500,
374 PMIC_ADPT_VOLT_04_225000_V = 4225000,
375 PMIC_ADPT_VOLT_04_237500_V = 4237500,
376 PMIC_ADPT_VOLT_04_250000_V = 4250000,
377 PMIC_ADPT_VOLT_04_262500_V = 4262500,
378 PMIC_ADPT_VOLT_04_275000_V = 4275000,
379 PMIC_ADPT_VOLT_04_287500_V = 4287500,
380 PMIC_ADPT_VOLT_04_300000_V = 4300000,
381 PMIC_ADPT_VOLT_04_325000_V = 4325000,
382 PMIC_ADPT_VOLT_04_350000_V = 4350000,
383 PMIC_ADPT_VOLT_04_375000_V = 4375000,
384 PMIC_ADPT_VOLT_04_400000_V = 4400000,
385 PMIC_ADPT_VOLT_04_411500_V = 4411500,
386 PMIC_ADPT_VOLT_04_450000_V = 4450000,
387 PMIC_ADPT_VOLT_04_500000_V = 4500000,
388 PMIC_ADPT_VOLT_04_550000_V = 4550000,
389 PMIC_ADPT_VOLT_04_600000_V = 4600000,
390 PMIC_ADPT_VOLT_04_800000_V = 4800000,
391 PMIC_ADPT_VOLT_04_950000_V = 4950000,
392 PMIC_ADPT_VOLT_05_150000_V = 5150000,
393 PMIC_ADPT_VOLT_05_250000_V = 5250000,
394 PMIC_ADPT_VOLT_05_000000_V = 5000000,
395 PMIC_ADPT_VOLT_06_000000_V = 6000000,
396 PMIC_ADPT_VOLT_06_500000_V = 6500000,
397 PMIC_ADPT_VOLT_06_750000_V = 6750000,
398 PMIC_ADPT_VOLT_07_000000_V = 7000000,
399 PMIC_ADPT_VOLT_07_250000_V = 7250000,
400 PMIC_ADPT_VOLT_07_500000_V = 7500000,
401 PMIC_ADPT_VOLT_08_000000_V = 8000000,
402 PMIC_ADPT_VOLT_08_500000_V = 8500000,
403 PMIC_ADPT_VOLT_09_500000_V = 9500000,
404 PMIC_ADPT_VOLT_10_000000_V = 10000000,
405
406
407
408 // Backward compatible
409 PMIC_ADPT_VOLT_0_0 = 0,
410 PMIC_ADPT_VOLT_0_1 = 100000,
411 PMIC_ADPT_VOLT_0_2 = 200000,
412 PMIC_ADPT_VOLT_0_3 = 300000,
413 PMIC_ADPT_VOLT_0_4 = 400000,
414 PMIC_ADPT_VOLT_0_5 = 500000,
415 PMIC_ADPT_VOLT_0_6 = 600000,
416 PMIC_ADPT_VOLT_0_7 = 700000,
417 PMIC_ADPT_VOLT_0_8 = 800000,
418 PMIC_ADPT_VOLT_0_9 = 900000,
419 PMIC_ADPT_VOLT_1_0 = 1000000,
420 PMIC_ADPT_VOLT_1_1 = 1100000,
421 PMIC_ADPT_VOLT_1_2 = 1200000,
422 PMIC_ADPT_VOLT_1_3 = 1300000,
423 PMIC_ADPT_VOLT_1_4 = 1400000,
424 PMIC_ADPT_VOLT_1_5 = 1500000,
425 PMIC_ADPT_VOLT_1_6 = 1600000,
426 PMIC_ADPT_VOLT_1_7 = 1700000,
427 PMIC_ADPT_VOLT_1_8 = 1800000,
428 PMIC_ADPT_VOLT_1_9 = 1900000,
429 PMIC_ADPT_VOLT_2_0 = 2000000,
430 PMIC_ADPT_VOLT_2_1 = 2100000,
431 PMIC_ADPT_VOLT_2_2 = 2200000,
432 PMIC_ADPT_VOLT_2_3 = 2300000,
433 PMIC_ADPT_VOLT_2_4 = 2400000,
434 PMIC_ADPT_VOLT_2_5 = 2500000,
435 PMIC_ADPT_VOLT_2_6 = 2600000,
436 PMIC_ADPT_VOLT_2_7 = 2700000,
437 PMIC_ADPT_VOLT_2_8 = 2800000,
438 PMIC_ADPT_VOLT_2_9 = 2900000,
439 PMIC_ADPT_VOLT_3_0 = 3000000,
440 PMIC_ADPT_VOLT_3_1 = 3100000,
441 PMIC_ADPT_VOLT_3_2 = 3200000,
442 PMIC_ADPT_VOLT_3_3 = 3300000,
443 PMIC_ADPT_VOLT_3_4 = 3400000,
444 PMIC_ADPT_VOLT_3_5 = 3500000,
445 PMIC_ADPT_VOLT_3_6 = 3600000,
446 PMIC_ADPT_VOLT_3_7 = 3700000,
447 PMIC_ADPT_VOLT_3_8 = 3800000,
448 PMIC_ADPT_VOLT_3_9 = 3900000,
449 PMIC_ADPT_VOLT_4_0 = 4000000,
450 PMIC_ADPT_VOLT_4_1 = 4100000,
451 PMIC_ADPT_VOLT_4_2 = 4200000,
452 PMIC_ADPT_VOLT_4_3 = 4300000,
453 PMIC_ADPT_VOLT_4_4 = 4400000,
454 PMIC_ADPT_VOLT_4_5 = 4500000,
455 PMIC_ADPT_VOLT_4_6 = 4600000,
456 PMIC_ADPT_VOLT_4_7 = 4700000,
457 PMIC_ADPT_VOLT_4_8 = 4800000,
458 PMIC_ADPT_VOLT_4_9 = 4900000,
459 PMIC_ADPT_VOLT_5_0 = 5000000,
460 PMIC_ADPT_VOLT_5_1 = 5100000,
461 PMIC_ADPT_VOLT_5_2 = 5200000,
462 PMIC_ADPT_VOLT_5_3 = 5300000,
463 PMIC_ADPT_VOLT_5_4 = 5400000,
464 PMIC_ADPT_VOLT_5_5 = 5500000,
465 PMIC_ADPT_VOLT_5_6 = 5600000,
466 PMIC_ADPT_VOLT_5_7 = 5700000,
467 PMIC_ADPT_VOLT_5_8 = 5800000,
468 PMIC_ADPT_VOLT_5_9 = 5900000,
469 PMIC_ADPT_VOLT_6_0 = 6000000,
470 PMIC_ADPT_VOLT_6_1 = 6100000,
471 PMIC_ADPT_VOLT_6_2 = 6200000,
472 PMIC_ADPT_VOLT_6_3 = 6300000,
473 PMIC_ADPT_VOLT_6_4 = 6400000,
474 PMIC_ADPT_VOLT_6_5 = 6500000,
475 PMIC_ADPT_VOLT_6_6 = 6600000,
476 PMIC_ADPT_VOLT_6_7 = 6700000,
477 PMIC_ADPT_VOLT_6_8 = 6800000,
478 PMIC_ADPT_VOLT_6_9 = 6900000,
479 PMIC_ADPT_VOLT_7_0 = 7000000,
480 PMIC_ADPT_VOLT_7_1 = 7100000,
481 PMIC_ADPT_VOLT_7_2 = 7200000,
482 PMIC_ADPT_VOLT_7_3 = 7300000,
483 PMIC_ADPT_VOLT_7_4 = 7400000,
484 PMIC_ADPT_VOLT_7_5 = 7500000,
485 PMIC_ADPT_VOLT_7_6 = 7600000,
486 PMIC_ADPT_VOLT_7_7 = 7700000,
487 PMIC_ADPT_VOLT_7_8 = 7800000,
488 PMIC_ADPT_VOLT_7_9 = 7900000,
489 PMIC_ADPT_VOLT_8_0 = 8000000,
490
491 PMIC_ADPT_VOLT_MAX = 50000000
492
493}pmic_adpt_voltage_enum;
494
495
496// Unified PMIC speaker volume data type
497typedef enum
498{
499 PMIC_ADPT_SPK_VOL_00_00_dB = 0,
500 PMIC_ADPT_SPK_VOL_00_50_dB = 50,
501 PMIC_ADPT_SPK_VOL_01_00_dB = 100,
502 PMIC_ADPT_SPK_VOL_01_50_dB = 150,
503 PMIC_ADPT_SPK_VOL_02_00_dB = 200,
504 PMIC_ADPT_SPK_VOL_02_50_dB = 250,
505 PMIC_ADPT_SPK_VOL_03_00_dB = 300,
506 PMIC_ADPT_SPK_VOL_03_50_dB = 350,
507 PMIC_ADPT_SPK_VOL_04_00_dB = 400,
508 PMIC_ADPT_SPK_VOL_04_50_dB = 450,
509 PMIC_ADPT_SPK_VOL_05_00_dB = 500,
510 PMIC_ADPT_SPK_VOL_05_50_dB = 550,
511 PMIC_ADPT_SPK_VOL_06_00_dB = 600,
512 PMIC_ADPT_SPK_VOL_06_50_dB = 650,
513 PMIC_ADPT_SPK_VOL_07_00_dB = 700,
514 PMIC_ADPT_SPK_VOL_07_50_dB = 750,
515 PMIC_ADPT_SPK_VOL_08_00_dB = 800,
516 PMIC_ADPT_SPK_VOL_08_50_dB = 850,
517 PMIC_ADPT_SPK_VOL_09_00_dB = 900,
518 PMIC_ADPT_SPK_VOL_09_50_dB = 950,
519 PMIC_ADPT_SPK_VOL_10_00_dB = 1000,
520 PMIC_ADPT_SPK_VOL_10_50_dB = 1050,
521 PMIC_ADPT_SPK_VOL_11_00_dB = 1100,
522 PMIC_ADPT_SPK_VOL_11_50_dB = 1150,
523 PMIC_ADPT_SPK_VOL_12_00_dB = 1200,
524 PMIC_ADPT_SPK_VOL_12_50_dB = 1250,
525 PMIC_ADPT_SPK_VOL_13_00_dB = 1300,
526 PMIC_ADPT_SPK_VOL_13_50_dB = 1350,
527 PMIC_ADPT_SPK_VOL_14_00_dB = 1400,
528 PMIC_ADPT_SPK_VOL_14_50_dB = 1450,
529 PMIC_ADPT_SPK_VOL_15_00_dB = 1500,
530 PMIC_ADPT_SPK_VOL_15_50_dB = 1550,
531 PMIC_ADPT_SPK_VOL_16_00_dB = 1600,
532 PMIC_ADPT_SPK_VOL_16_50_dB = 1650,
533 PMIC_ADPT_SPK_VOL_17_00_dB = 1700,
534 PMIC_ADPT_SPK_VOL_17_50_dB = 1750,
535 PMIC_ADPT_SPK_VOL_18_00_dB = 1800,
536 PMIC_ADPT_SPK_VOL_18_50_dB = 1850,
537 PMIC_ADPT_SPK_VOL_19_00_dB = 1900,
538 PMIC_ADPT_SPK_VOL_19_50_dB = 1950,
539 PMIC_ADPT_SPK_VOL_20_00_dB = 2000,
540 PMIC_ADPT_SPK_VOL_20_50_dB = 2050,
541 PMIC_ADPT_SPK_VOL_21_00_dB = 2100,
542 PMIC_ADPT_SPK_VOL_21_50_dB = 2150,
543 PMIC_ADPT_SPK_VOL_22_00_dB = 2200,
544 PMIC_ADPT_SPK_VOL_22_50_dB = 2250,
545 PMIC_ADPT_SPK_VOL_23_00_dB = 2300,
546 PMIC_ADPT_SPK_VOL_23_50_dB = 2350,
547 PMIC_ADPT_SPK_VOL_24_00_dB = 2400,
548 PMIC_ADPT_SPK_VOL_24_50_dB = 2450,
549
550
551 PMIC_ADPT_SPK_VOL_0_dB = 0,
552 PMIC_ADPT_SPK_VOL_1_dB = 100,
553 PMIC_ADPT_SPK_VOL_2_dB = 200,
554 PMIC_ADPT_SPK_VOL_3_dB = 300,
555 PMIC_ADPT_SPK_VOL_4_dB = 400,
556 PMIC_ADPT_SPK_VOL_5_dB = 500,
557 PMIC_ADPT_SPK_VOL_6_dB = 600,
558 PMIC_ADPT_SPK_VOL_7_dB = 700,
559 PMIC_ADPT_SPK_VOL_8_dB = 800,
560 PMIC_ADPT_SPK_VOL_9_dB = 900,
561 PMIC_ADPT_SPK_VOL_10_dB = 1000,
562 PMIC_ADPT_SPK_VOL_11_dB = 1100,
563 PMIC_ADPT_SPK_VOL_12_dB = 1200,
564 PMIC_ADPT_SPK_VOL_13_dB = 1300,
565 PMIC_ADPT_SPK_VOL_14_dB = 1400,
566 PMIC_ADPT_SPK_VOL_15_dB = 1500,
567 PMIC_ADPT_SPK_VOL_16_dB = 1600,
568 PMIC_ADPT_SPK_VOL_17_dB = 1700,
569 PMIC_ADPT_SPK_VOL_18_dB = 1800,
570 PMIC_ADPT_SPK_VOL_19_dB = 1900,
571 PMIC_ADPT_SPK_VOL_20_dB = 2000,
572 PMIC_ADPT_SPK_VOL_21_dB = 2100,
573 PMIC_ADPT_SPK_VOL_22_dB = 2200,
574 PMIC_ADPT_SPK_VOL_23_dB = 2300,
575 PMIC_ADPT_SPK_VOL_24_dB = 2400,
576
577 PMIC_ADPT_SPK_VOL_MAX = 9900
578}pmic_adpt_spk_vol_enum;
579
580#endif //#define PMIC_OLD_STRUCTURE
581
582typedef enum
583{
584 AC_CHR_CALLBACK=0,
585 USB_CHR_CALLBACK
586}chr_callback_type;
587
588typedef struct
589{
590 void (*pmic_ac_det)(void);
591 void (*pmic_usb_det)(void);
592}pmic6326_chrdect_callbac_struct;
593
594
595
596// TTTTTTTTTTTTTTTTT
597// Implemented functions
598
599
600
601// (0x0D) INT STATUS 3 (RO)
602typedef enum
603{
604 VSDIO_OC_STAT = 0x01, // BIT0
605 VGP_OC_STAT = 0x02, // BIT1
606 VUSB_OC_STAT = 0x04, // BIT2
607 OVP_INT_STAT = 0x08, // BIT3
608 CHRDET_INT_STAT = 0x10, // BIT4
609 PWRKEY_INT_STAT = 0x20 // BIT5
610}int_state_3_enum;
611
612
613// (0x1B) LDO CTRL 2 VRF
614typedef enum
615{
616 VRF_BIAS_CURRENT_TIMES_1_0 = 0,
617 VRF_BIAS_CURRENT_TIMES_0_5,
618 VRF_BIAS_CURRENT_TIMES_2_0,
619 VRF_BIAS_CURRENT_TIMES_3_0
620}vrf_ical_en_enum;
621
622// (0x1C) LDO CTRL 3 VRF
623typedef enum
624{
625 VRF_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
626 VRF_MAX_SLEW_RATE_TIMES_1_OVER_21,
627 VRF_MAX_SLEW_RATE,
628 VRF_MAX_SLEW_RATE_TIMES_1_OVER_5
629}vrf_calst_enum;
630typedef enum
631{
632 VRF_OC_THRESHOLD_685MA = 0,
633 VRF_OC_THRESHOLD_635MA,
634 VRF_OC_THRESHOLD_785MA,
635 VRF_OC_THRESHOLD_735MA
636}vrf_caloc_enum;
637
638typedef enum
639{
640 VRF_DEFAULT_MILLER_CAPACITOR = 0,
641 VRF_INCREASE_MILLER_CAPACITOR
642}vrf_cm_enum;
643
644typedef enum
645{
646 VRF_ENABLE_WITH_SRCLKEN = 0,
647 VRF_ENABLE_WITH_VRF_EN
648}vrf_on_sel_enum;
649
650
651// (0x1E) LDO CTRL 5 VTCXO
652typedef enum
653{
654 VTCXO_BIAS_CURRENT_TIMES_1_0 = 0,
655 VTCXO_BIAS_CURRENT_TIMES_0_5,
656 VTCXO_BIAS_CURRENT_TIMES_2_0,
657 VTCXO_BIAS_CURRENT_TIMES_3_0
658}vtcxo_ical_en_enum;
659
660
661// (0x1F) LDO CTRL 6 VTCXO
662typedef enum
663{
664 VTCXO_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
665 VTCXO_MAX_SLEW_RATE_TIMES_1_OVER_21,
666 VTCXO_MAX_SLEW_RATE,
667 VTCXO_MAX_SLEW_RATE_TIMES_1_OVER_5
668}vtcxo_calst_enum;
669typedef enum
670{
671 VTCXO_OC_THRESHOLD_100MA = 0,
672 VTCXO_OC_THRESHOLD_109MA,
673 VTCXO_OC_THRESHOLD_82MA,
674 VTCXO_OC_THRESHOLD_91MA
675}vtcxo_caloc_enum;
676
677typedef enum
678{
679 VTCXO_ENABLE_WITH_SRCLKEN = 0,
680 VTCXO_ENABLE_WITH_VTCXO_EN
681}vtcxo_on_sel_enum;
682
683typedef enum
684{
685 VTCXO_DEFAULT_MILLER_CAPACITOR = 0,
686 VTCXO_INCREASE_MILLER_CAPACITOR
687}vtcxo_cm_enum;
688
689// (0x21) LDO CTRL 8 V3GTX
690typedef enum
691{
692 V3GTX_BIAS_CURRENT_TIMES_1_0 = 0,
693 V3GTX_BIAS_CURRENT_TIMES_0_5,
694 V3GTX_BIAS_CURRENT_TIMES_2_0,
695 V3GTX_BIAS_CURRENT_TIMES_3_0
696}v3gtx_ical_en_enum;
697
698typedef enum
699{
700 V3GTX_2_8=0,
701 V3GTX_3_0,
702 V3GTX_3_3,
703 V3GTX_2_5
704}v3gtx_vol;
705
706
707// (0x22) LDO CTRL 9 V3GTX
708typedef enum
709{
710 V3GTX_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
711 V3GTX_MAX_SLEW_RATE_TIMES_1_OVER_21,
712 V3GTX_MAX_SLEW_RATE,
713 V3GTX_MAX_SLEW_RATE_TIMES_1_OVER_5
714}v3gtx_calst_enum;
715
716typedef enum
717{
718 V3GTX_OC_THRESHOLD_400MA = 0,
719 V3GTX_OC_THRESHOLD_438MA,
720 V3GTX_OC_THRESHOLD_324MA,
721 V3GTX_OC_THRESHOLD_362MA
722}v3gtx_caloc_enum;
723
724typedef enum
725{
726 V3GTX_ENABLE_WITH_SRCLKEN = 0,
727 V3GTX_ENABLE_WITH_V3GTX_EN
728}v3gtx_on_sel_enum;
729
730
731// (0x24) LDO CTRL 11 V3GRX
732typedef enum
733{
734 V3GRX_2_8=0,
735 V3GRX_3_0,
736 V3GRX_3_3,
737 V3GRX_2_5
738}v3grx_vol;
739
740typedef enum
741{
742 V3GRX_BIAS_CURRENT_TIMES_1_0 = 0,
743 V3GRX_BIAS_CURRENT_TIMES_0_5,
744 V3GRX_BIAS_CURRENT_TIMES_2_0,
745 V3GRX_BIAS_CURRENT_TIMES_3_0
746}v3grx_ical_en_enum;
747
748
749// (0x25) LDO CTRL 12 V3GRX
750typedef enum
751{
752 V3GRX_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
753 V3GRX_MAX_SLEW_RATE_TIMES_1_OVER_21,
754 V3GRX_MAX_SLEW_RATE,
755 V3GRX_MAX_SLEW_RATE_TIMES_1_OVER_5
756}v3grx_calst_enum;
757
758typedef enum
759{
760 V3GRX_OC_THRESHOLD_200MA = 0,
761 V3GRX_OC_THRESHOLD_219MA,
762 V3GRX_OC_THRESHOLD_162MA,
763 V3GRX_OC_THRESHOLD_181MA
764}v3grx_caloc_enum;
765
766
767typedef enum
768{
769 V3GRX_ENABLE_WITH_SRCLKEN = 0,
770 V3GRX_ENABLE_WITH_V3GRX_EN
771}v3grx_on_sel_enum;
772
773
774// (0x2E) LDO CTRL 21 VCAMA
775typedef enum
776{
777 VCAMA_2_8 = 0,
778 VCAMA_2_5,
779 VCAMA_1_8,
780 VCAMA_1_5
781}vcama_sel_enum;
782typedef enum
783{
784 VCAMA_BIAS_CURRENT_X_1_0 = 0,
785 VCAMA_BIAS_CURRENT_X_0_5,
786 VCAMA_BIAS_CURRENT_X_2_0,
787 VCAMA_BIAS_CURRENT_X_3_0
788}vcama_ical_en_enum;
789
790// (0x2F) LDO CTRL 22 VCAMA
791typedef enum
792{
793 VCAMA_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
794 VCAMA_MAX_SLEW_RATE_TIMES_1_OVER_21,
795 VCAMA_MAX_SLEW_RATE,
796 VCAMA_MAX_SLEW_RATE_TIMES_1_OVER_5
797}vcama_calst_enum;
798typedef enum
799{
800 VCAMA_OC_THRESHOLD_500MA = 0,
801 VCAMA_OC_THRESHOLD_548MA,
802 VCAMA_OC_THRESHOLD_405MA,
803 VCAMA_OC_THRESHOLD_452MA
804}vcama_caloc_enum;
805
806typedef enum
807{
808 VCAMA_DEFAULT_MILLER_CAPACITOR = 0,
809 VCAMA_INCREASE_MILLER_CAPACITOR
810}vcama_cm_enum;
811
812// (0x31) LDO CTRL 24 VWIFI3V3
813typedef enum
814{
815 VWIFI3V3_2_8 = 0,
816 VWIFI3V3_3_0,
817 VWIFI3V3_3_3,
818 VWIFI3V3_2_5
819}vwifi3v3_sel_enum;
820typedef enum
821{
822 VWIFI3V3_BIAS_CURRENT_X_1_0 = 0,
823 VWIFI3V3_BIAS_CURRENT_X_0_5,
824 VWIFI3V3_BIAS_CURRENT_X_2_0,
825 VWIFI3V3_BIAS_CURRENT_X_3_0
826}vwifi3v3_ical_en_enum;
827
828// (0x32) LDO CTRL 25 VWIFI3V3
829typedef enum
830{
831 VWIFI3V3_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
832 VWIFI3V3_MAX_SLEW_RATE_TIMES_1_OVER_21,
833 VWIFI3V3_MAX_SLEW_RATE,
834 VWIFI3V3_MAX_SLEW_RATE_TIMES_1_OVER_5
835}vwifi3v3_calst_enum;
836typedef enum
837{
838 VWIFI3V3_OC_THRESHOLD_600MA = 0,
839 VWIFI3V3_OC_THRESHOLD_657MA,
840 VWIFI3V3_OC_THRESHOLD_486MA,
841 VWIFI3V3_OC_THRESHOLD_543MA
842}vwifi3v3_caloc_enum;
843
844typedef enum
845{
846 VWIFI3V3_DEFAULT_MILLER_CAPACITOR = 0,
847 VWIFI3V3_INCREASE_MILLER_CAPACITOR
848}vwifi3v3_cm_enum;
849
850// (0x34) LDO CTRL 27 VWIFI2V8
851typedef enum
852{
853 VWIFI2V8_2_8 = 0,
854 VWIFI2V8_3_0,
855 VWIFI2V8_3_3,
856 VWIFI2V8_2_5
857}vwifi2v8_sel_enum;
858typedef enum
859{
860 VWIFI2V8_BIAS_CURRENT_X_1_0 = 0,
861 VWIFI2V8_BIAS_CURRENT_X_0_5,
862 VWIFI2V8_BIAS_CURRENT_X_2_0,
863 VWIFI2V8_BIAS_CURRENT_X_3_0
864}vwifi2v8_ical_en_enum;
865
866// (0x35) LDO CTRL 28 VWIFI2V8
867typedef enum
868{
869 VWIFI2V8_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
870 VWIFI2V8_MAX_SLEW_RATE_TIMES_1_OVER_21,
871 VWIFI2V8_MAX_SLEW_RATE,
872 VWIFI2V8_MAX_SLEW_RATE_TIMES_1_OVER_5
873}vwifi2v8_calst_enum;
874typedef enum
875{
876 VWIFI2V8_OC_THRESHOLD_300MA = 0,
877 VWIFI2V8_OC_THRESHOLD_329MA,
878 VWIFI2V8_OC_THRESHOLD_243MA,
879 VWIFI2V8_OC_THRESHOLD_271MA
880}vwifi2v8_caloc_enum;
881
882typedef enum
883{
884 VWIFI2V8_DEFAULT_MILLER_CAPACITOR = 0,
885 VWIFI2V8_INCREASE_MILLER_CAPACITOR
886}vwifi2v8_cm_enum;
887
888// (0x37) LDO CTRL 30 VSIM
889typedef enum
890{
891 VSIM_1_3V = 0,
892 VSIM_1_5V,
893 VSIM_1_8V,
894 VSIM_2_5V,
895 VSIM_2_8V,
896 VSIM_3_0V,
897 VSIM_3_3V,
898 VSIM_1_2V
899}vsim_sel_enum;
900typedef enum
901{
902 VSIM_BIAS_CURRENT_X_1_0 = 0,
903 VSIM_BIAS_CURRENT_X_0_5,
904 VSIM_BIAS_CURRENT_X_2_0,
905 VSIM_BIAS_CURRENT_X_3_0
906}vsim_ical_en_enum;
907
908// (0x3A) LDO CTRL 33 VUSB
909typedef enum
910{
911 VUSB_1_3 = 0,
912 VUSB_1_5,
913 VUSB_1_8,
914 VUSB_2_5,
915 VUSB_2_8,
916 VUSB_3_0,
917 VUSB_3_3,
918 VUSB_1_2 // TTTTTTTTTTTTTT
919}vusb_sel_enum;
920typedef enum
921{
922 VUSB_BIAS_CURRENT_X_1_0 = 0,
923 VUSB_BIAS_CURRENT_X_0_5,
924 VUSB_BIAS_CURRENT_X_2_0,
925 VUSB_BIAS_CURRENT_X_3_0
926}vusb_ical_en_enum;
927
928// (0x3B) LDO CTRL 34 VUSB
929typedef enum
930{
931 VUSB_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
932 VUSB_MAX_SLEW_RATE_TIMES_1_OVER_21,
933 VUSB_MAX_SLEW_RATE,
934 VUSB_MAX_SLEW_RATE_TIMES_1_OVER_5
935}vusb_calst_enum;
936typedef enum
937{
938 VUSB_OC_THRESHOLD_200MA = 0,
939 VUSB_OC_THRESHOLD_218MA,
940 VUSB_OC_THRESHOLD_164MA,
941 VUSB_OC_THRESHOLD_182MA
942}vusb_caloc_enum;
943
944// (0x3D) LDO CTRL 36 VBT
945typedef enum
946{
947 VBT_1_3 = 0,
948 VBT_1_5,
949 VBT_1_8,
950 VBT_2_5,
951 VBT_2_8,
952 VBT_3_0,
953 VBT_3_3,
954 VBT_1_2 // TTTTTTTTTTTTTT
955}vbt_sel_enum;
956
957typedef enum
958{
959 VBT_E3_1_5 = 0,
960 VBT_E3_1_3,
961 VBT_E3_2_5,
962 VBT_E3_1_8,
963 VBT_E3_3_0,
964 VBT_E3_2_8,
965 VBT_E3_3_3
966 //VBT_E3_3_3
967}vbt_e3_sel_enum;
968
969typedef enum
970{
971 VBT_BIAS_CURRENT_X_1_0 = 0,
972 VBT_BIAS_CURRENT_X_0_5,
973 VBT_BIAS_CURRENT_X_2_0,
974 VBT_BIAS_CURRENT_X_3_0
975}vbt_ical_en_enum;
976
977// (0x3E) LDO CTRL 37 VBT
978typedef enum
979{
980 VBT_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
981 VBT_MAX_SLEW_RATE_TIMES_1_OVER_21,
982 VBT_MAX_SLEW_RATE,
983 VBT_MAX_SLEW_RATE_TIMES_1_OVER_5
984}vbt_calst_enum;
985typedef enum
986{
987 VBT_OC_THRESHOLD_200MA = 0,
988 VBT_OC_THRESHOLD_218MA,
989 VBT_OC_THRESHOLD_164MA,
990 VBT_OC_THRESHOLD_182MA
991}vbt_caloc_enum;
992
993// (0x40) LDO CTRL 39 VCAMD
994typedef enum
995{
996 VCAMD_1_3 = 0,
997 VCAMD_1_5,
998 VCAMD_1_8,
999 VCAMD_2_5,
1000 VCAMD_2_8,
1001 VCAMD_3_0,
1002 VCAMD_3_3,
1003 VCAMD_1_2 // TTTTTTTTTTTTTT
1004}vcamd_sel_enum;
1005typedef enum
1006{
1007 VCAMD_BIAS_CURRENT_X_1_0 = 0,
1008 VCAMD_BIAS_CURRENT_X_0_5,
1009 VCAMD_BIAS_CURRENT_X_2_0,
1010 VCAMD_BIAS_CURRENT_X_3_0
1011}vcamd_ical_en_enum;
1012
1013// (0x41) LDO CTRL 40 VCAMD
1014typedef enum
1015{
1016 VCAMD_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
1017 VCAMD_MAX_SLEW_RATE_TIMES_1_OVER_21,
1018 VCAMD_MAX_SLEW_RATE,
1019 VCAMD_MAX_SLEW_RATE_TIMES_1_OVER_5
1020}vcamd_calst_enum;
1021typedef enum
1022{
1023 VCAMD_OC_THRESHOLD_200MA = 0,
1024 VCAMD_OC_THRESHOLD_218MA,
1025 VCAMD_OC_THRESHOLD_164MA,
1026 VCAMD_OC_THRESHOLD_182MA
1027}vcamd_caloc_enum;
1028
1029// (0x43) LDO CTRL 42 VGP
1030typedef enum
1031{
1032 VGP_1_3 = 0,
1033 VGP_1_5,
1034 VGP_1_8,
1035 VGP_2_5,
1036 VGP_2_8,
1037 VGP_3_0,
1038 VGP_3_3
1039}vgp_sel_enum;
1040
1041// (0x46) LDO CTRL 45 VSDIO
1042typedef enum
1043{
1044 VSDIO_BIAS_CURRENT_X_1_0 = 0,
1045 VSDIO_BIAS_CURRENT_X_0_5,
1046 VSDIO_BIAS_CURRENT_X_2_0,
1047 VSDIO_BIAS_CURRENT_X_3_0
1048}vsdio_ical_en_enum;
1049
1050// (0x47) LDO CTRL 46 VSDIO
1051typedef enum
1052{
1053 VSDIO_MAX_SLEW_RATE_TIMES_1_OVER_17 = 0,
1054 VSDIO_MAX_SLEW_RATE_TIMES_1_OVER_21,
1055 VSDIO_MAX_SLEW_RATE,
1056 VSDIO_MAX_SLEW_RATE_TIMES_1_OVER_5
1057}vsdio_calst_enum;
1058typedef enum
1059{
1060 VSDIO_OC_THRESHOLD_700MA = 0,
1061 VSDIO_OC_THRESHOLD_767MA,
1062 VSDIO_OC_THRESHOLD_567MA,
1063 VSDIO_OC_THRESHOLD_633MA
1064}vsdio_caloc_enum;
1065typedef enum
1066{
1067 VSDIO_2_8 = 0,
1068 VSDIO_3_0
1069}vsdio_sel_enum;
1070typedef enum
1071{
1072 VSDIO_DEFAULT_MILLER_CAPACITOR = 0,
1073 VSDIO_INCREASE_MILLER_CAPACITOR
1074}vsdio_cm_enum;
1075
1076
1077// (0x53) BUCK CTRL 11 VCORE2
1078typedef enum
1079{
1080 VCORE2_ENABLE_WITH_EN_PASS = 0,
1081 VCORE2_ENABLE_WITH_VCORE2_EN
1082}vcore2_on_sel_enum;
1083
1084// (0x5C) BOOST CTRL 1 BOOST1
1085typedef enum
1086{
1087 VBOOST1_VOL_3_20_V = 0,
1088 VBOOST1_VOL_3_35_V,
1089 VBOOST1_VOL_3_50_V,
1090 VBOOST1_VOL_3_65_V,
1091 VBOOST1_VOL_3_80_V,
1092 VBOOST1_VOL_3_95_V,
1093 VBOOST1_VOL_4_10_V,
1094 VBOOST1_VOL_4_25_V,
1095 VBOOST1_VOL_4_40_V,
1096 VBOOST1_VOL_4_55_V,
1097 VBOOST1_VOL_4_70_V,
1098 VBOOST1_VOL_4_85_V,
1099 VBOOST1_VOL_5_00_V,
1100 VBOOST1_VOL_5_15_V,
1101 VBOOST1_VOL_5_30_V,
1102 VBOOST1_VOL_5_45_V
1103}vboost1_tune_enum;
1104
1105// (0x5D) BOOST CTRL 2 BOOST1
1106typedef enum
1107{
1108 BOOST1_SOFT_START_SPEED = 0,
1109 BOOST1_SOFT_START_SPEED_TIMES_2_OVER_3
1110}boost1_soft_st_speed_enum;
1111
1112// (0x5F) BOOST CTRL 4 BOOST2
1113typedef enum
1114{
1115 VBOOST2_VOL_6_00_V = 0,
1116 VBOOST2_VOL_6_75_V,
1117 VBOOST2_VOL_7_50_V,
1118 VBOOST2_VOL_8_25_V,
1119 VBOOST2_VOL_9_00_V,
1120 VBOOST2_VOL_9_75_V,
1121 VBOOST2_VOL_10_05_V,
1122 VBOOST2_VOL_11_25_V,
1123 VBOOST2_VOL_12_00_V,
1124 VBOOST2_VOL_12_75_V,
1125 VBOOST2_VOL_13_50_V,
1126 VBOOST2_VOL_14_25_V,
1127 VBOOST2_VOL_15_00_V,
1128 VBOOST2_VOL_15_75_V,
1129 VBOOST2_VOL_16_50_V,
1130 VBOOST2_VOL_17_25_V
1131}vboost2_tune_enum;
1132
1133typedef enum
1134{
1135 BOOST2_OC_THRESHOLD_5UA = 0,
1136 BOOST2_OC_THRESHOLD_2UA,
1137 BOOST2_OC_THRESHOLD_10UA,
1138 BOOST2_OC_THRESHOLD_7UA
1139}boost2_oc_th_enum;
1140
1141typedef enum
1142{
1143 BOOST2_DIGITAL_DIMING = 0,
1144 BOOST2_ANALOG_DIMING
1145}boost2_dim_source_enum;
1146
1147// (0x61) BOOST CTRL 6 BOOST2 and BOOST
1148typedef enum
1149{
1150 BOOST_MODE_TYPE_I = 0,
1151 BOOST_MODE_TYPE_II,
1152 BOOST_MODE_TYPE_III,
1153 BOOST_MODE_TYPE_IV
1154}boost_mode_sel_enum;
1155
1156// (0x65) DRIVER CTRL 4 FLASH
1157//typedef enum
1158//{
1159// FLASH_CURRENT_0MA=0,
1160// FLASH_CURRENT_50MA,
1161// FLASH_CURRENT_100MA,
1162// FLASH_CURRENT_150MA,
1163// FLASH_CURRENT_200MA,
1164// FLASH_CURRENT_250MA,
1165// FLASH_CURRENT_300MA,
1166// FLASH_CURRENT_350MA,
1167// FLASH_CURRENT_400MA,
1168// FLASH_CURRENT_450MA,
1169// FLASH_CURRENT_500MA,
1170// FLASH_CURRENT_550MA
1171//}flash_i_tune_enum;
1172
1173// (0x68) DRIVER CTRL 7 BL
1174typedef enum
1175{
1176 BL_I_CORSE_TUNE_4MA = 0,
1177 BL_I_CORSE_TUNE_8MA,
1178 BL_I_CORSE_TUNE_12MA,
1179 BL_I_CORSE_TUNE_16MA,
1180 BL_I_CORSE_TUNE_20MA,
1181 BL_I_CORSE_TUNE_24MA,
1182 BL_I_CORSE_TUNE_28MA,
1183 BL_I_CORSE_TUNE_32MA
1184}bl_i_corse_tune_enum;
1185
1186typedef enum
1187{
1188 BL_I_FINE_TUNE_0MA = 0,
1189 BL_I_FINE_TUNE_MINUS_1MA,
1190 BL_I_FINE_TUNE_MINUS_2MA,
1191 BL_I_FINE_TUNE_MINUS_3MA,
1192 BL_I_FINE_TUNE_PLUS_4MA,
1193 BL_I_FINE_TUNE_PLUS_3MA,
1194 BL_I_FINE_TUNE_PLUS_2MA,
1195 BL_I_FINE_TUNE_PLUS_1MA
1196}bl_i_fine_tune_enum;
1197
1198// (0x6D) DRIVER CTRL 12 BL
1199typedef enum
1200{
1201 BL_NUM_1 = 0,
1202 BL_NUM_2,
1203 BL_NUM_3,
1204 BL_NUM_4,
1205 BL_NUM_5,
1206 BL_NUM_6,
1207 BL_NUM_7,
1208 BL_NUM_8
1209}bl_number_enum;
1210
1211// (0x74) CLASS_D CTRL 4 SPKL
1212typedef enum
1213{
1214 SPKL_FB_FORCED_DTIN_DTIP = 0,
1215 SPKL_FF_FORCED_DTIN_DTIP,
1216 SPKL_FB_AUTO_CAL_DTCN_DTCP,
1217 SPKL_FF_AUTO_CAL_DTCN_DTCP
1218}spkl_dmode_enum;
1219
1220typedef enum
1221{
1222 SPKL_DTCAL_ENABLE_CLASS_D_R_READ_TIME_CAL = 0,
1223 SPKL_DTCAL_DISABLE_CLASS_D_R_READ_TIME_CAL
1224}spkl_dtcal_enum;
1225
1226// (0x75) CLASS_D CATRL 5 SPKL
1227typedef enum
1228{
1229 SPKL_2_4_BUFFER = 0,
1230 SPKL_1_4_BUFFER = 1,
1231 SPKL_4_4_BUFFER = 2,
1232 SPKL_3_4_BUFFER = 3
1233}spkl_slew_enum;
1234
1235
1236// (0x76) CLASS_D CTRL 6 SPKL
1237typedef enum
1238{
1239 SPKL_VOL_6DB = 0,
1240 SPKL_VOL_9DB = 1,
1241 SPKL_VOL_12DB = 2,
1242 SPKL_VOL_15DB = 3,
1243 SPKL_VOL_18DB = 4,
1244 SPKL_VOL_21DB = 5,
1245 SPKL_VOL_24DB = 6,
1246 SPKL_VOL_27DB = 7
1247}spkl_vol_enum;
1248
1249
1250// (0x77) CLASS_D CTRL 7 SPKL
1251typedef enum
1252{
1253 SPKL_OC_DISABLE = 0,
1254 SPKL_OC_ENABLE = 1
1255}spkl_oc_enum;
1256
1257
1258
1259// (0x79) CLASS_D CTRL 9 SPKR
1260typedef enum
1261{
1262 SPKR_FB_FORCED_DTIN_DTIP = 0,
1263 SPKR_FF_FORCED_DTIN_DTIP,
1264 SPKR_FB_AUTO_CAL_DTCN_DTCP,
1265 SPKR_FF_AUTO_CAL_DTCN_DTCP
1266}spkr_dmode_enum;
1267
1268typedef enum
1269{
1270 SPKR_DTCAL_ENABLE_CLASS_D_R_READ_TIME_CAL = 0,
1271 SPKR_DTCAL_DISABLE_CLASS_D_R_READ_TIME_CAL
1272}spkr_dtcal_enum;
1273
1274// (0x7A) CLASS_D CTRL 10 SPKR
1275typedef enum
1276{
1277 SPKR_2_4_BUFFER = 0,
1278 SPKR_1_4_BUFFER = 1,
1279 SPKR_4_4_BUFFER = 2,
1280 SPKR_3_4_BUFFER = 3
1281}spkr_slew_enum;
1282
1283
1284
1285// (0x7B) CLASS_D CTRL 11 SPKR
1286
1287typedef enum
1288{
1289 SPKR_VOL_6DB = 0,
1290 SPKR_VOL_9DB = 1,
1291 SPKR_VOL_12DB = 2,
1292 SPKR_VOL_15DB = 3,
1293 SPKR_VOL_18DB = 4,
1294 SPKR_VOL_21DB = 5,
1295 SPKR_VOL_24DB = 6,
1296 SPKR_VOL_27DB = 7
1297}spkr_vol_enum;
1298
1299// (0x7C) CLASS_D CTRL 12 SPKL Overcurrent setting
1300typedef enum
1301{
1302 SPKR_OC_DISABLE = 0,
1303 SPKR_OC_ENABLE = 1
1304}spkr_oc_enum;
1305
1306
1307
1308// (0x81) CHARGER CTRL 1
1309typedef enum
1310{
1311 CHR_CURRENT_OFFSET_NO = 0,
1312 CHR_CURRENT_OFFSET_PLUS_1_STEP = 1,
1313 CHR_CURRENT_OFFSET_PLUS_2_STEP = 2,
1314 CHR_CURRENT_OFFSET_MINUS_2_STEP = 6,
1315 CHR_CURRENT_OFFSET_MINUS_1_STEP = 7
1316}cht_chr_offset_enum;
1317
1318typedef enum
1319{
1320 CHR_CURRENT_50MA = 0,
1321 CHR_CURRENT_90MA,
1322 CHR_CURRENT_150MA,
1323 CHR_CURRENT_225MA,
1324 CHR_CURRENT_300MA,
1325 CHR_CURRENT_450MA,
1326 CHR_CURRENT_650MA,
1327 CHR_CURRENT_800MA
1328}chr_chr_current_enum;
1329
1330// (0x83) TESTMODE CTRL 3 Analog Switch
1331//typedef enum
1332//{
1333// ASW_ASEL_ASW_2_SETS = 0,
1334// ASW_ASEL_SIMLS,
1335// ASW_ASEL_ASW_1_SET,
1336// ASW_ASEL_BL_CURRENT_SOURCE
1337//}asw_asel_enum;
1338typedef enum
1339{
1340 ASW_ASEL_ISINK_6_8_AS = 0, // ISINK 6~8 used as Analog Switch, others for BL
1341 ASW_ASEL_ALL_ISINK_BL = 3 // All ISINK used for BL
1342}asw_asel_enum;
1343
1344
1345typedef enum
1346{
1347 HI_Z = 0,
1348 RECEIVER,
1349 TWO_OF_RGB_DRIVER
1350 // TODO, the last item value
1351}asw_bsel_enum;
1352
1353// (0x84) TESTMODE CTRL 4 Testmode
1354typedef enum
1355{
1356 VGP2_ENABLE_WITH_SRCLKEN = 0,
1357 VGP2_ENABLE_WITH_VGP2_EN
1358}vgp2_on_sel_enum;
1359
1360
1361// (0x89) INT CTRL 1
1362typedef enum
1363{
1364 INT_EN_VCORE2_OC = 0x01,
1365 INT_EN_VPA_OC = 0x02,
1366 INT_EN_BOOST1_OC = 0x04,
1367 INT_EN_BOOST2_OC = 0x08,
1368 INT_EN_SPKL_OC = 0x10,
1369 INT_EN_SPKR_OC = 0x20,
1370 INT_EN_V3GTX_OC = 0x40,
1371 INT_EN_V3GRX_OC = 0x80,
1372 INT_EN_0X89_ALL = 0xFF,
1373 INT1_EN_ALL = 0xFF
1374}int_ctrl_1_enum;
1375
1376// (0x8A) INT CTRL 2
1377typedef enum
1378{
1379 INT_EN_RF_OC = 0x01,
1380 INT_EN_VTCXO_OC = 0x02,
1381 INT_EN_VCAMA_OC = 0x04,
1382 INT_EN_VWIFI3V3_OC = 0x08,
1383 INT_EN_VWIFI2V8_OC = 0x10,
1384 INT_EN_VSIM_OC = 0x20,
1385 INT_EN_VBT_OC = 0x40,
1386 INT_EN_VCAMD_OC = 0x80,
1387 INT_EN_0X8A_ALL = 0xFF,
1388 INT2_EN_ALL = 0xFF
1389}int_ctrl_2_enum;
1390
1391// (0x8B) INT CTRL 3
1392typedef enum
1393{
1394 INT_EN_VSDIO_OC = 0x01,
1395 INT_EN_VGP_OC = 0x02,
1396 INT_EN_VUSB_OC = 0x04,
1397 INT_EN_CHRDET = 0x08,
1398 INT_EN_OVP = 0x10,
1399 INT_EN_WATCHDOG = 0x20,
1400 INT_EN_PWRKEY = 0x40,
1401 INT_EN_0X8B_ALL = 0x7F,
1402 INT3_EN_ALL = 0x7F
1403}int_ctrl_3_enum;
1404
1405
1406// (0x96) WATCHDOG CTRL and INT CTRL 4
1407typedef enum
1408{
1409 WDT_TIMEOUT_4_SEC = 0,
1410 WDT_TIMEOUT_8_SEC,
1411 WDT_TIMEOUT_16_SEC,
1412 WDT_TIMEOUT_32_SEC
1413}wdt_timout_enum;
1414
1415
1416// Combinational functions structures
1417typedef enum
1418{
1419 VGP2_1_3 = 0,
1420 VGP2_1_5,
1421 VGP2_1_8,
1422 VGP2_2_5,
1423 VGP2_2_8,
1424 VGP2_3_0,
1425 VGP2_3_3
1426}vgp2_sel_enum;
1427
1428
1429typedef enum
1430{
1431 ST_VWIFI3V3_200US = 0,
1432 ST_VWIFI3V3_400US,
1433 ST_VWIFI3V3_600US,
1434 ST_VWIFI3V3_800US
1435}st_gear_vwifi3v3;
1436
1437typedef enum
1438{
1439 ST_VWIFI2V8_200US = 0,
1440 ST_VWIFI2V8_400US,
1441 ST_VWIFI2V8_600US,
1442 ST_VWIFI2V8_800US
1443}st_gear_vwifi2v8;
1444
1445typedef enum
1446{
1447 ST_VSDIO_200US = 0,
1448 ST_VSDIO_400US,
1449 ST_VSDIO_600US,
1450 ST_VSDIO_800US
1451}st_gear_vsdio;
1452
1453typedef enum
1454{
1455 OC_VWIFI3V3_100US = 0,
1456 OC_VWIFI3V3_200US,
1457 OC_VWIFI3V3_400US,
1458 OC_VWIFI3V3_800US
1459}oc_gear_vwifi3v3;
1460
1461typedef enum
1462{
1463 OC_VWIFI2V8_100US = 0,
1464 OC_VWIFI2V8_200US,
1465 OC_VWIFI2V8_400US,
1466 OC_VWIFI2V8_800US
1467}oc_gear_vwifi2v8;
1468
1469typedef enum
1470{
1471 OC_VSDIO_100US = 0,
1472 OC_VSDIO_200US,
1473 OC_VSDIO_400US,
1474 OC_VSDIO_800US
1475}oc_gear_vsdio;
1476
1477
1478extern void dcl_pmic6326_ChrDet_Registration(chr_callback_type type, void (*Callback)(void));
1479
1480// (0x09) STATUS 6 (RO)
1481extern kal_bool dcl_pmic6326_boost2_oc_status(void);
1482extern kal_bool dcl_pmic6326_spkr_oc_det_status(void);
1483extern kal_bool dcl_pmic6326_spkl_oc_det_status(void);
1484extern kal_bool dcl_pmic6326_pwrkey_deb_status(void);
1485extern kal_bool dcl_pmic6326_ovp_status(void);
1486extern kal_bool dcl_pmic6326_chrdet_status(void);
1487extern kal_bool dcl_pmic6326_bat_on_status(void);
1488extern kal_bool dcl_pmic6326_cv_status(void);
1489
1490// (0x0B) INT STATUS 1 (RO)
1491extern kal_uint8 dcl_pmic6326_int_status_1(void);
1492
1493// (0x0C) INT STATUS 2 (RO)
1494extern kal_uint8 dcl_pmic6326_int_status_2(void);
1495
1496// (0x0D) INT STATUS 3 (RO)
1497extern kal_uint8 dcl_pmic6326_int_status_3(void);
1498extern kal_bool dcl_pmic6326_vsdio_oc_int_status(void);
1499extern kal_bool dcl_pmic6326_vgp_oc_int_status(void);
1500extern kal_bool dcl_pmic6326_vusb_oc_int_status(void);
1501extern kal_bool dcl_pmic6326_ovp_int_status(void);
1502extern kal_bool dcl_pmic6326_chrdet_int_status(void);
1503
1504
1505// (0x0E) INT STATUS 4 (RO)
1506extern kal_uint8 dcl_pmic6326_int_status_4(void);
1507extern kal_bool dcl_pmic6326_watchdog_int_status(void);
1508extern void dcl_pmic6326_watchdog_clear(void);
1509
1510// (0x1B) LDO CTRL 2 VRF
1511extern void dcl_pmic6326_vrf_ical_en(vrf_ical_en_enum sel);
1512extern void dcl_pmic6326_vrf_oc_auto_off(kal_bool auto_off);
1513extern void dcl_pmic6326_vrf_enable(kal_bool enable);
1514extern void dcl_pmic6326_vrf_cal(kal_uint8 val);
1515
1516// (0x1C) LDO CTRL 3 VRF
1517extern void dcl_pmic6326_vrf_calst(vrf_calst_enum sel);
1518extern void dcl_pmic6326_vrf_caloc(vrf_caloc_enum sel);
1519extern void dcl_pmic6326_vrf_on_sel(vrf_on_sel_enum sel);
1520extern void dcl_pmic6326_vrf_en_force(kal_bool enable);
1521extern void dcl_pmic6326_vrf_plnmos_dis(kal_bool disable);
1522extern void dcl_pmic6326_vrf_cm(vrf_cm_enum sel);
1523
1524// (0x1E) LDO CTRL 5 VTCXO
1525extern void dcl_pmic6326_vtcxo_ical_en(vtcxo_ical_en_enum sel);
1526extern void dcl_pmic6326_vtcxo_oc_auto_off(kal_bool auto_off);
1527extern void dcl_pmic6326_vtcxo_enable(kal_bool enable);
1528extern void dcl_pmic6326_vtcxo_cal(kal_uint8 val);
1529
1530// (0x1F) LDO CTRL 6 VTCXO
1531extern void dcl_pmic6326_vtcxo_calst(vtcxo_calst_enum sel);
1532extern void dcl_pmic6326_vtcxo_caloc(vtcxo_caloc_enum sel);
1533extern void dcl_pmic6326_vtcxo_on_sel(vtcxo_on_sel_enum sel);
1534extern void dcl_pmic6326_vtcxo_en_force(kal_bool enable);
1535extern void dcl_pmic6326_vtcxo_plnmos_dis(kal_bool disable);
1536extern void dcl_pmic6326_vtcxo_cm(vtcxo_cm_enum sel);
1537
1538// (0x21) LDO CTRL 8 V3GTX
1539extern void dcl_pmic6326_v3gtx_sel(v3gtx_vol vol);
1540extern void dcl_pmic6326_v3gtx_ical_en(v3gtx_ical_en_enum sel);
1541extern void dcl_pmic6326_v3gtx_cal(kal_uint8 val);
1542
1543// (0x22) LDO CTRL 9 V3GTX
1544extern void dcl_pmic6326_v3gtx_calst(v3gtx_calst_enum sel);
1545extern void dcl_pmic6326_v3gtx_caloc(v3gtx_caloc_enum sel);
1546extern void dcl_pmic6326_v3gtx_oc_auto_off(kal_bool auto_off);
1547extern void dcl_pmic6326_v3gtx_enable(kal_bool enable);
1548extern void dcl_pmic6326_v3gtx_on_sel(v3gtx_on_sel_enum sel);
1549extern void dcl_pmic6326_v3gtx_en_force(kal_bool enable);
1550
1551// (0x24) LDO CTRL 11 V3GRX
1552extern void dcl_pmic6326_v3grx_sel(v3grx_vol vol);
1553extern void dcl_pmic6326_3grx_ical_en(v3grx_ical_en_enum sel);
1554extern void dcl_pmic6326_v3grx_cal(kal_uint8 val);
1555
1556// (0x25) LDO CTRL 12 V3GRX
1557extern void dcl_pmic6326_v3grx_calst(v3grx_calst_enum sel);
1558extern void dcl_pmic6326_v3grx_caloc(v3grx_caloc_enum sel);
1559extern void dcl_pmic6326_v3grx_oc_auto_off(kal_bool auto_off);
1560extern void dcl_pmic6326_v3grx_enable(kal_bool enable);
1561extern void dcl_pmic6326_v3grx_on_sel(v3grx_on_sel_enum sel);
1562extern void dcl_pmic6326_v3grx_en_force(kal_bool enable);
1563
1564// (0x2E) LDO CTRL 21 VCAMA
1565extern void dcl_pmic6326_vcama_sel(vcama_sel_enum sel);
1566extern void dcl_pmic6326_vcama_ical_en(vcama_ical_en_enum sel);
1567extern void dcl_pmic6326_vcama_cal(kal_uint8 val);
1568
1569// (0x2F) LDO CTRL 22 VCAMA
1570extern void dcl_pmic6326_vcama_calst(vcama_calst_enum sel);
1571extern void dcl_pmic6326_vcama_caloc(vcama_caloc_enum sel);
1572extern void dcl_pmic6326_vcama_enable(kal_bool enable);
1573extern void dcl_pmic6326_vcama_en_force(kal_bool enable);
1574extern void dcl_pmic6326_vcama_plnmos_dis(kal_bool disable);
1575extern void dcl_pmic6326_vcama_cm(vcama_cm_enum sel);
1576
1577// (0x31) LDO CTRL 24 VWIFI3V3
1578extern void dcl_pmic6326_vwifi3v3_sel(vwifi3v3_sel_enum sel);
1579extern void dcl_pmic6326_vwifi3v3_ical_en(vwifi3v3_ical_en_enum sel);
1580extern void dcl_pmic6326_vwifi3v3_cal(kal_uint8 val);
1581
1582// (0x32) LDO CTRL 25 VWIFI3V3
1583extern void dcl_pmic6326_vwifi3v3_calst(vwifi3v3_calst_enum sel);
1584extern void dcl_pmic6326_vwifi3v3_caloc(vwifi3v3_caloc_enum sel);
1585extern void dcl_pmic6326_vwifi3v3_enable(kal_bool enable);
1586extern void dcl_pmic6326_vwifi3v3_en_force(kal_bool enable);
1587extern void dcl_pmic6326_vwifi3v3_plnmos_dis(kal_bool disable);
1588extern void dcl_pmic6326_vwifi3v3_cm(vwifi3v3_cm_enum sel);
1589
1590// (0x34) LDO CTRL 27 VWIFI2V8
1591extern void dcl_pmic6326_vwifi2v8_sel(vwifi2v8_sel_enum sel);
1592extern void dcl_pmic6326_vwifi2v8_ical_en(vwifi2v8_ical_en_enum sel);
1593extern void dcl_pmic6326_vwifi2v8_cal(kal_uint8 val);
1594
1595// (0x35) LDO CTRL 28 VWIFI2V8
1596extern void dcl_pmic6326_vwifi2v8_calst(vwifi2v8_calst_enum sel);
1597extern void dcl_pmic6326_vwifi2v8_caloc(vwifi2v8_caloc_enum sel);
1598extern void dcl_pmic6326_vwifi2v8_enable(kal_bool enable);
1599extern void dcl_pmic6326_vwifi2v8_en_force(kal_bool enable);
1600extern void dcl_pmic6326_vwifi2v8_plnmos_dis(kal_bool disable);
1601extern void dcl_pmic6326_vwifi2v8_cm(vwifi2v8_cm_enum sel);
1602
1603// (0x37) LDO CTRL 30 VSIM
1604//void dcl_pmic6326_vsim_sel(vsim_sel_enum sel);
1605extern void pmic6326_vsim_sel(vsim_sel_enum sel);
1606extern void pmic6326_vsim_sel(vsim_sel_enum sel);
1607extern void dcl_pmic6326_vsim_enable(kal_bool enable);
1608extern void dcl_pmic6326_vsim_ical_en(vsim_ical_en_enum sel);
1609extern void dcl_pmic6326_vsim_en_force(kal_bool enable);
1610extern void dcl_pmic6326_vsim_plnmos_dis(kal_bool disable);
1611
1612// (0x38) LDO CTRL 31 VSIM
1613extern void dcl_pmic6326_vsim_cal(kal_uint8 val);
1614
1615// (0x3A) LDO CTRL 33 VUSB
1616// USB voltage is NOT opened for change
1617//extern void dcl_pmic6326_vusb_sel(vusb_sel_enum sel);
1618extern void dcl_pmic6326_vusb_enable(kal_bool enable);
1619extern void dcl_pmic6326_vusb_ical_en(vusb_ical_en_enum sel);
1620extern void dcl_pmic6326_vusb_en_force(kal_bool enable);
1621extern void dcl_pmic6326_vusb_plnmos_dis(kal_bool disable);
1622
1623// (0x3B) LDO CTRL 34 VUSB
1624extern void dcl_pmic6326_vusb_cal(kal_uint8 val);
1625extern void dcl_pmic6326_vusb_calst(vusb_calst_enum sel);
1626extern void dcl_pmic6326_vusb_caloc(vusb_caloc_enum sel);
1627
1628// (0x3D) LDO CTRL 36 VBT
1629extern void dcl_pmic6326_vbt_sel(vbt_sel_enum sel);
1630extern void dcl_pmic6326_vbt_enable(kal_bool enable);
1631extern void dcl_pmic6326_vbt_ical_en(vbt_ical_en_enum sel);
1632extern void dcl_pmic6326_vbt_en_force(kal_bool enable);
1633extern void dcl_pmic6326_vbt_plnmos_dis(kal_bool disable);
1634
1635// (0x3E) LDO CTRL 37 VBT
1636extern void dcl_pmic6326_vbt_cal(kal_uint8 val);
1637extern void dcl_pmic6326_vbt_calst(vbt_calst_enum sel);
1638extern void dcl_pmic6326_vbt_caloc(vbt_caloc_enum sel);
1639
1640// (0x40) LDO CTRL 39 VCAMD
1641extern void dcl_pmic6326_vcamd_sel(vcamd_sel_enum sel);
1642extern void dcl_pmic6326_vcamd_enable(kal_bool enable);
1643extern void dcl_pmic6326_vcamd_ical_en(vcamd_ical_en_enum sel);
1644extern void dcl_pmic6326_vcamd_en_force(kal_bool enable);
1645extern void dcl_pmic6326_vcamd_plnmos_dis(kal_bool disable);
1646
1647// (0x41) LDO CTRL 40 VCAMD
1648extern void dcl_pmic6326_vcamd_cal(kal_uint8 val);
1649extern void dcl_pmic6326_vcamd_calst(vcamd_calst_enum sel);
1650extern void dcl_pmic6326_vcamd_caloc(vcamd_caloc_enum sel);
1651
1652// (0x43) LDO CTRL 42 VGP
1653extern void dcl_pmic6326_vgp_sel(vgp_sel_enum sel);
1654extern void dcl_pmic6326_vgp_enable(kal_bool enable);
1655
1656// (0x44) LDO CTRL 43 VGP
1657extern void dcl_pmic6326_vgp_cal(kal_uint8 val);
1658
1659// (0x46) LDO CTRL 45 VSDIO
1660extern void dcl_pmic6326_vsdio_ical_en(vsdio_ical_en_enum sel);
1661extern void dcl_pmic6326_vsdio_enable(kal_bool enable);
1662extern void dcl_pmic6326_vsdio_en_force(kal_bool enable);
1663extern void dcl_pmic6326_vsdio_cal(kal_uint8 val);
1664
1665// (0x47) LDO CTRL 46 VSDIO
1666extern void dcl_pmic6326_vsdio_calst(vsdio_calst_enum sel);
1667extern void dcl_pmic6326_vsdio_caloc(vsdio_caloc_enum sel);
1668extern void dcl_pmic6326_vsdio_plnmos_dis(kal_bool disable);
1669extern void dcl_pmic6326_vsdio_sel(vsdio_sel_enum sel);
1670extern void dcl_pmic6326_vsdio_cm(vsdio_cm_enum sel);
1671
1672// (0x48) LDO CTRL 47 VSDIO
1673extern void dcl_pmic6326_vcore1_dvfs_step_inc(kal_uint8 val);
1674
1675// (0x4E) BUCK CTRL 6 VCORE1
1676extern void dcl_pmic6326_vcore1_dvfs_0_eco3(kal_uint8 val);
1677
1678// (0x4F) BUCK CTRL 7 VCORE1
1679extern void dcl_pmic6326_vcore1_sleep_0_eco3(kal_uint8 val);
1680extern void dcl_pmic6326_vcore1_dvfs_ramp_enable(kal_bool enable);
1681extern void dcl_pmic6326_vcore1_dvfs_target_update(kal_bool update);
1682
1683// (0x51) BUCK CTRL 9 VCORE2
1684extern void dcl_pmic6326_vcore2_dvfs_0_eco3(kal_uint8 val);
1685
1686
1687// (0x52) BUCK CTRL 10 VCORE2
1688extern void dcl_pmic6326_vcore2_enable(kal_bool enable);
1689extern void dcl_pmic6326_vcore2_sleep_0_eco3(kal_uint8 val);
1690
1691// (0x53) BUCK CTRL 11 VCORE2
1692extern void dcl_pmic6326_vcore2_on_sel(vcore2_on_sel_enum sel);
1693
1694// (0x54)
1695extern void dcl_pmic6326_vcore2_plnmos_dis(kal_bool disable);
1696
1697
1698// (0x57) BUCK CTRL 15 VMEM
1699extern void dcl_pmic6326_vcore1_sleep_1_eco3(kal_uint8 val);
1700extern void dcl_pmic6326_vcore1_dvfs_1_eco3(kal_uint8 val);
1701
1702// (0x58) BUCK CTRL 16 VPA
1703extern void dcl_pmic6326_vpa_tuneh(kal_uint8 value);
1704extern void dcl_pmic6326_vpa_en_force(kal_bool enable);
1705extern void dcl_pmic6326_vpa_plnmos_dis(kal_bool disable);
1706extern void dcl_pmic6326_vpa_enable(kal_bool enable);
1707
1708// (0x59) BUCK CTRL 17 VPA
1709extern void dcl_pmic6326_vpa_tunel(kal_uint8 value);
1710
1711// (0x5A) BUCK CTRL 18 VPA
1712extern void dcl_pmic6326_vpa_oc_tune(kal_uint8 val);
1713extern void dcl_pmic6326_vpa_bat_low(kal_bool bat_low);
1714
1715// (0x5C) BOOST CTRL 1 BOOST1
1716extern void dcl_pmic6326_vboost1_tune(vboost1_tune_enum sel);
1717extern void dcl_pmic6326_vboost1_tatt(kal_uint8 val);
1718
1719// (0x5D) BOOST CTRL 2 BOOST1
1720extern void dcl_pmic6326_boost1_oc_th(kal_uint8 val);
1721extern void dcl_pmic6326_boost1_enable(kal_bool enable);
1722extern void dcl_pmic6326_boost1_pre_sr_con(kal_uint8 val);
1723extern void dcl_pmic6326_boost1_soft_st_speed(boost1_soft_st_speed_enum sel);
1724
1725// (0x5E) BOOST CTRL 3 BOOST1
1726extern void dcl_pmic6326_boost1_dio_sr_con(kal_uint8 val);
1727extern void dcl_pmic6326_boost1_sync_enable(kal_bool enable);
1728
1729
1730// (0x5F) BOOST CTRL 4 BOOST2
1731extern void dcl_pmic6326_boost2_tune(vboost2_tune_enum sel);
1732extern void dcl_pmic6326_boots2_oc_th(boost2_oc_th_enum sel);
1733extern void dcl_pmic6326_boost2_dim_source(boost2_dim_source_enum sel);
1734
1735// (0x60) BOOST CTRL 5 BOOST2
1736extern void dcl_pmic6326_boost2_pre_sr_con(kal_uint8 val);
1737extern void dcl_pmic6326_boost2_enable(kal_bool enable);
1738
1739// (0x61) BOOST CTRL 6 BOOST2 and BOOST
1740extern void dcl_pmic6326_boost_mode(boost_mode_sel_enum sel);
1741
1742extern void dcl_pmic6326_vbus_enable(kal_bool enable);
1743
1744// (0x64) DRIVER CTRL 3 GEN
1745extern void dcl_pmic6326_igen_drv_isel(kal_uint8 sel);
1746extern void dcl_pmic6326_igen_drv_force(kal_bool force);
1747extern void dcl_pmic6326_vgen_drv_bgsel(kal_uint8 sel);
1748
1749// (0x65) DRIVER CTRL 4 FLASH
1750extern void dcl_pmic6326_flash_i_tune(kal_uint8 val);
1751extern void dcl_pmic6326_flash_dim_div(kal_uint8 val);
1752
1753// (0x66) DRIVER CTRL 5 FLASH
1754extern void dcl_pmic6326_flash_dim_duty(kal_uint8 duty);
1755extern void dcl_pmic6326_flash_enable(kal_bool enable);
1756extern void dcl_pmic6326_flash_bypass(kal_bool bypass);
1757
1758// (0x67) DRIVER CTRL 6 BL
1759extern void dcl_pmic6326_bl_dim_duty(kal_uint8 duty);
1760extern void dcl_pmic6326_bl_enable(kal_bool enable);
1761extern void dcl_pmic6326_bl_i_cal_enable(kal_bool enable);
1762extern void dcl_pmic6326_bl_bypass(kal_bool bypass);
1763
1764// (0x68) DRIVER CTRL 7 BL
1765extern void dcl_pmic6326_bl_i_corse_tune(bl_i_corse_tune_enum sel);
1766extern void dcl_pmic6326_bl_i_fine_tune(bl_i_fine_tune_enum sel);
1767
1768// (0x6D) DRIVER CTRL 12 BL
1769extern void dcl_pmic6326_bl_dim_div(kal_uint8 val);
1770extern void dcl_pmic6326_bl_number(bl_number_enum num);
1771
1772extern void dcl_pmic6326_init_bl(boost_mode_sel_enum boost_mode);
1773
1774// (0x6E) DRIVER CTRL 13 KP
1775extern void dcl_pmic6326_kp_dim_div(kal_uint8 val);
1776extern void dcl_pmic6326_kp_enable(kal_bool enable);
1777
1778// (0x6F) DRIVER CTRL 14 KP
1779extern void dcl_pmic6326_kp_dim_duty(kal_uint8 duty);
1780
1781// (0x70) DRIVER CTRL 15 VIBR
1782extern void dcl_pmic6326_vibr_dim_div(kal_uint8 val);
1783extern void dcl_pmic6326_vibr_enable(kal_bool enable);
1784
1785// (0x71) DRIVER CTRL 16 VIBR
1786extern void dcl_pmic6326_vibr_dim_duty(kal_uint8 duty);
1787
1788// (0x72) DRIVER CTRL 17 dim_ck_force_on
1789extern void dcl_pmic6326_dim_ck_force_on(kal_bool enable);
1790
1791// (0x73) CLASS_D CTRL 3 SPKL
1792extern void dcl_pmic6326_spkl_dtin(kal_uint8 val);
1793extern void dcl_pmic6326_spkl_dtip(kal_uint8 val);
1794
1795// (0x74) CLASS_D CTRL 4 SPKL
1796extern void dcl_pmic6326_spkl_dmode(spkl_dmode_enum sel);
1797extern void dcl_pmic6326_spkl_enable(kal_bool enable);
1798extern void dcl_pmic6326_spkl_dtcal(spkl_dtcal_enum sel);
1799
1800// (0x78) CLASS_D CTRL 8 SPKR
1801extern void dcl_pmic6326_spkr_dtin(kal_uint8 val);
1802extern void dcl_pmic6326_spkr_dtip(kal_uint8 val);
1803
1804// (0x79) CLASS_D CTRL 9 SPKR
1805extern void dcl_pmic6326_spkr_dmode(spkr_dmode_enum sel);
1806extern void dcl_pmic6326_spkr_enable(kal_bool enable);
1807extern void dcl_pmic6326_spkr_dtcal(spkr_dtcal_enum sel);
1808
1809
1810// (0x81) CHARGER CTRL 1
1811extern void dcl_pmic6326_chr_offset(cht_chr_offset_enum sel);
1812extern void dcl_pmic6326_chr_ov_th_high(void);
1813extern void dcl_pmic6326_chr_current(chr_chr_current_enum current);
1814extern chr_chr_current_enum pmic_get_chr_current(void);
1815
1816// (0x82) CHARGER CTRL 2
1817extern void dcl_pmic6326_chr_cv_rt(void);
1818extern void dcl_pmic6326_chr_force(kal_bool force);
1819extern void dcl_pmic6326_chr_chr_enable(kal_bool enable);
1820extern void dcl_pmic6326_chr_cv_tune(void);
1821// (0x83) TESTMODE CTRL 3 Analog Switch
1822extern void dcl_pmic6326_asw_asel(asw_asel_enum sel);
1823extern void dcl_pmic6326_asw_bsel(asw_bsel_enum sel);
1824extern void dcl_pmic6326_asw_a1sel(kal_uint8 sel);
1825extern void dcl_pmic6326_asw_a2sel(kal_uint8 sel);
1826// (0x86) TESTMODE CTRL 6 BB AUXADC Related
1827extern void dcl_pmic6326_adc_isense_enable(kal_bool enable);
1828extern void dcl_pmic6326_adc_vbat_enable(kal_bool enable);
1829extern void dcl_pmic6326_adc_meas_on(kal_bool on); // exported for controling vbat, isense adc measure at same time
1830
1831// (0x89) INT CTRL 1
1832extern void dcl_pmic6326_int_ctrl_1_enable(int_ctrl_1_enum sel, kal_bool enable);
1833// (0x8A) INT CTRL 2
1834extern void dcl_pmic6326_int_ctrl_2_enable(int_ctrl_2_enum sel, kal_bool enable);
1835// (0x8B) INT CTRL 2
1836extern void dcl_pmic6326_int_ctrl_3_enable(int_ctrl_3_enum sel, kal_bool enable);
1837
1838
1839// (0x8F)
1840extern void dcl_pmic6326_st_gear_vwifi3v3(st_gear_vwifi3v3 gear);
1841extern void dcl_pmic6326_st_gear_vwifi2v8(st_gear_vwifi2v8 gear);
1842// (0x90)
1843extern void dcl_pmic6326_st_gear_vsdio(st_gear_vsdio gear);
1844
1845// (0x92)
1846extern void dcl_pmic6326_oc_gear_vwifi3v3(oc_gear_vwifi3v3 gear);
1847extern void dcl_pmic6326_oc_gear_vwifi2v8(oc_gear_vwifi2v8 gear);
1848// (0x93)
1849extern void dcl_pmic6326_oc_gear_vsdio(oc_gear_vsdio gear);
1850
1851
1852
1853
1854// (0x96) WATCHDOG CTRL and INT CTRL 4
1855extern void dcl_pmic6326_wdt_timeout(wdt_timout_enum sel);
1856extern void dcl_pmic6326_intr_polarity(kal_bool is_assert);
1857extern void dcl_pmic6326_wdt_enable(kal_bool enable);
1858
1859
1860// Combinational functions
1861extern void dcl_pmic6326_vgp2_enable(kal_bool enable);
1862extern void dcl_pmic6326_vgp2_sel(vgp2_sel_enum sel);
1863extern void dcl_pmic6326_vgp2_on_sel(vgp2_on_sel_enum sel);
1864extern void dcl_pmic6326_vgp2_sell(kal_uint8 value);
1865extern void dcl_pmic6326_vgp2_selh(kal_uint8 value);
1866extern void dcl_pmic6326_vgp2_ocfb_enable(kal_bool enable);
1867extern void dcl_pmic6326_vsim2_enable(kal_bool enable);
1868extern void dcl_pmic6326_vsim2_sel(vsim_sel_enum sel);
1869extern void dcl_pmic6326_spk_enable(kal_bool enable);
1870
1871extern void dcl_pmic6326_EM_reg_write(kal_uint8 reg, kal_uint8 val);
1872extern kal_uint8 dcl_pmic6326_EM_reg_read(kal_uint8 reg);
1873
1874#if defined(DRV_MISC_PMIC_ASSERT_KEEP_CHARGING)
1875extern void dcl_pmic6326_assert_chaging_kick(void);
1876#endif // #if defined(DRV_MISC_PMIC_ASSERT_KEEP_CHARGING)
1877
1878/*
1879// The following are implemented in custom files
1880// MoDIS parser skip start
1881extern void pmic6326_customization_init(void);
1882extern void pmic6326_cust_vspk_enable(kal_bool enable);
1883extern void pmic6326_csut_vsim_enable(kal_bool enable);
1884extern void pmic6326_csut_vsim_sel(pmic_adpt_vsim_volt volt);
1885extern void pmic6326_csut_vsim2_enable(kal_bool enable);
1886extern void pmic6326_csut_vsim2_sel(pmic_adpt_vsim_volt sel);
1887extern void pmic6326_csut_vusb_enable(kal_bool enable);
1888extern void pmic6326_csut_vcama_enable(kal_bool enable);
1889extern void pmic6326_csut_vcama_sel(pmic_adpt_vcama_volt vol);
1890extern void pmic6326_csut_vcamd_enable(kal_bool enable);
1891extern void pmic6326_csut_vcamd_sel(pmic_adpt_vcamd_volt volt);
1892// MoDIS parser skip end
1893*/
1894
1895
1896// =======================================================================================
1897
1898/*
1899typedef enum
1900{
1901 VRF,
1902 VTCXO,
1903 V3GTX,
1904 V3GRX,
1905 VA,
1906 VIO,
1907 VRTC,
1908 VCAMA,
1909 VCAMD,
1910 VWIFI3V3,
1911 VWIFI2V8,
1912 VSIM,
1913 VBT,
1914 VUSB,
1915 VGP,
1916 VSIM2=VGP,
1917 VGP2,
1918 VSDIO,
1919 VCORE,
1920 VCORE1,
1921 VCORE2,
1922 VM,
1923 VMEM,
1924 VIBR,
1925 PMU_LDO_BUCK_MAX,
1926 VRF18,
1927 VFM,
1928 VMC
1929}PMU_LDO_BUCK_LIST_ENUM;
1930
1931typedef enum
1932{
1933 VPA1,
1934 PMU_VPA_MAX
1935}PMU_VPA_LIST_ENUM;
1936
1937typedef enum
1938{
1939 CHR,
1940 PMU_CHR_MAX
1941}PMU_CHR_LIST_ENUM;
1942
1943typedef enum
1944{
1945 SPK,
1946 PMU_SPK_MAX
1947}PMU_SPK_LIST_ENUM;
1948
1949typedef enum
1950{
1951 PMU_ISINK_MAX
1952}PMU_ISINK_LIST_ENUM;
1953
1954typedef enum
1955{
1956 BOOST1,
1957 BOOST2,
1958 PMU_BOOST_MAX
1959}PMU_BOOST_LIST_ENUM;
1960*/
1961
1962
1963#endif // #ifdef PMIC_6326_REG_API
1964#endif // #ifndef __DCL_PMU6326_SW_H_STRUCT__
1965
1966
1967