@@ -147,8 +147,6 @@ struct max17040_chip {
147
147
148
148
/* battery capacity */
149
149
int soc ;
150
- /* State Of Charge */
151
- int status ;
152
150
/* Low alert threshold from 32% to 1% of the State of Charge */
153
151
u32 low_soc_alert ;
154
152
/* some devices return twice the capacity */
@@ -225,24 +223,6 @@ static int max17040_get_online(struct max17040_chip *chip)
225
223
chip -> pdata -> battery_online () : 1 ;
226
224
}
227
225
228
- static int max17040_get_status (struct max17040_chip * chip )
229
- {
230
- if (!chip -> pdata || !chip -> pdata -> charger_online
231
- || !chip -> pdata -> charger_enable )
232
- return POWER_SUPPLY_STATUS_UNKNOWN ;
233
-
234
- if (max17040_get_soc (chip ) > MAX17040_BATTERY_FULL )
235
- return POWER_SUPPLY_STATUS_FULL ;
236
-
237
- if (chip -> pdata -> charger_online ())
238
- if (chip -> pdata -> charger_enable ())
239
- return POWER_SUPPLY_STATUS_CHARGING ;
240
- else
241
- return POWER_SUPPLY_STATUS_NOT_CHARGING ;
242
- else
243
- return POWER_SUPPLY_STATUS_DISCHARGING ;
244
- }
245
-
246
226
static int max17040_get_of_data (struct max17040_chip * chip )
247
227
{
248
228
struct device * dev = & chip -> client -> dev ;
@@ -283,7 +263,6 @@ static int max17040_get_of_data(struct max17040_chip *chip)
283
263
static void max17040_check_changes (struct max17040_chip * chip )
284
264
{
285
265
chip -> soc = max17040_get_soc (chip );
286
- chip -> status = max17040_get_status (chip );
287
266
}
288
267
289
268
static void max17040_queue_work (struct max17040_chip * chip )
@@ -302,17 +281,16 @@ static void max17040_stop_work(void *data)
302
281
static void max17040_work (struct work_struct * work )
303
282
{
304
283
struct max17040_chip * chip ;
305
- int last_soc , last_status ;
284
+ int last_soc ;
306
285
307
286
chip = container_of (work , struct max17040_chip , work .work );
308
287
309
- /* store SOC and status to check changes */
288
+ /* store SOC to check changes */
310
289
last_soc = chip -> soc ;
311
- last_status = chip -> status ;
312
290
max17040_check_changes (chip );
313
291
314
292
/* check changes and send uevent */
315
- if (last_soc != chip -> soc || last_status != chip -> status )
293
+ if (last_soc != chip -> soc )
316
294
power_supply_changed (chip -> battery );
317
295
318
296
max17040_queue_work (chip );
@@ -413,9 +391,6 @@ static int max17040_get_property(struct power_supply *psy,
413
391
struct max17040_chip * chip = power_supply_get_drvdata (psy );
414
392
415
393
switch (psp ) {
416
- case POWER_SUPPLY_PROP_STATUS :
417
- val -> intval = max17040_get_status (chip );
418
- break ;
419
394
case POWER_SUPPLY_PROP_ONLINE :
420
395
val -> intval = max17040_get_online (chip );
421
396
break ;
@@ -442,7 +417,6 @@ static const struct regmap_config max17040_regmap = {
442
417
};
443
418
444
419
static enum power_supply_property max17040_battery_props [] = {
445
- POWER_SUPPLY_PROP_STATUS ,
446
420
POWER_SUPPLY_PROP_ONLINE ,
447
421
POWER_SUPPLY_PROP_VOLTAGE_NOW ,
448
422
POWER_SUPPLY_PROP_CAPACITY ,
0 commit comments