Lines Matching +full:battery +full:- +full:power

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Universal power supply monitor class
31 * For systems where the charger determines the maximum battery capacity
193 POWER_SUPPLY_TYPE_USB_PD, /* Power Delivery Port */
206 POWER_SUPPLY_USB_TYPE_PD, /* Power Delivery Port */
208 POWER_SUPPLY_USB_TYPE_PD_PPS, /* PD Programmable Power Supply */
230 /* Run-time specific power supply configuration */
247 /* Description of power supply */
258 * Functions for drivers implementing power supply class.
260 * this power supply. Instead use power_supply_*() functions (for
271 * of power supply. If this happens during device probe then it must
280 * Set if thermal zone should not be created for this power supply.
354 * This is recommended structure to specify static power supply parameters.
355 * Generic one, parametrizable for different power supplies. Power supply
383 int vbat_uv; /* Battery voltage in microvolt */
388 * struct power_supply_maintenance_charge_table - setting for maintenace charging
390 * the charge of the battery full as current is consumed after full charging.
405 * for the battery.
410 * consumer products because the power usage while connected to a charger is
411 * not zero, and devices are not manufactured to draw power directly from the
412 * charger: instead they will at all times dissipate the battery a little, like
413 * the power used in standby mode. This will over time give a charge graph
421 * +-------------------------------------------------------------------> t
423 * Practically this means that the Li-ions are wandering back and forth in the
424 * battery and this causes degeneration of the battery anode and cathode.
425 * To prolong the life of the battery, maintenance charging is applied after
426 * reaching charge_term_current_ua to hold up the charge in the battery while
427 * consuming power, thus lowering the wear on the battery:
434 * +-------------------------------------------------------------------> t
445 * As an example, a Samsung EB425161LA Lithium-Ion battery is CC/CV charged
454 * appropriately. These need to be determined from battery discharge curves
460 * the expected stand-by current. Also overvoltage protection will be applied
472 * struct power_supply_battery_info - information about batteries
478 * @voltage_min_design_uv: minimum voltage across the poles when the battery
480 * level the battery will need precharging when using CC/CV charging.
481 * @voltage_max_design_uv: voltage across the poles when the battery is fully
483 * printed on the label of the battery.
485 * charging the battery in microamperes. This is the charging phase when the
486 * battery is completely empty and we need to carefully trickle in some
496 * terminate completely and not restart until the voltage over the battery
498 * @charge_restart_voltage_uv: when the battery has been fully charged by
509 * constant into the battery the voltage slowly ascends to
518 * @alert_low_temp_charge_current_ua: The charging current to use if the battery
525 * battery enters high alert temperature, i.e. if the internal temperature is
531 * @factory_internal_resistance_uohm: the internal resistance of the battery
533 * depending on the lifetime and charge of the battery, so this is just a
535 * when the battery is discharging.
537 * battery at fabrication time while charging, expressed in microohms.
538 * The charging process will affect the internal resistance of the battery
541 * battery, so this is just a nominal ballpark figure.
548 * @temp_ambient_alert_min: the battery will go outside of operating conditions
551 * @temp_ambient_alert_max: the battery will go outside of operating conditions
554 * @temp_alert_min: the battery should issue an alert if the internal
556 * @temp_alert_max: the battery should issue an alert if the internal
558 * @temp_min: the battery will go outside of operating conditions when
561 * @temp_max: the battery will go outside of operating conditions when
570 * @resist_table: this is a table that correlates a battery temperature to the
573 * resistance of the battery is usually necessary for calculating the open
575 * the capacity of the battery. The resist_table must be ordered descending
579 * @vbat2ri_discharging: this is a table that correlates Battery voltage (VBAT)
583 * of the battery. These voltages to resistance tables apply when the battery
589 * when the battery is charging. Being under charge changes the battery's
594 * @bti_resistance_ohm: The Battery Type Indicator (BIT) nominal resistance
595 * in ohms for this battery, if an identification resistor is mounted
596 * between a third battery terminal and ground. This scheme is used by a lot
599 * for example 10 for +/- 10%, if the bti_resistance is set to 7000 and the
600 * tolerance is 10% we will detect a proper battery if the BTI resistance
603 * This is the recommended struct to manage static battery parameters,
608 * The default field value is -EINVAL or NULL for pointers.
616 * ^ Battery voltage
617 * | --- overvoltage_limit_uv
630 * +------------------------------------------------------------------> time
632 * ^ Current into the battery
647 * +-----------------------------------------------------------------> time
652 * With CC/CV charging commence over time like this for an empty battery:
654 * 1. When the battery is completely empty it may need to be charged with
658 * 2. Next a small initial pre-charge current (precharge_current_ua)
666 * constant_charge_current_max_ua of current to flow into the battery.
667 * The chemical reaction in the battery will make the voltage go up as
668 * charge goes into the battery. This current is applied until we reach
672 * means we allow current to go into the battery, but we keep the voltage
673 * fixed. This current will continue to charge the battery while keeping
674 * the voltage the same. A chemical reaction in the battery goes on
679 * After this the battery is fully charged, and if we do not support maintenance
680 * charging, the charging will not restart until power dissipation makes the
688 * dissipation for the power consuming entity while connected to the
695 * DETERMINING BATTERY CAPACITY:
698 * capacity in the battery, usually as a percentage of charge. In practice
699 * many chargers uses a so-called fuel gauge or coloumb counter that measure
700 * how much charge goes into the battery and how much goes out (+/- leak
702 * battery has to begin with, such as when it is first used or was taken out
704 * the open circuit voltage with a look-up table to determine the rough
705 * capacity of the battery. The open circuit voltage can be conceptualized
709 * +-------> IBAT >----------------+
713 * o <---------- | |
715 * .---. | | |
717 * '---' | | |
719 * GND +-------------------------------+
726 * temperature and how much capacity is left in the battery due to the
729 * In many practical applications we cannot just disconnect the battery from
731 * current out from the battery), estimate the Ri and thus calculate the
734 * OCV = VBAT - (IBAT * Ri)
740 * the battery even under load. Using this method will also compensate for
745 * Alternatively a manufacturer can specify how the capacity of the battery
746 * is dependent on the battery temperature which is the main factor affecting
755 * The power supply class itself doesn't use this struct as of now.
870 return ((info->vbat2ri_discharging != NULL) && in power_supply_supports_vbat2ri()
871 info->vbat2ri_discharging_size > 0); in power_supply_supports_vbat2ri()
877 return ((info->resist_table != NULL) && in power_supply_supports_temp2ri()
878 info->resist_table_size > 0); in power_supply_supports_temp2ri()
884 static inline int power_supply_is_system_supplied(void) { return -ENOSYS; } in power_supply_is_system_supplied()
999 return -EOPNOTSUPP; in power_supply_charge_behaviour_show()
1005 return -EOPNOTSUPP; in power_supply_charge_behaviour_parse()
1014 return -EOPNOTSUPP; in power_supply_charge_types_show()
1019 return -EOPNOTSUPP; in power_supply_charge_types_parse()