1. 15 Aug, 2012 7 commits
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-bms: use shutdown soc if it is within limits · 602dc279
      Abhijeet Dharmapurikar authored
      
      When a strong battery is removed, it was seen that the battery voltage
      lines on the phone take about five to six seconds to go below 2.1volts
      where the pmic resets all the battery backed registers.
      
      If a new battery is plugged in within this time the driver will force
      the shutdown soc on this battery which is incorrect.
      
      Compare the shutdown soc with the calculated soc and if they are
      different than a configurable limit, simply discard the shutdown soc
      and use the calculated soc.
      
      Change-Id: I02e7c78eb5e9df0127ce7e78b0bd9792a8141039
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      602dc279
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-bms: dont adjust at high battery capacity · 52daf656
      Abhijeet Dharmapurikar authored
      
      The adjusting algorithm was designed to prevent uvlo event towards
      low state of charge situations. It works by decreasing ocv so that the
      a lower soc is reported.
      
      When the battery is fully charged, we fake an ocv event, causing the
      ocv to jump to 100% and cc to 0. But after a few milliseconds when
      charging stops, the adjusting algorithm reduces the ocv which
      causes the SOC to jump from 100% to 99%.
      
      This jump from 100 to 99 is incorrect. Moreover we have seen quick
      decreases at high soc range because of the adjusting algorithm.
      To fix that and the 100 to 99% jumps simply don't run the adjusting
      algorithm when the battery soc is above 90%.
      
      Change-Id: I68e8bb72ec0e58552f9fedecceaffbf149c1f10e
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      52daf656
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-bms: iterate rbatt algorithm · 091c9eca
      Abhijeet Dharmapurikar authored
      
      When ocv (open circuit voltage of the battery) is adjusted to match a
      specific soc, rbatt (the battery resistance) changes too. This is
      because rbatt is dependent on the remaining charge which changes as
      the ocv changes.
      
      The issue we observed with this changing rbatt was the unusable charge
      changes which causes the soc to move away from the soc the algorithm
      attempts to match.
      
      To get around this issue adjust both the rbatt and ocv in a iterative
      fashion until rbatt value stabilizes.
      
      Change-Id: Id3e36c1a8361a6d71b63fca3e6b0c2a4a9bb7e06
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      091c9eca
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-bms: use background work to calculate soc · 41b46cd6
      Abhijeet Dharmapurikar authored
      
      The soc (state of charge) calculation algorithms and the associated
      adjusting algorithms were coded assuming that the soc will be queried
      at distant intervals (more than 20 seconds).
      
      However this assumption is bad and soc can be queried at sub second
      intervals. These soc queries in quick succession causes the adjusting
      algorithm to over correct the battery voltage.
      
      Separate the soc calculation from the soc reporting - calculate soc
      at specific intervals, while the reporting uses the values resulting
      from the latest calculation. This way the adjusting algorithms run
      at specified intervals and are not perturbed by the sub second querying
      for soc.
      
      Change-Id: I240bfdbd3ae3b2e37ae16cc3757a25f5a918e972
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      41b46cd6
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-bms: adjust rbatt and ocv both for shutdown soc · 6f42a23c
      Abhijeet Dharmapurikar authored
      
      When ocv (open circuit voltage of the battery) is adjusted to match a
      specific soc, rbatt (the battery resistance) changes too. This is because
      rbatt is dependent on the remaining charge which changes as the ocv
      changes.
      
      The issue we observed with this changing rbatt was the unusable charge
      changes which causes the soc to move away from the soc the algorithm
      attempts to match.
      
      To get around this issue adjust both the rbatt and ocv when we want to
      match a soc for a specific soc.
      
      Change-Id: Ifa8efe1e37b9982d6d67730f911e47e369e9b4ff
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      6f42a23c
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-charger: increase hearbeat if battery is low · de9c7e7a
      Abhijeet Dharmapurikar authored
      
      When the battery percent charge goes low we want to increase the
      frequency of state of charge updates. This helps the correction
      algorithm ample opportunities to correct the state of charge and
      prevent a low voltage shutdown.
      
      Change-Id: Ie846350ee4c1fd70198d28646779b20349134ef7
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      de9c7e7a
    • Abhijeet Dharmapurikar's avatar
      power: pm8921-bms: increase soc slowly while charging · 647d0f89
      Abhijeet Dharmapurikar authored
      
      It could happen that the calculated soc was higher than the reported
      soc even when a charger is not plugged in. This usually happens when
      the battery temperature increases or the average current changes causing
      unusable charge to go low. The current code never reports this high soc
      unless a charger is plugged in.
      
      However at the instant when charger is plugged in, the driver reports
      that high calculated soc. This jump in soc in an instant is
      unacceptable.
      
      Slowly increase the reported soc so that it approaches the calculated
      soc while charging. Basically we are playing catchup between reported
      soc and calculated soc. The catch up time is based on how big the
      difference between calculated soc and reported soc is - we allow
      60 seconds per percent delta.
      
      Change-Id: Ic1ae741c23ea596a46ca2cd49b58c75cf773c3e5
      Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
      647d0f89
  2. 13 Aug, 2012 19 commits
  3. 12 Aug, 2012 14 commits