| max17042_battery |
| ~~~~~~~~~~~~~~~~ |
| |
| Required properties : |
| - compatible : "maxim,max17042" |
| |
| Optional properties : |
| - maxim,rsns-microohm : Resistance of rsns resistor in micro Ohms |
| (datasheet-recommended value is 10000). |
| Defining this property enables current-sense functionality. |
| |
| - maxim,regs-init-data : Initialization data for device registers specified as |
| register address and value pairs. |
| |
| - gpios : GPIOs used by the device, such as an interrupt line. |
| |
| - gpio-names : List of strings with GPIO names. |
| |
| - maxim,enable_por_init : Define this property to execute POR init from Maxim |
| appnote. |
| |
| - maxim,batt_undervoltage_zero_soc : Define this property to report "0" SOC |
| if and only if battery undervoltage interrupt has fired. |
| |
| Optional subnodes: |
| - maxim,configuration : Contains configuraiton data for POR initialization |
| of the device defined in Maxim appnote. This data is either specific to how |
| the host device is used or battery specific characteristic. |
| Optionally can be defrined as "maxim,configuration-<batt-id>" where batt-id |
| is set in /chosen path of yoru respective device tree. As a result, the driver |
| will load maxim,configuration-<batt-id> you specified. This will allow us |
| to use multiple battery suppliers within the same software binary. |
| NOTE: the length of this node should be less or equal to 64 bytes. |
| |
| - maxim,temp-conv : Contains a table to convert a value from Temperature |
| register to a "real" temp value. This conversion table should be used when |
| configuring tgain and toff is not sufficient to get accurate temperature |
| measurements. |
| |
| Required "maxim,configuration" node properties : |
| - version: version of the configuration data. Update revision to force |
| device being reprogramed without POR event. |
| - config : CONFIG register value (u16) specific to the device application. |
| - full_soc_thresh : FullSOCThr register value (u16). The appnote has a |
| recommended value. |
| - design_cap : DesignCap register value (u16)specific to the battery. |
| - ichgt_term : ICHGTerm register value (u16). The appnote has a recommended |
| value. |
| - learn_cfg : LearnCFG register value (u16). The appnote has a recommended |
| value. |
| - filter_cfg : FilterCFG register value (u16). The appnote has a recommended |
| value. |
| - relax_cfg : RelaxCFG register value (u16) specific to the device |
| application. |
| - fullcap : FullCAP register value (u16) specific to the battery. |
| - fullcapnom : FullCapNom register value (u16) specific to the battery. |
| - qrtbl00 : QResidual 00 register value (u16) specific to the battery. |
| - qrtbl10 : QResidual 10 register value (u16) specific to the battery. |
| - qrtbl20 : QResidual 20 register value (u16) specific to the battery. |
| - qrtbl30 : QResidual 30 register value (u16) specific to the battery. |
| - rcomp0 : RCOMP0 register value (u16) specific to the battery. |
| - tcompc0 : TempCo register value (u16) specific to the battery. |
| - maxim,cell-char-tbl : Battery characterization table containing 48 words |
| (u16). |
| |
| Optional "maxim,configuration" node properties : |
| - tgain : TGAIN register value (u16) specific to the thermistor |
| - toff : TOFF register value (u16) specific to the thermistor |
| |
| Required "maxim,temp-conv" properties : |
| - start : Fuel gauge temperature value (u16) in C for the first element in |
| in the "result" table. |
| - result : Conversion table with temperature values (u16) in 1/10 C. The |
| result[0] corresponds to start temp, result[1] to (start + 1) temp, etc. |
| |
| Example: |
| |
| battery-charger@36 { |
| compatible = "maxim,max17042"; |
| reg = <0x36>; |
| maxim,rsns-microohm = <10000>; |
| maxim,regs-init-data = < |
| 0x01 0xffb4 /* VALRT, VMAX = 5.1V and VMIN = 3.6V */ |
| >; |
| gpios = <&gpio5 12 0x1>; |
| gpio-names = "alert-pin"; |
| maxim,enable_por_init; |
| maxim,batt_undervoltage_zero_soc; |
| maxim,configuration { |
| /* Required properties */ |
| config = /bits/ 16 <0x2250>; |
| full_soc_thresh = /bits/ 16 <0x5F00>; |
| design_cap = /bits/ 16 <320>; |
| ichgt_term = /bits/ 16 <0x0066>; |
| learn_cfg = /bits/ 16 <0x2606>; |
| filter_cfg = /bits/ 16 <0x87A4>; |
| relax_cfg = /bits/ 16 <0x016C>; |
| fullcap = /bits/ 16 <320>; |
| fullcapnom = /bits/ 16 <320>; |
| qrtbl00 = /bits/ 16 <0x1804>; |
| qrtbl10 = /bits/ 16 <0x0B00>; |
| qrtbl20 = /bits/ 16 <0x0700>; |
| qrtbl30 = /bits/ 16 <0x0600>; |
| rcomp0 = /bits/ 16 <0x0051>; |
| tcompc0 = /bits/ 16 <0x242E>; |
| maxim,cell-char-tbl = /bits/ 16 < |
| 0x9FB0 0xB5E0 0xB800 0xBA00 0xBB10 0xBC30 |
| 0xBC90 0xBD00 0xBDA0 0xBE40 0xBFA0 0xC250 |
| 0xC4C0 0xC7B0 0xCB70 0xCDD0 0x0100 0x0F10 |
| 0x1000 0x1300 0x1200 0x3CE0 0x3470 0x1BF0 |
| 0x1B90 0x1800 0x0C60 0x0DE0 0x0C80 0x0BF0 |
| 0x0450 0x0450 0x0080 0x0080 0x0080 0x0080 |
| 0x0080 0x0080 0x0080 0x0080 0x0080 0x0080 |
| 0x0080 0x0080 0x0080 0x0080 0x0080 0x0080 |
| >; |
| /* Optional properties */ |
| tgain = /bits/ 16 <0xE71C>; |
| toff = /bits/ 16 <0x251A>; |
| } |
| |
| /* optional you can define additional maxim,configuration-<batt-id> */ |
| /* the total length of the node name should not be bigger than 64 */ |
| /* bytes including null termination character. */ |
| /* maxim,configuration-SNN5951A { */ |
| ... |
| ... |
| } |
| |
| maxim,temp-conv { |
| start = /bits/ 16 <(-20)>; /* in degrees C */ |
| result = /bits/ 16 < /* in 1/10 degrees C */ |
| (-302) (-271) (-246) (-222) (-202) (-180) (-162) (-147) (-129) (-114) |
| (-101) (-86) (-72) (-59) (-48) (-35) (-23) (-12) (-2) 10 |
| 22 32 42 51 62 72 82 91 99 110 |
| 120 129 138 146 156 165 175 184 192 200 |
| 210 220 230 238 247 256 266 275 285 294 |
| 303 313 324 333 343 353 364 375 385 395 |
| 407 419 430 441 453 466 479 492 505 520 |
| 534 548 565 581 597 616 635 654 676 697 |
| 721 747 775 800 |
| >; |
| }; |
| }; |