diff options
Diffstat (limited to 'drivers/power/charger-manager.c')
-rw-r--r-- | drivers/power/charger-manager.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index df27600880b9..a5b86b60d244 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c | |||
@@ -103,8 +103,8 @@ static bool is_batt_present(struct charger_manager *cm) | |||
103 | if (!psy) | 103 | if (!psy) |
104 | break; | 104 | break; |
105 | 105 | ||
106 | ret = psy->get_property(psy, | 106 | ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, |
107 | POWER_SUPPLY_PROP_PRESENT, &val); | 107 | &val); |
108 | if (ret == 0 && val.intval) | 108 | if (ret == 0 && val.intval) |
109 | present = true; | 109 | present = true; |
110 | break; | 110 | break; |
@@ -118,8 +118,8 @@ static bool is_batt_present(struct charger_manager *cm) | |||
118 | continue; | 118 | continue; |
119 | } | 119 | } |
120 | 120 | ||
121 | ret = psy->get_property(psy, POWER_SUPPLY_PROP_PRESENT, | 121 | ret = power_supply_get_property(psy, |
122 | &val); | 122 | POWER_SUPPLY_PROP_PRESENT, &val); |
123 | if (ret == 0 && val.intval) { | 123 | if (ret == 0 && val.intval) { |
124 | present = true; | 124 | present = true; |
125 | break; | 125 | break; |
@@ -155,7 +155,8 @@ static bool is_ext_pwr_online(struct charger_manager *cm) | |||
155 | continue; | 155 | continue; |
156 | } | 156 | } |
157 | 157 | ||
158 | ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val); | 158 | ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE, |
159 | &val); | ||
159 | if (ret == 0 && val.intval) { | 160 | if (ret == 0 && val.intval) { |
160 | online = true; | 161 | online = true; |
161 | break; | 162 | break; |
@@ -183,7 +184,7 @@ static int get_batt_uV(struct charger_manager *cm, int *uV) | |||
183 | if (!fuel_gauge) | 184 | if (!fuel_gauge) |
184 | return -ENODEV; | 185 | return -ENODEV; |
185 | 186 | ||
186 | ret = fuel_gauge->get_property(fuel_gauge, | 187 | ret = power_supply_get_property(fuel_gauge, |
187 | POWER_SUPPLY_PROP_VOLTAGE_NOW, &val); | 188 | POWER_SUPPLY_PROP_VOLTAGE_NOW, &val); |
188 | if (ret) | 189 | if (ret) |
189 | return ret; | 190 | return ret; |
@@ -223,7 +224,8 @@ static bool is_charging(struct charger_manager *cm) | |||
223 | } | 224 | } |
224 | 225 | ||
225 | /* 2. The charger should be online (ext-power) */ | 226 | /* 2. The charger should be online (ext-power) */ |
226 | ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val); | 227 | ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE, |
228 | &val); | ||
227 | if (ret) { | 229 | if (ret) { |
228 | dev_warn(cm->dev, "Cannot read ONLINE value from %s\n", | 230 | dev_warn(cm->dev, "Cannot read ONLINE value from %s\n", |
229 | cm->desc->psy_charger_stat[i]); | 231 | cm->desc->psy_charger_stat[i]); |
@@ -236,7 +238,8 @@ static bool is_charging(struct charger_manager *cm) | |||
236 | * 3. The charger should not be FULL, DISCHARGING, | 238 | * 3. The charger should not be FULL, DISCHARGING, |
237 | * or NOT_CHARGING. | 239 | * or NOT_CHARGING. |
238 | */ | 240 | */ |
239 | ret = psy->get_property(psy, POWER_SUPPLY_PROP_STATUS, &val); | 241 | ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_STATUS, |
242 | &val); | ||
240 | if (ret) { | 243 | if (ret) { |
241 | dev_warn(cm->dev, "Cannot read STATUS value from %s\n", | 244 | dev_warn(cm->dev, "Cannot read STATUS value from %s\n", |
242 | cm->desc->psy_charger_stat[i]); | 245 | cm->desc->psy_charger_stat[i]); |
@@ -279,7 +282,7 @@ static bool is_full_charged(struct charger_manager *cm) | |||
279 | val.intval = 0; | 282 | val.intval = 0; |
280 | 283 | ||
281 | /* Not full if capacity of fuel gauge isn't full */ | 284 | /* Not full if capacity of fuel gauge isn't full */ |
282 | ret = fuel_gauge->get_property(fuel_gauge, | 285 | ret = power_supply_get_property(fuel_gauge, |
283 | POWER_SUPPLY_PROP_CHARGE_FULL, &val); | 286 | POWER_SUPPLY_PROP_CHARGE_FULL, &val); |
284 | if (!ret && val.intval > desc->fullbatt_full_capacity) | 287 | if (!ret && val.intval > desc->fullbatt_full_capacity) |
285 | return true; | 288 | return true; |
@@ -296,7 +299,7 @@ static bool is_full_charged(struct charger_manager *cm) | |||
296 | if (desc->fullbatt_soc > 0) { | 299 | if (desc->fullbatt_soc > 0) { |
297 | val.intval = 0; | 300 | val.intval = 0; |
298 | 301 | ||
299 | ret = fuel_gauge->get_property(fuel_gauge, | 302 | ret = power_supply_get_property(fuel_gauge, |
300 | POWER_SUPPLY_PROP_CAPACITY, &val); | 303 | POWER_SUPPLY_PROP_CAPACITY, &val); |
301 | if (!ret && val.intval >= desc->fullbatt_soc) | 304 | if (!ret && val.intval >= desc->fullbatt_soc) |
302 | return true; | 305 | return true; |
@@ -580,7 +583,7 @@ static int cm_get_battery_temperature_by_psy(struct charger_manager *cm, | |||
580 | if (!fuel_gauge) | 583 | if (!fuel_gauge) |
581 | return -ENODEV; | 584 | return -ENODEV; |
582 | 585 | ||
583 | return fuel_gauge->get_property(fuel_gauge, | 586 | return power_supply_get_property(fuel_gauge, |
584 | POWER_SUPPLY_PROP_TEMP, | 587 | POWER_SUPPLY_PROP_TEMP, |
585 | (union power_supply_propval *)temp); | 588 | (union power_supply_propval *)temp); |
586 | } | 589 | } |
@@ -900,7 +903,7 @@ static int charger_get_property(struct power_supply *psy, | |||
900 | ret = -ENODEV; | 903 | ret = -ENODEV; |
901 | break; | 904 | break; |
902 | } | 905 | } |
903 | ret = fuel_gauge->get_property(fuel_gauge, | 906 | ret = power_supply_get_property(fuel_gauge, |
904 | POWER_SUPPLY_PROP_CURRENT_NOW, val); | 907 | POWER_SUPPLY_PROP_CURRENT_NOW, val); |
905 | break; | 908 | break; |
906 | case POWER_SUPPLY_PROP_TEMP: | 909 | case POWER_SUPPLY_PROP_TEMP: |
@@ -919,7 +922,7 @@ static int charger_get_property(struct power_supply *psy, | |||
919 | break; | 922 | break; |
920 | } | 923 | } |
921 | 924 | ||
922 | ret = fuel_gauge->get_property(fuel_gauge, | 925 | ret = power_supply_get_property(fuel_gauge, |
923 | POWER_SUPPLY_PROP_CAPACITY, val); | 926 | POWER_SUPPLY_PROP_CAPACITY, val); |
924 | if (ret) | 927 | if (ret) |
925 | break; | 928 | break; |
@@ -975,7 +978,7 @@ static int charger_get_property(struct power_supply *psy, | |||
975 | break; | 978 | break; |
976 | } | 979 | } |
977 | 980 | ||
978 | ret = fuel_gauge->get_property(fuel_gauge, | 981 | ret = power_supply_get_property(fuel_gauge, |
979 | POWER_SUPPLY_PROP_CHARGE_NOW, | 982 | POWER_SUPPLY_PROP_CHARGE_NOW, |
980 | val); | 983 | val); |
981 | if (ret) { | 984 | if (ret) { |
@@ -1424,7 +1427,7 @@ static int cm_init_thermal_data(struct charger_manager *cm, | |||
1424 | int ret; | 1427 | int ret; |
1425 | 1428 | ||
1426 | /* Verify whether fuel gauge provides battery temperature */ | 1429 | /* Verify whether fuel gauge provides battery temperature */ |
1427 | ret = fuel_gauge->get_property(fuel_gauge, | 1430 | ret = power_supply_get_property(fuel_gauge, |
1428 | POWER_SUPPLY_PROP_TEMP, &val); | 1431 | POWER_SUPPLY_PROP_TEMP, &val); |
1429 | 1432 | ||
1430 | if (!ret) { | 1433 | if (!ret) { |
@@ -1718,13 +1721,13 @@ static int charger_manager_probe(struct platform_device *pdev) | |||
1718 | cm->charger_psy.num_properties = psy_default.num_properties; | 1721 | cm->charger_psy.num_properties = psy_default.num_properties; |
1719 | 1722 | ||
1720 | /* Find which optional psy-properties are available */ | 1723 | /* Find which optional psy-properties are available */ |
1721 | if (!fuel_gauge->get_property(fuel_gauge, | 1724 | if (!power_supply_get_property(fuel_gauge, |
1722 | POWER_SUPPLY_PROP_CHARGE_NOW, &val)) { | 1725 | POWER_SUPPLY_PROP_CHARGE_NOW, &val)) { |
1723 | cm->charger_psy.properties[cm->charger_psy.num_properties] = | 1726 | cm->charger_psy.properties[cm->charger_psy.num_properties] = |
1724 | POWER_SUPPLY_PROP_CHARGE_NOW; | 1727 | POWER_SUPPLY_PROP_CHARGE_NOW; |
1725 | cm->charger_psy.num_properties++; | 1728 | cm->charger_psy.num_properties++; |
1726 | } | 1729 | } |
1727 | if (!fuel_gauge->get_property(fuel_gauge, | 1730 | if (!power_supply_get_property(fuel_gauge, |
1728 | POWER_SUPPLY_PROP_CURRENT_NOW, | 1731 | POWER_SUPPLY_PROP_CURRENT_NOW, |
1729 | &val)) { | 1732 | &val)) { |
1730 | cm->charger_psy.properties[cm->charger_psy.num_properties] = | 1733 | cm->charger_psy.properties[cm->charger_psy.num_properties] = |