blob: 2fb250855c817cd56154d971e373b053f229124b [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_pmic6329_sw.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file is for PMIC 6329
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 *
71 *
72 *------------------------------------------------------------------------------
73 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
74 *============================================================================
75 ****************************************************************************/
76
77
78
79#ifndef __DCL_PMU6329_SW_H_STRUCT__
80#define __DCL_PMU6329_SW_H_STRUCT__
81
82#include "dcl_pmic_features.h"
83
84#ifdef PMIC_6329_REG_API
85
86/*
87// debug 1
88// Define to keep chaging when assert
89// This flag is only for debug purpose
90//#define DRV_MISC_PMIC_ASSERT_KEEP_CHARGING
91//#define DEBUG_PMIC6329_NO_CHARGER_WATCHDOG_TIMER
92
93
94// debug 2
95// Define to enable PMIC6329 charger watch dog timer kick
96// When enable charger, PMIC6329 will enable a watch dog timer
97// We need to kick the timer periodically, to ontify PMIC6329 that BB is alive
98// If timeout, PMIC6329 will disable charge automatically
99// #### If this is NOT enabled, we will disable the watch dog timer function at boot time
100//#define ENABLE_PMIC_DRIVER_KICK_CHARGER_WATCHDOG_TIMER ==> Move to be activated by BMT charging algorithm, do NOT use this anymore
101*/
102
103#define PMIC6329_ECO_1_VERSION 0x01
104#define PMIC6329_ECO_2_VERSION 0x02
105
106#ifndef PMIC_OLD_STRUCTURE
107#define PMIC_OLD_STRUCTURE
108
109#endif //#define PMIC_OLD_STRUCTURE
110
111typedef enum
112{
113 AC_CHR_CALLBACK=0,
114 USB_CHR_CALLBACK
115}chr_callback_type;
116
117typedef struct
118{
119 void (*pmic_ac_det)(void);
120 void (*pmic_usb_det)(void);
121}pmic6329_chrdect_callbac_struct;
122
123extern void dcl_pmic6329_ChrDet_Registration(chr_callback_type type, void (*Callback)(void));
124
125// Combinational functions
126extern void dcl_pmic6329_EM_reg_write(kal_uint8 reg, kal_uint8 val);
127extern kal_uint8 dcl_pmic6329_EM_reg_read(kal_uint8 reg);
128extern void pmic6329_customization_init(void);
129/*
130// The following are implemented in custom files
131// MoDIS parser skip start
132extern void pmic6329_customization_init(void);
133extern void pmic6329_cust_vspk_enable(kal_bool enable);
134extern void pmic6329_csut_vsim_enable(kal_bool enable);
135extern void pmic6329_csut_vsim_sel(pmic_adpt_vsim_volt volt);
136extern void pmic6329_csut_vsim2_enable(kal_bool enable);
137extern void pmic6329_csut_vsim2_sel(pmic_adpt_vsim_volt sel);
138extern void pmic6329_csut_vusb_enable(kal_bool enable);
139extern void pmic6329_csut_vcama_enable(kal_bool enable);
140extern void pmic6329_csut_vcama_sel(pmic_adpt_vcama_volt vol);
141extern void pmic6329_csut_vcamd_enable(kal_bool enable);
142extern void pmic6329_csut_vcamd_sel(pmic_adpt_vcamd_volt volt);
143// MoDIS parser skip end
144*/
145
146#endif // #ifdef PMIC_6329_REG_API
147#endif // #ifndef __DCL_PMU6329_SW_H_STRUCT__
148