Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * bq2415x charger driver
0004  *
0005  * Copyright (C) 2011-2013  Pali Rohár <pali@kernel.org>
0006  */
0007 
0008 #ifndef BQ2415X_CHARGER_H
0009 #define BQ2415X_CHARGER_H
0010 
0011 /*
0012  * This is platform data for bq2415x chip. It contains default board
0013  * voltages and currents which can be also later configured via sysfs. If
0014  * value is -1 then default chip value (specified in datasheet) will be
0015  * used.
0016  *
0017  * Value resistor_sense is needed for configuring charge and
0018  * termination current. If it is less or equal to zero, configuring charge
0019  * and termination current will not be possible.
0020  *
0021  * For automode support is needed to provide name of power supply device
0022  * in value notify_device. Device driver must immediately report property
0023  * POWER_SUPPLY_PROP_CURRENT_MAX when current changed.
0024  */
0025 
0026 /* Supported modes with maximal current limit */
0027 enum bq2415x_mode {
0028     BQ2415X_MODE_OFF,       /* offline mode (charger disabled) */
0029     BQ2415X_MODE_NONE,      /* unknown charger (100mA) */
0030     BQ2415X_MODE_HOST_CHARGER,  /* usb host/hub charger (500mA) */
0031     BQ2415X_MODE_DEDICATED_CHARGER, /* dedicated charger (unlimited) */
0032     BQ2415X_MODE_BOOST,     /* boost mode (charging disabled) */
0033 };
0034 
0035 struct bq2415x_platform_data {
0036     int current_limit;      /* mA */
0037     int weak_battery_voltage;   /* mV */
0038     int battery_regulation_voltage; /* mV */
0039     int charge_current;     /* mA */
0040     int termination_current;    /* mA */
0041     int resistor_sense;     /* m ohm */
0042     const char *notify_device;  /* name */
0043 };
0044 
0045 #endif