Flemmard | e2bb4a2 | 2014-01-28 16:39:30 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2007 HTC Incorporated |
| 3 | * |
| 4 | * This software is licensed under the terms of the GNU General Public |
| 5 | * License version 2, as published by the Free Software Foundation, and |
| 6 | * may be copied, distributed, and modified under those terms. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | #ifndef _TPS65200_H_ |
| 14 | #define _TPS65200_H_ |
| 15 | #include <linux/notifier.h> |
| 16 | |
| 17 | #define ENABLE_LIMITED_CHG 0x10 |
| 18 | #define CLEAR_LIMITED_CHG 0x11 |
| 19 | #define CHECK_CHG 0X64 |
| 20 | #define SET_ICL500 0X65 |
| 21 | #define SET_ICL100 0X66 |
| 22 | #define CHECK_INT2 0X67 |
| 23 | #define VDPM_ORIGIN_V 0XC0 |
| 24 | #define VDPM_476V 0XC1 |
| 25 | #define OVERTEMP_VREG 0XC8 |
| 26 | #define NORMALTEMP_VREG 0XC9 |
| 27 | #define CHECK_INT1 0XCA |
| 28 | #define CHECK_CONTROL 0xCB |
| 29 | #define NORMALTEMP_VREG_HV 0xCC |
| 30 | |
| 31 | enum wled_ctl_t { |
| 32 | WLED_DISABLE = 0, |
| 33 | WLED_ENABLE, |
| 34 | WLED_STATUS |
| 35 | }; |
| 36 | |
| 37 | struct tps65200_chg_int_data { |
| 38 | int gpio_chg_int; |
| 39 | int tps65200_reg; |
| 40 | struct delayed_work int_work; |
| 41 | }; |
| 42 | |
| 43 | struct tps65200_platform_data { |
| 44 | int charger_check; |
| 45 | int gpio_chg_stat; |
| 46 | int gpio_chg_int; |
| 47 | #ifdef CONFIG_SUPPORT_DQ_BATTERY |
| 48 | int dq_result; |
| 49 | #endif |
| 50 | }; |
| 51 | |
| 52 | struct tps65200_chg_int_notifier { |
| 53 | struct list_head notifier_link; |
| 54 | const char *name; |
| 55 | void (*func)(int int_reg, int value); |
| 56 | }; |
| 57 | |
| 58 | #if defined(CONFIG_MACH_HOLIDAY) |
| 59 | extern u8 batt_charging_state; |
| 60 | #endif |
| 61 | |
| 62 | #ifdef CONFIG_MFD_TPS65200 |
| 63 | extern int tps_set_charger_ctrl(u32 ctl); |
| 64 | extern int tps_set_hv_battery(int hv); |
| 65 | extern int tps_register_notifier(struct tps65200_chg_int_notifier *notifier); |
| 66 | extern int tps65200_mask_interrupt_register(int status); |
| 67 | #else |
| 68 | extern int tps_register_notifier(struct tps65200_chg_int_notifier *notifier) { return 0; } |
| 69 | #endif |
| 70 | #endif |