Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 1 | /* |
Kim, Milo | f7bae49 | 2012-01-26 22:59:08 -0800 | [diff] [blame] | 2 | * LP8727 Micro/Mini USB IC with integrated charger |
Kim, Milo | e39b828 | 2012-01-29 17:28:18 -0800 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2011 Texas Instruments |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 5 | * Copyright (C) 2011 National Semiconductor |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef _LP8727_H |
| 13 | #define _LP8727_H |
| 14 | |
| 15 | enum lp8727_eoc_level { |
Kim, Milo | 6029719 | 2012-08-31 09:24:51 +0000 | [diff] [blame] | 16 | LP8727_EOC_5P, |
| 17 | LP8727_EOC_10P, |
| 18 | LP8727_EOC_16P, |
| 19 | LP8727_EOC_20P, |
| 20 | LP8727_EOC_25P, |
| 21 | LP8727_EOC_33P, |
| 22 | LP8727_EOC_50P, |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | enum lp8727_ichg { |
Kim, Milo | 6029719 | 2012-08-31 09:24:51 +0000 | [diff] [blame] | 26 | LP8727_ICHG_90mA, |
| 27 | LP8727_ICHG_100mA, |
| 28 | LP8727_ICHG_400mA, |
| 29 | LP8727_ICHG_450mA, |
| 30 | LP8727_ICHG_500mA, |
| 31 | LP8727_ICHG_600mA, |
| 32 | LP8727_ICHG_700mA, |
| 33 | LP8727_ICHG_800mA, |
| 34 | LP8727_ICHG_900mA, |
| 35 | LP8727_ICHG_1000mA, |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
Kim, Milo | 9b11adc7 | 2012-01-26 22:59:00 -0800 | [diff] [blame] | 38 | /** |
| 39 | * struct lp8727_chg_param |
| 40 | * @eoc_level : end of charge level setting |
Kim, Milo | b9633ef | 2012-08-31 09:27:22 +0000 | [diff] [blame] | 41 | * @ichg : charging current |
Kim, Milo | 9b11adc7 | 2012-01-26 22:59:00 -0800 | [diff] [blame] | 42 | */ |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 43 | struct lp8727_chg_param { |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 44 | enum lp8727_eoc_level eoc_level; |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 45 | enum lp8727_ichg ichg; |
| 46 | }; |
| 47 | |
Kim, Milo | 9b11adc7 | 2012-01-26 22:59:00 -0800 | [diff] [blame] | 48 | /** |
| 49 | * struct lp8727_platform_data |
Kim, Milo | b9633ef | 2012-08-31 09:27:22 +0000 | [diff] [blame] | 50 | * @get_batt_present : check battery status - exists or not |
| 51 | * @get_batt_level : get battery voltage (mV) |
Kim, Milo | 9b11adc7 | 2012-01-26 22:59:00 -0800 | [diff] [blame] | 52 | * @get_batt_capacity : get battery capacity (%) |
Kim, Milo | b9633ef | 2012-08-31 09:27:22 +0000 | [diff] [blame] | 53 | * @get_batt_temp : get battery temperature |
Kim, Milo | 318cb38 | 2012-08-31 09:23:12 +0000 | [diff] [blame] | 54 | * @ac : charging parameters for AC type charger |
| 55 | * @usb : charging parameters for USB type charger |
Kim, Milo | 60fd57e | 2012-08-31 09:23:25 +0000 | [diff] [blame] | 56 | * @debounce_msec : interrupt debounce time |
Kim, Milo | 9b11adc7 | 2012-01-26 22:59:00 -0800 | [diff] [blame] | 57 | */ |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 58 | struct lp8727_platform_data { |
Milo(Woogyom) Kim | e57b432 | 2012-01-04 16:23:11 +0400 | [diff] [blame] | 59 | u8 (*get_batt_present)(void); |
| 60 | u16 (*get_batt_level)(void); |
| 61 | u8 (*get_batt_capacity)(void); |
| 62 | u8 (*get_batt_temp)(void); |
Kim, Milo | 318cb38 | 2012-08-31 09:23:12 +0000 | [diff] [blame] | 63 | struct lp8727_chg_param *ac; |
| 64 | struct lp8727_chg_param *usb; |
Kim, Milo | 60fd57e | 2012-08-31 09:23:25 +0000 | [diff] [blame] | 65 | unsigned int debounce_msec; |
Kim, Milo | 620b273 | 2011-09-07 01:56:14 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | #endif |