sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget,/translations/zh_CN/power/power_supply_classmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/zh_TW/power/power_supply_classmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/it_IT/power/power_supply_classmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/ja_JP/power/power_supply_classmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/ko_KR/power/power_supply_classmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/sp_SP/power/power_supply_classmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hLinux power supply classh]hLinux power supply class}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhF/var/lib/git/docbuild/linux/Documentation/power/power_supply_class.rsthKubh)}(hhh](h)}(hSynopsish]hSynopsis}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hbPower supply class used to represent battery, UPS, AC or DC power supply properties to user-space.h]hbPower supply class used to represent battery, UPS, AC or DC power supply properties to user-space.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hIt defines core set of attributes, which should be applicable to (almost) every power supply out there. Attributes are available via sysfs and uevent interfaces.h]hIt defines core set of attributes, which should be applicable to (almost) every power supply out there. Attributes are available via sysfs and uevent interfaces.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hXEach attribute has well defined meaning, up to unit of measure used. While the attributes provided are believed to be universally applicable to any power supply, specific monitoring hardware may not be able to provide them all, so any of them may be skipped.h]hXEach attribute has well defined meaning, up to unit of measure used. While the attributes provided are believed to be universally applicable to any power supply, specific monitoring hardware may not be able to provide them all, so any of them may be skipped.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXPower supply class is extensible, and allows to define drivers own attributes. The core attribute set is subject to the standard Linux evolution (i.e. if it will be found that some attribute is applicable to many power supply types or their drivers, it can be added to the core set).h]hXPower supply class is extensible, and allows to define drivers own attributes. The core attribute set is subject to the standard Linux evolution (i.e. if it will be found that some attribute is applicable to many power supply types or their drivers, it can be added to the core set).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXlIt also integrates with LED framework, for the purpose of providing typically expected feedback of battery charging/fully charged status and AC/USB power supply online status. (Note that specific details of the indication (including whether to use it at all) are fully controllable by user and/or specific machine defaults, per design principles of LED framework).h]hXlIt also integrates with LED framework, for the purpose of providing typically expected feedback of battery charging/fully charged status and AC/USB power supply online status. (Note that specific details of the indication (including whether to use it at all) are fully controllable by user and/or specific machine defaults, per design principles of LED framework).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hAttributes/propertiesh]hAttributes/properties}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK!ubh)}(hPower supply class has predefined set of attributes, this eliminates code duplication across drivers. Power supply class insist on reusing its predefined attributes *and* their units.h](hPower supply class has predefined set of attributes, this eliminates code duplication across drivers. Power supply class insist on reusing its predefined attributes }(hj)hhhNhNubhemphasis)}(h*and*h]hand}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1j1hj)ubh their units.}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK"hjhhubh)}(hSo, userspace gets predictable set of attributes and their units for any kind of power supply, and can process/present them to a user in consistent manner. Results for different power supplies and machines are also directly comparable.h]hSo, userspace gets predictable set of attributes and their units for any kind of power supply, and can process/present them to a user in consistent manner. Results for different power supplies and machines are also directly comparable.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjhhubh)}(h_See drivers/power/supply/ds2760_battery.c for the example how to declare and handle attributes.h]h_See drivers/power/supply/ds2760_battery.c for the example how to declare and handle attributes.}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjhhubeh}(h]attributes-propertiesah ]h"]attributes/propertiesah$]h&]uh1hhhhhhhhK!ubh)}(hhh](h)}(hUnitsh]hUnits}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohhhhhK0ubh)}(h%Quoting include/linux/power_supply.h:h]h%Quoting include/linux/power_supply.h:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjohhubh block_quote)}(hAll voltages, currents, charges, energies, time and temperatures in µV, µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise stated. It's driver's job to convert its raw values to units in which this class operates. h]h)}(hAll voltages, currents, charges, energies, time and temperatures in µV, µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise stated. It's driver's job to convert its raw values to units in which this class operates.h]hAll voltages, currents, charges, energies, time and temperatures in µV, µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise stated. It’s driver’s job to convert its raw values to units in which this class operates.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jhhhK3hjohhubeh}(h]unitsah ]h"]unitsah$]h&]uh1hhhhhhhhK0ubh)}(hhh](h)}(hAttributes/properties detailedh]hAttributes/properties detailed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK:ubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKJuh1jhjubhtbody)}(hhh](hrow)}(hhh]hentry)}(hhh]h)}(h/**Charge/Energy/Capacity - how to not confuse**h]hstrong)}(hjh]h+Charge/Energy/Capacity - how to not confuse}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhK=hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]j)}(hhh](h)}(h**Because both "charge" (µAh) and "energy" (µWh) represents "capacity" of battery, this class distinguish these terms. Don't mix them!**h]j)}(hjh]hBecause both “charge” (µAh) and “energy” (µWh) represents “capacity” of battery, this class distinguish these terms. Don’t mix them!}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhK?hjubh bullet_list)}(hhh](h list_item)}(h;`CHARGE_*` attributes represents capacity in µAh only.h]hdefinition_list)}(hhh]hdefinition_list_item)}(h7`CHARGE_*` attributes represents capacity in µAh only.h](hterm)}(h `CHARGE_*`h]htitle_reference)}(hjBh]hCHARGE_*}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1jDhj@ubah}(h]h ]h"]h$]h&]uh1j>hhhKBhj:ubh definition)}(hhh]h)}(h,attributes represents capacity in µAh only.h]h,attributes represents capacity in µAh only.}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChj[ubah}(h]h ]h"]h$]h&]uh1jYhj:ubeh}(h]h ]h"]h$]h&]uh1j8hhhKBhj5ubah}(h]h ]h"]h$]h&]uh1j3hj/ubah}(h]h ]h"]h$]h&]uh1j-hj*ubj.)}(h;`ENERGY_*` attributes represents capacity in µWh only.h]j4)}(hhh]j9)}(h7`ENERGY_*` attributes represents capacity in µWh only.h](j?)}(h `ENERGY_*`h]jE)}(hjh]hENERGY_*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jDhjubah}(h]h ]h"]h$]h&]uh1j>hhhKDhjubjZ)}(hhh]h)}(h,attributes represents capacity in µWh only.h]h,attributes represents capacity in µWh only.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKDhjubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1j-hj*ubj.)}(hJ`CAPACITY` attribute represents capacity in *percents*, from 0 to 100.h]j4)}(hhh]j9)}(hF`CAPACITY` attribute represents capacity in *percents*, from 0 to 100.h](j?)}(h `CAPACITY`h]jE)}(hjh]hCAPACITY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jDhjubah}(h]h ]h"]h$]h&]uh1j>hhhKFhjubjZ)}(hhh]h)}(h;attribute represents capacity in *percents*, from 0 to 100.h](h!attribute represents capacity in }(hjhhhNhNubj2)}(h *percents*h]hpercents}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j1hjubh, from 0 to 100.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKFhjubah}(h]h ]h"]h$]h&]uh1j3hjubah}(h]h ]h"]h$]h&]uh1j-hj*ubeh}(h]h ]h"]h$]h&]bullet-uh1j(hhhKBhjubeh}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjhhhNhNubh)}(h Postfixes:h]h Postfixes:}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjhhubj4)}(hhh](j9)}(ha_AVG *hardware* averaged value, use it if your hardware is really able to report averaged values.h](j?)}(h_AVGh]h_AVG}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKMhjdubjZ)}(hhh]h)}(h\*hardware* averaged value, use it if your hardware is really able to report averaged values.h](j2)}(h *hardware*h]hhardware}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1j1hjyubhR averaged value, use it if your hardware is really able to report averaged values.}(hjyhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKMhjvubah}(h]h ]h"]h$]h&]uh1jYhjdubeh}(h]h ]h"]h$]h&]uh1j8hhhKMhjaubj9)}(h%_NOW momentary/instantaneous values. h](j?)}(h_NOWh]h_NOW}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKPhjubjZ)}(hhh]h)}(hmomentary/instantaneous values.h]hmomentary/instantaneous values.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKPhjahhubj9)}(hSTATUS this attribute represents operating status (charging, full, discharging (i.e. powering a load), etc.). This corresponds to `BATTERY_STATUS_*` values, as defined in battery.h. h](j?)}(hSTATUSh]hSTATUS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKUhjubjZ)}(hhh]h)}(hthis attribute represents operating status (charging, full, discharging (i.e. powering a load), etc.). This corresponds to `BATTERY_STATUS_*` values, as defined in battery.h.h](h{this attribute represents operating status (charging, full, discharging (i.e. powering a load), etc.). This corresponds to }(hjhhhNhNubjE)}(h`BATTERY_STATUS_*`h]hBATTERY_STATUS_*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jDhjubh! values, as defined in battery.h.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKShjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKUhjahhubj9)}(hCHARGE_TYPE batteries can typically charge at different rates. This defines trickle and fast charges. For batteries that are already charged or discharging, 'n/a' can be displayed (or 'unknown', if the status is not known). h](j?)}(h CHARGE_TYPEh]h CHARGE_TYPE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhK[hjubjZ)}(hhh]h)}(hbatteries can typically charge at different rates. This defines trickle and fast charges. For batteries that are already charged or discharging, 'n/a' can be displayed (or 'unknown', if the status is not known).h]hbatteries can typically charge at different rates. This defines trickle and fast charges. For batteries that are already charged or discharging, ‘n/a’ can be displayed (or ‘unknown’, if the status is not known).}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhj#ubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhK[hjahhubj9)}(hyAUTHENTIC indicates the power supply (battery or charger) connected to the platform is authentic(1) or non authentic(0). h](j?)}(h AUTHENTICh]h AUTHENTIC}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhK_hj@ubjZ)}(hhh]h)}(hnindicates the power supply (battery or charger) connected to the platform is authentic(1) or non authentic(0).h]hnindicates the power supply (battery or charger) connected to the platform is authentic(1) or non authentic(0).}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjRubah}(h]h ]h"]h$]h&]uh1jYhj@ubeh}(h]h ]h"]h$]h&]uh1j8hhhK_hjahhubj9)}(hlHEALTH represents health of the battery, values corresponds to POWER_SUPPLY_HEALTH_*, defined in battery.h. h](j?)}(hHEALTHh]hHEALTH}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKchjoubjZ)}(hhh]h)}(hdrepresents health of the battery, values corresponds to POWER_SUPPLY_HEALTH_*, defined in battery.h.h]hdrepresents health of the battery, values corresponds to POWER_SUPPLY_HEALTH_*, defined in battery.h.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjubah}(h]h ]h"]h$]h&]uh1jYhjoubeh}(h]h ]h"]h$]h&]uh1j8hhhKchjahhubj9)}(h1VOLTAGE_OCV open circuit voltage of the battery. h](j?)}(h VOLTAGE_OCVh]h VOLTAGE_OCV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKfhjubjZ)}(hhh]h)}(h$open circuit voltage of the battery.h]h$open circuit voltage of the battery.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKfhjahhubj9)}(hXVOLTAGE_MAX_DESIGN, VOLTAGE_MIN_DESIGN design values for maximal and minimal power supply voltages. Maximal/minimal means values of voltages when battery considered "full"/"empty" at normal conditions. Yes, there is no direct relation between voltage and battery capacity, but some dumb batteries use voltage for very approximated calculation of capacity. Battery driver also can use this attribute just to inform userspace about maximal and minimal voltage thresholds of a given battery. h](j?)}(h&VOLTAGE_MAX_DESIGN, VOLTAGE_MIN_DESIGNh]h&VOLTAGE_MAX_DESIGN, VOLTAGE_MIN_DESIGN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKohjubjZ)}(hhh]h)}(hXdesign values for maximal and minimal power supply voltages. Maximal/minimal means values of voltages when battery considered "full"/"empty" at normal conditions. Yes, there is no direct relation between voltage and battery capacity, but some dumb batteries use voltage for very approximated calculation of capacity. Battery driver also can use this attribute just to inform userspace about maximal and minimal voltage thresholds of a given battery.h]hXdesign values for maximal and minimal power supply voltages. Maximal/minimal means values of voltages when battery considered “full”/”empty” at normal conditions. Yes, there is no direct relation between voltage and battery capacity, but some dumb batteries use voltage for very approximated calculation of capacity. Battery driver also can use this attribute just to inform userspace about maximal and minimal voltage thresholds of a given battery.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKohjahhubj9)}(hVOLTAGE_MAX, VOLTAGE_MIN same as _DESIGN voltage values except that these ones should be used if hardware could only guess (measure and retain) the thresholds of a given power supply. h](j?)}(hVOLTAGE_MAX, VOLTAGE_MINh]hVOLTAGE_MAX, VOLTAGE_MIN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKthjubjZ)}(hhh]h)}(hsame as _DESIGN voltage values except that these ones should be used if hardware could only guess (measure and retain) the thresholds of a given power supply.h]hsame as _DESIGN voltage values except that these ones should be used if hardware could only guess (measure and retain) the thresholds of a given power supply.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKrhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKthjahhubj9)}(h6VOLTAGE_BOOT Reports the voltage measured during boot h](j?)}(h VOLTAGE_BOOTh]h VOLTAGE_BOOT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKwhj+ubjZ)}(hhh]h)}(h(Reports the voltage measured during booth]h(Reports the voltage measured during boot}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhj=ubah}(h]h ]h"]h$]h&]uh1jYhj+ubeh}(h]h ]h"]h$]h&]uh1j8hhhKwhjahhubj9)}(h6CURRENT_BOOT Reports the current measured during boot h](j?)}(h CURRENT_BOOTh]h CURRENT_BOOT}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKzhjZubjZ)}(hhh]h)}(h(Reports the current measured during booth]h(Reports the current measured during boot}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjlubah}(h]h ]h"]h$]h&]uh1jYhjZubeh}(h]h ]h"]h$]h&]uh1j8hhhKzhjahhubj9)}(hbCHARGE_FULL_DESIGN, CHARGE_EMPTY_DESIGN design charge values, when battery considered full/empty. h](j?)}(h'CHARGE_FULL_DESIGN, CHARGE_EMPTY_DESIGNh]h'CHARGE_FULL_DESIGN, CHARGE_EMPTY_DESIGN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhK}hjubjZ)}(hhh]h)}(h9design charge values, when battery considered full/empty.h]h9design charge values, when battery considered full/empty.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhK}hjahhubj9)}(hFENERGY_FULL_DESIGN, ENERGY_EMPTY_DESIGN same as above but for energy. h](j?)}(h'ENERGY_FULL_DESIGN, ENERGY_EMPTY_DESIGNh]h'ENERGY_FULL_DESIGN, ENERGY_EMPTY_DESIGN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hsame as above but for energy.h]hsame as above but for energy.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hX(CHARGE_FULL, CHARGE_EMPTY These attributes means "last remembered value of charge when battery became full/empty". It also could mean "value of charge when battery considered full/empty at given conditions (temperature, age)". I.e. these attributes represents real thresholds, not design values. h](j?)}(hCHARGE_FULL, CHARGE_EMPTYh]hCHARGE_FULL, CHARGE_EMPTY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hX These attributes means "last remembered value of charge when battery became full/empty". It also could mean "value of charge when battery considered full/empty at given conditions (temperature, age)". I.e. these attributes represents real thresholds, not design values.h]hXThese attributes means “last remembered value of charge when battery became full/empty”. It also could mean “value of charge when battery considered full/empty at given conditions (temperature, age)”. I.e. these attributes represents real thresholds, not design values.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h8ENERGY_FULL, ENERGY_EMPTY same as above but for energy. h](j?)}(hENERGY_FULL, ENERGY_EMPTYh]hENERGY_FULL, ENERGY_EMPTY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hsame as above but for energy.h]hsame as above but for energy.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj(ubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hCHARGE_COUNTER the current charge counter (in µAh). This could easily be negative; there is no empty or full value. It is only useful for relative, time-based measurements. h](j?)}(hCHARGE_COUNTERh]hCHARGE_COUNTER}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjEubjZ)}(hhh]h)}(hthe current charge counter (in µAh). This could easily be negative; there is no empty or full value. It is only useful for relative, time-based measurements.h]hthe current charge counter (in µAh). This could easily be negative; there is no empty or full value. It is only useful for relative, time-based measurements.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjWubah}(h]h ]h"]h$]h&]uh1jYhjEubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hyPRECHARGE_CURRENT the maximum charge current during precharge phase of charge cycle (typically 20% of battery capacity). h](j?)}(hPRECHARGE_CURRENTh]hPRECHARGE_CURRENT}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjtubjZ)}(hhh]h)}(hfthe maximum charge current during precharge phase of charge cycle (typically 20% of battery capacity).h]hfthe maximum charge current during precharge phase of charge cycle (typically 20% of battery capacity).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjtubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hCHARGE_TERM_CURRENT Charge termination current. The charge cycle terminates when battery voltage is above recharge threshold, and charge current is below this setting (typically 10% of battery capacity). h](j?)}(hCHARGE_TERM_CURRENTh]hCHARGE_TERM_CURRENT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hCharge termination current. The charge cycle terminates when battery voltage is above recharge threshold, and charge current is below this setting (typically 10% of battery capacity).h]hCharge termination current. The charge cycle terminates when battery voltage is above recharge threshold, and charge current is below this setting (typically 10% of battery capacity).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hHCONSTANT_CHARGE_CURRENT constant charge current programmed by charger. h](j?)}(hCONSTANT_CHARGE_CURRENTh]hCONSTANT_CHARGE_CURRENT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(h.constant charge current programmed by charger.h]h.constant charge current programmed by charger.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hYCONSTANT_CHARGE_CURRENT_MAX maximum charge current supported by the power supply object. h](j?)}(hCONSTANT_CHARGE_CURRENT_MAXh]hCONSTANT_CHARGE_CURRENT_MAX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hhhhKhj0ubjZ)}(hhh]h)}(h.constant charge voltage programmed by charger.h]h.constant charge voltage programmed by charger.}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjBubah}(h]h ]h"]h$]h&]uh1jYhj0ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hYCONSTANT_CHARGE_VOLTAGE_MAX maximum charge voltage supported by the power supply object. h](j?)}(hCONSTANT_CHARGE_VOLTAGE_MAXh]hCONSTANT_CHARGE_VOLTAGE_MAX}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj_ubjZ)}(hhh]h)}(hhhhKhjubjZ)}(hhh]h)}(h^input current limit programmed by charger. Indicates the current drawn from a charging source.h]h^input current limit programmed by charger. Indicates the current drawn from a charging source.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hrINPUT_VOLTAGE_LIMIT input voltage limit programmed by charger. Indicates the voltage limit from a charging source.h](j?)}(hINPUT_VOLTAGE_LIMITh]hINPUT_VOLTAGE_LIMIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(h^input voltage limit programmed by charger. Indicates the voltage limit from a charging source.h]h^input voltage limit programmed by charger. Indicates the voltage limit from a charging source.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hmINPUT_POWER_LIMIT input power limit programmed by charger. Indicates the power limit from a charging source. h](j?)}(hINPUT_POWER_LIMITh]hINPUT_POWER_LIMIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hZinput power limit programmed by charger. Indicates the power limit from a charging source.h]hZinput power limit programmed by charger. Indicates the power limit from a charging source.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h9CHARGE_CONTROL_LIMIT current charge control limit settingh](j?)}(hCHARGE_CONTROL_LIMITh]hCHARGE_CONTROL_LIMIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(h$current charge control limit settingh]h$current charge control limit setting}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj-ubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h>CHARGE_CONTROL_LIMIT_MAX maximum charge control limit setting h](j?)}(hCHARGE_CONTROL_LIMIT_MAXh]hCHARGE_CONTROL_LIMIT_MAX}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjJubjZ)}(hhh]h)}(h$maximum charge control limit settingh]h$maximum charge control limit setting}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj\ubah}(h]h ]h"]h$]h&]uh1jYhjJubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h8CALIBRATE battery or coulomb counter calibration status h](j?)}(h CALIBRATEh]h CALIBRATE}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjyubjZ)}(hhh]h)}(h-battery or coulomb counter calibration statush]h-battery or coulomb counter calibration status}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjyubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hCAPACITY capacity in percents.h](j?)}(hCAPACITYh]hCAPACITY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjubjZ)}(hhh]h)}(hcapacity in percents.h]hcapacity in percents.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hhhhKhjubjZ)}(hhh]h)}(h)minimum capacity alert value in percents.h]h)minimum capacity alert value in percents.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jYhjubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hhhhKhj ubjZ)}(hhh]h)}(h)maximum capacity alert value in percents.h]h)maximum capacity alert value in percents.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(hRCAPACITY_LEVEL capacity level. This corresponds to POWER_SUPPLY_CAPACITY_LEVEL_*. h](j?)}(hCAPACITY_LEVELh]hCAPACITY_LEVEL}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj5 ubjZ)}(hhh]h)}(hBcapacity level. This corresponds to POWER_SUPPLY_CAPACITY_LEVEL_*.h]hBcapacity level. This corresponds to POWER_SUPPLY_CAPACITY_LEVEL_*.}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjG ubah}(h]h ]h"]h$]h&]uh1jYhj5 ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h%TEMP temperature of the power supply.h](j?)}(hTEMPh]hTEMP}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjd ubjZ)}(hhh]h)}(h temperature of the power supply.h]h temperature of the power supply.}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjv ubah}(h]h ]h"]h$]h&]uh1jYhjd ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h1TEMP_ALERT_MIN minimum battery temperature alert.h](j?)}(hTEMP_ALERT_MINh]hTEMP_ALERT_MIN}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(h"minimum battery temperature alert.h]h"minimum battery temperature alert.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h1TEMP_ALERT_MAX maximum battery temperature alert.h](j?)}(hTEMP_ALERT_MAXh]hTEMP_ALERT_MAX}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(h"maximum battery temperature alert.h]h"maximum battery temperature alert.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h!TEMP_AMBIENT ambient temperature.h](j?)}(h TEMP_AMBIENTh]h TEMP_AMBIENT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(hambient temperature.h]hambient temperature.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h9TEMP_AMBIENT_ALERT_MIN minimum ambient temperature alert.h](j?)}(hTEMP_AMBIENT_ALERT_MINh]hTEMP_AMBIENT_ALERT_MIN}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(h"minimum ambient temperature alert.h]h"minimum ambient temperature alert.}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj2 ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h9TEMP_AMBIENT_ALERT_MAX maximum ambient temperature alert.h](j?)}(hTEMP_AMBIENT_ALERT_MAXh]hTEMP_AMBIENT_ALERT_MAX}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhjO ubjZ)}(hhh]h)}(h"maximum ambient temperature alert.h]h"maximum ambient temperature alert.}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhja ubah}(h]h ]h"]h$]h&]uh1jYhjO ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h'TEMP_MIN minimum operatable temperatureh](j?)}(hTEMP_MINh]hTEMP_MIN}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj~ ubjZ)}(hhh]h)}(hminimum operatable temperatureh]hminimum operatable temperature}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj~ ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h(TEMP_MAX maximum operatable temperature h](j?)}(hTEMP_MAXh]hTEMP_MAX}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(hmaximum operatable temperatureh]hmaximum operatable temperature}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h`TIME_TO_EMPTY seconds left for battery to be considered empty (i.e. while battery powers a load)h](j?)}(h TIME_TO_EMPTYh]h TIME_TO_EMPTY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(hRseconds left for battery to be considered empty (i.e. while battery powers a load)h]hRseconds left for battery to be considered empty (i.e. while battery powers a load)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubj9)}(h^TIME_TO_FULL seconds left for battery to be considered full (i.e. while battery is charging) h](j?)}(h TIME_TO_FULLh]h TIME_TO_FULL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(hOseconds left for battery to be considered full (i.e. while battery is charging)h]hOseconds left for battery to be considered full (i.e. while battery is charging)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhjahhubeh}(h]h ]h"]h$]h&]uh1j3hjhhhhhNubeh}(h]attributes-properties-detailedah ]h"]attributes/properties detailedah$]h&]uh1hhhhhhhhK:ubh)}(hhh](h)}(h-Battery <-> external power supply interactionh]h-Battery <-> external power supply interaction}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjH hhhhhKubh)}(hOften power supplies are acting as supplies and supplicants at the same time. Batteries are good example. So, batteries usually care if they're externally powered or not.h]hOften power supplies are acting as supplies and supplicants at the same time. Batteries are good example. So, batteries usually care if they’re externally powered or not.}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjH hhubh)}(hRFor that case, power supply class implements notification mechanism for batteries.h]hRFor that case, power supply class implements notification mechanism for batteries.}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjH hhubh)}(hExternal power supply (AC) lists supplicants (batteries) names in "supplied_to" struct member, and each power_supply_changed() call issued by external power supply will notify supplicants via external_power_changed callback.h]hExternal power supply (AC) lists supplicants (batteries) names in “supplied_to” struct member, and each power_supply_changed() call issued by external power supply will notify supplicants via external_power_changed callback.}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjH hhubeh}(h])battery-external-power-supply-interactionah ]h"]-battery <-> external power supply interactionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h"Devicetree battery characteristicsh]h"Devicetree battery characteristics}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hDrivers should call power_supply_get_battery_info() to obtain battery characteristics from a devicetree battery node, defined in Documentation/devicetree/bindings/power/supply/battery.yaml. This is implemented in drivers/power/supply/bq27xxx_battery.c.h]hDrivers should call power_supply_get_battery_info() to obtain battery characteristics from a devicetree battery node, defined in Documentation/devicetree/bindings/power/supply/battery.yaml. This is implemented in drivers/power/supply/bq27xxx_battery.c.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hProperties in struct power_supply_battery_info and their counterparts in the battery node have names corresponding to elements in enum power_supply_property, for naming consistency between sysfs attributes and battery node properties.h]hProperties in struct power_supply_battery_info and their counterparts in the battery node have names corresponding to elements in enum power_supply_property, for naming consistency between sysfs attributes and battery node properties.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]"devicetree-battery-characteristicsah ]h"]"devicetree battery characteristicsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hQAh]hQA}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubj4)}(hhh](j9)}(h,Q: Where is POWER_SUPPLY_PROP_XYZ attribute?h](j?)}(hQ:h]hQ:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhKhj ubjZ)}(hhh]h)}(h)Where is POWER_SUPPLY_PROP_XYZ attribute?h]h)Where is POWER_SUPPLY_PROP_XYZ attribute?}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhKhj ubj9)}(hX'A: If you cannot find attribute suitable for your driver needs, feel free to add it and send patch along with your driver. The attributes available currently are the ones currently provided by the drivers written. Good candidates to add in future: model/part#, cycle_time, manufacturer, etc. h](j?)}(hA:h]hA:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhMhj ubjZ)}(hhh](h)}(hwIf you cannot find attribute suitable for your driver needs, feel free to add it and send patch along with your driver.h]hwIf you cannot find attribute suitable for your driver needs, feel free to add it and send patch along with your driver.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hZThe attributes available currently are the ones currently provided by the drivers written.h]hZThe attributes available currently are the ones currently provided by the drivers written.}(hj& hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hMGood candidates to add in future: model/part#, cycle_time, manufacturer, etc.h]hMGood candidates to add in future: model/part#, cycle_time, manufacturer, etc.}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhMhj hhubj9)}(hjQ: I have some very specific attribute (e.g. battery color), should I add this attribute to standard ones?h](j?)}(hQ:h]hQ:}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhMhjN ubjZ)}(hhh]h)}(hgI have some very specific attribute (e.g. battery color), should I add this attribute to standard ones?h]hgI have some very specific attribute (e.g. battery color), should I add this attribute to standard ones?}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj` ubah}(h]h ]h"]h$]h&]uh1jYhjN ubeh}(h]h ]h"]h$]h&]uh1j8hhhMhj hhubj9)}(hX=A: Most likely, no. Such attribute can be placed in the driver itself, if it is useful. Of course, if the attribute in question applicable to large set of batteries, provided by many drivers, and/or comes from some general battery specification/standard, it may be a candidate to be added to the core attribute set. h](j?)}(hA:h]hA:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhM hj} ubjZ)}(hhh]h)}(hX8Most likely, no. Such attribute can be placed in the driver itself, if it is useful. Of course, if the attribute in question applicable to large set of batteries, provided by many drivers, and/or comes from some general battery specification/standard, it may be a candidate to be added to the core attribute set.h]hX8Most likely, no. Such attribute can be placed in the driver itself, if it is useful. Of course, if the attribute in question applicable to large set of batteries, provided by many drivers, and/or comes from some general battery specification/standard, it may be a candidate to be added to the core attribute set.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jYhj} ubeh}(h]h ]h"]h$]h&]uh1j8hhhM hj hhubj9)}(hXQ: Suppose, my battery monitoring chip/firmware does not provides capacity in percents, but provides charge_{now,full,empty}. Should I calculate percentage capacity manually, inside the driver, and register CAPACITY attribute? The same question about time_to_empty/time_to_full.h](j?)}(hQ:h]hQ:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhMhj ubjZ)}(hhh]h)}(hXSuppose, my battery monitoring chip/firmware does not provides capacity in percents, but provides charge_{now,full,empty}. Should I calculate percentage capacity manually, inside the driver, and register CAPACITY attribute? The same question about time_to_empty/time_to_full.h]hXSuppose, my battery monitoring chip/firmware does not provides capacity in percents, but provides charge_{now,full,empty}. Should I calculate percentage capacity manually, inside the driver, and register CAPACITY attribute? The same question about time_to_empty/time_to_full.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhMhj hhubj9)}(hXA: Most likely, no. This class is designed to export properties which are directly measurable by the specific hardware available. Inferring not available properties using some heuristics or mathematical model is not subject of work for a battery driver. Such functionality should be factored out, and in fact, apm_power, the driver to serve legacy APM API on top of power supply class, uses a simple heuristic of approximating remaining battery capacity based on its charge, current, voltage and so on. But full-fledged battery model is likely not subject for kernel at all, as it would require floating point calculation to deal with things like differential equations and Kalman filters. This is better be handled by batteryd/libbattery, yet to be written.h](j?)}(hA:h]hA:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j>hhhMhj ubjZ)}(hhh](h)}(h~Most likely, no. This class is designed to export properties which are directly measurable by the specific hardware available.h]h~Most likely, no. This class is designed to export properties which are directly measurable by the specific hardware available.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(hXtInferring not available properties using some heuristics or mathematical model is not subject of work for a battery driver. Such functionality should be factored out, and in fact, apm_power, the driver to serve legacy APM API on top of power supply class, uses a simple heuristic of approximating remaining battery capacity based on its charge, current, voltage and so on. But full-fledged battery model is likely not subject for kernel at all, as it would require floating point calculation to deal with things like differential equations and Kalman filters. This is better be handled by batteryd/libbattery, yet to be written.h]hXtInferring not available properties using some heuristics or mathematical model is not subject of work for a battery driver. Such functionality should be factored out, and in fact, apm_power, the driver to serve legacy APM API on top of power supply class, uses a simple heuristic of approximating remaining battery capacity based on its charge, current, voltage and so on. But full-fledged battery model is likely not subject for kernel at all, as it would require floating point calculation to deal with things like differential equations and Kalman filters. This is better be handled by batteryd/libbattery, yet to be written.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jYhj ubeh}(h]h ]h"]h$]h&]uh1j8hhhMhj hhubeh}(h]h ]h"]h$]h&]uh1j3hj hhhhhNubeh}(h]qaah ]h"]qaah$]h&]uh1hhhhhhhhKubeh}(h]linux-power-supply-classah ]h"]linux power supply classah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjP error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j+ j( jjjljijjjE jB j j j j j# j u nametypes}(j+ jjljjE j j j# uh}(j( hjhjijjjojB jj jH j j j j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.