bq2415x_charger.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * bq2415x charger driver
  4. *
  5. * Copyright (C) 2011-2013 Pali Rohár <[email protected]>
  6. */
  7. #ifndef BQ2415X_CHARGER_H
  8. #define BQ2415X_CHARGER_H
  9. /*
  10. * This is platform data for bq2415x chip. It contains default board
  11. * voltages and currents which can be also later configured via sysfs. If
  12. * value is -1 then default chip value (specified in datasheet) will be
  13. * used.
  14. *
  15. * Value resistor_sense is needed for configuring charge and
  16. * termination current. If it is less or equal to zero, configuring charge
  17. * and termination current will not be possible.
  18. *
  19. * For automode support is needed to provide name of power supply device
  20. * in value notify_device. Device driver must immediately report property
  21. * POWER_SUPPLY_PROP_CURRENT_MAX when current changed.
  22. */
  23. /* Supported modes with maximal current limit */
  24. enum bq2415x_mode {
  25. BQ2415X_MODE_OFF, /* offline mode (charger disabled) */
  26. BQ2415X_MODE_NONE, /* unknown charger (100mA) */
  27. BQ2415X_MODE_HOST_CHARGER, /* usb host/hub charger (500mA) */
  28. BQ2415X_MODE_DEDICATED_CHARGER, /* dedicated charger (unlimited) */
  29. BQ2415X_MODE_BOOST, /* boost mode (charging disabled) */
  30. };
  31. struct bq2415x_platform_data {
  32. int current_limit; /* mA */
  33. int weak_battery_voltage; /* mV */
  34. int battery_regulation_voltage; /* mV */
  35. int charge_current; /* mA */
  36. int termination_current; /* mA */
  37. int resistor_sense; /* m ohm */
  38. const char *notify_device; /* name */
  39. };
  40. #endif