/* bq2415x_charger.h - bq2415x charger driver Copyright (C) 2011 Pali Rohár This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef BQ2415X_CHARGER_H #define BQ2415X_CHARGER_H struct bq2415x_device; struct bq2415x_platform_data { int current_limit; int weak_battery_voltage; int battery_regulation_voltage; int charge_current_sense_voltage; int termination_current_sense_voltage; }; enum bq2415x_command { BQ2415X_WATCHDOG_RESET, BQ2415X_OTG_STATUS, BQ2415X_STAT_PIN_STATUS, BQ2415X_STAT_PIN_ENABLE, BQ2415X_STAT_PIN_DISABLE, BQ2415X_CHARGE_STATUS, BQ2415X_BOOST_STATUS, BQ2415X_FAULT_STATUS, BQ2415X_CHARGE_CURRENT_TERMINATION_STATUS, BQ2415X_CHARGE_CURRENT_TERMINATION_ENABLE, BQ2415X_CHARGE_CURRENT_TERMINATION_DISABLE, BQ2415X_CHARGER_STATUS, BQ2415X_CHARGER_ENABLE, BQ2415X_CHARGER_DISABLE, BQ2415X_HIGH_IMPEDANCE_STATUS, BQ2415X_HIGH_IMPEDANCE_ENABLE, BQ2415X_HIGH_IMPEDANCE_DISABLE, BQ2415X_MODE, BQ2415X_SET_BOOST_MODE, BQ2415X_SET_CHARGER_MODE, BQ2415X_OTG_HIGH_STATUS, BQ2415X_OTG_HIGH_ACTIVATE, BQ2415X_OTG_LOW_ACTIVATE, BQ2415X_OTG_PIN_STATUS, BQ2415X_OTG_PIN_ENABLE, BQ2415X_OTG_PIN_DISABLE, BQ2415X_VENDER_CODE, BQ2415X_PART_NUMBER, BQ2415X_REVISION, }; enum bq2415x_chip { BQUNKNOWN, BQ24150, BQ24150A, BQ24151, BQ24151A, BQ24152, BQ24153, BQ24153A, BQ24155, BQ24156, BQ24156A, BQ24158, }; enum bq2415x_chip bq2415x_detect_chip(struct bq2415x_device *bq); int bq2415x_exec_command(struct bq2415x_device *bq, enum bq2415x_command command); int bq2415x_set_defaults(struct bq2415x_device *bq); int bq2415x_set_current_limit(struct bq2415x_device *bq, int uA); int bq2415x_get_current_limit(struct bq2415x_device *bq); int bq2415x_set_weak_battery_voltage(struct bq2415x_device *bq, int mV); int bq2415x_get_weak_battery_voltage(struct bq2415x_device *bq); int bq2415x_set_battery_regulation_voltage(struct bq2415x_device *bq, int mV); int bq2415x_get_battery_regulation_voltage(struct bq2415x_device *bq); int bq2415x_set_charge_current_sense_voltage(struct bq2415x_device *bq, int mV); int bq2415x_get_charge_current_sense_voltage(struct bq2415x_device *bq); int bq2415x_set_termination_current_sense_voltage(struct bq2415x_device *bq, int mV); int bq2415x_get_termination_current_sense_voltage(struct bq2415x_device *bq); #endif