| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /* Copyright Statement:
- *
- * This software/firmware and related documentation ("MediaTek Software") are
- * protected under relevant copyright laws. The information contained herein
- * is confidential and proprietary to MediaTek Inc. and/or its licensors.
- * Without the prior written permission of MediaTek inc. and/or its licensors,
- * any reproduction, modification, use or disclosure of MediaTek Software,
- * and information contained herein, in whole or in part, shall be strictly prohibited.
- */
- /* MediaTek Inc. (C) 2017. All rights reserved.
- *
- * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
- * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
- * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
- * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
- * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
- * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * The following software/firmware and/or related documentation ("MediaTek Software")
- * have been modified by MediaTek Inc. All revisions are subject to any receiver\'s
- * applicable license agreements with MediaTek Inc.
- */
- #ifndef __MTK_CHARGER_H
- #define __MTK_CHARGER_H
- #include <printf.h>
- struct charger_custom_data {
- bool disable_charger;
- bool power_path_support;
- bool enable_pe_plus;
- bool enable_pd20_reset;
- int max_charger_voltage;
- int min_charger_voltage;
- int fast_charge_voltage;
- int usb_charger_current;
- int ac_charger_current;
- int ac_charger_input_current;
- int non_std_ac_charger_current;
- int charging_host_charger_current;
- int ta_ac_charger_current;
- int pd_charger_current;
- int temp_t4_threshold;
- int temp_t3_threshold;
- int temp_t1_threshold;
- bool enable_anime;
- int led_brightness;
- int blinking_times;
- int blinking_period;
- int r_charger_1;
- int r_charger_2;
- };
- unsigned int chr_fdt_getprop_bool(const void *fdt, int nodeoffset, const char *name);
- unsigned int chr_fdt_getprop_u32(const void *fdt, int nodeoffset, const char *name);
- void chr_fdt_getprop_char_array(const void *fdt, int nodeoffset, const char *name, char *out_value);
- void init_charger_custom_data(void);
- int init_cust_data_from_dt(void);
- int get_bat_volt(int times);
- void mtk_charger_start(void);
- void check_bat_protect_status(void);
- void charger_enable_charging(bool enable);
- void charger_enable_power_path(bool enable);
- void charger_enable_wdt(bool enable);
- bool is_disable_charger(void);
- bool is_power_path_supported(void);
- void check_charger_volt(void);
- void reset_pe_adapter(void);
- void reset_pd_adapter(void);
- #endif /* __MTK_CHARGER_H */
|