Repository navigation
Commit 395a725
power: supply: sbs-battery: don't assume i2c errors as battery disconnect
Current sbs-battery considers all smbus errors as disconnection events
when battery-detect pin isn't supplied, and restored to present state back
when any successful transaction is made.
This can lead to unwanted state changes between present and !present
when there's one i2c error and other following commands were successful.
This patch provides a unified way of checking presence by calling
sbs_get_battery_presence_and_health() when detect pin is not used.
Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>1 parent f385e2f commit 395a725
1 file changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
966 | 973 | | |
967 | 974 | | |
968 | 975 | | |
| |||
1147 | 1154 | | |
1148 | 1155 | | |
1149 | 1156 | | |
1150 | | - | |
| 1157 | + | |
1151 | 1158 | | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1155 | 1164 | | |
1156 | 1165 | | |
1157 | 1166 | | |
| |||
0 commit comments