| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) ST-Ericsson SA 2012 |
|---|
| 3 | 4 | * Copyright (c) 2012 Sony Mobile Communications AB |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Charging algorithm driver for abx500 variants |
|---|
| 6 | 7 | * |
|---|
| 7 | | - * License Terms: GNU General Public License v2 |
|---|
| 8 | 8 | * Authors: |
|---|
| 9 | 9 | * Johan Palsson <johan.palsson@stericsson.com> |
|---|
| 10 | 10 | * Karl Komierowski <karl.komierowski@stericsson.com> |
|---|
| .. | .. |
|---|
| 354 | 354 | |
|---|
| 355 | 355 | if (di->chg_info.charger_type & USB_CHG) { |
|---|
| 356 | 356 | return di->usb_chg->ops.check_enable(di->usb_chg, |
|---|
| 357 | | - di->bm->bat_type[di->bm->batt_id].normal_vol_lvl, |
|---|
| 358 | | - di->bm->bat_type[di->bm->batt_id].normal_cur_lvl); |
|---|
| 357 | + di->bm->bat_type[di->bm->batt_id].normal_vol_lvl, |
|---|
| 358 | + di->bm->bat_type[di->bm->batt_id].normal_cur_lvl); |
|---|
| 359 | 359 | } else if ((di->chg_info.charger_type & AC_CHG) && |
|---|
| 360 | 360 | !(di->ac_chg->external)) { |
|---|
| 361 | 361 | return di->ac_chg->ops.check_enable(di->ac_chg, |
|---|
| 362 | | - di->bm->bat_type[di->bm->batt_id].normal_vol_lvl, |
|---|
| 363 | | - di->bm->bat_type[di->bm->batt_id].normal_cur_lvl); |
|---|
| 362 | + di->bm->bat_type[di->bm->batt_id].normal_vol_lvl, |
|---|
| 363 | + di->bm->bat_type[di->bm->batt_id].normal_cur_lvl); |
|---|
| 364 | 364 | } |
|---|
| 365 | 365 | return 0; |
|---|
| 366 | 366 | } |
|---|
| .. | .. |
|---|
| 1419 | 1419 | abx500_chargalg_stop_charging(di); |
|---|
| 1420 | 1420 | di->charge_status = POWER_SUPPLY_STATUS_DISCHARGING; |
|---|
| 1421 | 1421 | abx500_chargalg_state_to(di, STATE_HANDHELD); |
|---|
| 1422 | | - /* Intentional fallthrough */ |
|---|
| 1422 | + fallthrough; |
|---|
| 1423 | 1423 | |
|---|
| 1424 | 1424 | case STATE_HANDHELD: |
|---|
| 1425 | 1425 | break; |
|---|
| .. | .. |
|---|
| 1435 | 1435 | di->maintenance_chg = false; |
|---|
| 1436 | 1436 | abx500_chargalg_state_to(di, STATE_SUSPENDED); |
|---|
| 1437 | 1437 | power_supply_changed(di->chargalg_psy); |
|---|
| 1438 | | - /* Intentional fallthrough */ |
|---|
| 1438 | + fallthrough; |
|---|
| 1439 | 1439 | |
|---|
| 1440 | 1440 | case STATE_SUSPENDED: |
|---|
| 1441 | 1441 | /* CHARGING is suspended */ |
|---|
| .. | .. |
|---|
| 1444 | 1444 | case STATE_BATT_REMOVED_INIT: |
|---|
| 1445 | 1445 | abx500_chargalg_stop_charging(di); |
|---|
| 1446 | 1446 | abx500_chargalg_state_to(di, STATE_BATT_REMOVED); |
|---|
| 1447 | | - /* Intentional fallthrough */ |
|---|
| 1447 | + fallthrough; |
|---|
| 1448 | 1448 | |
|---|
| 1449 | 1449 | case STATE_BATT_REMOVED: |
|---|
| 1450 | 1450 | if (!di->events.batt_rem) |
|---|
| .. | .. |
|---|
| 1454 | 1454 | case STATE_HW_TEMP_PROTECT_INIT: |
|---|
| 1455 | 1455 | abx500_chargalg_stop_charging(di); |
|---|
| 1456 | 1456 | abx500_chargalg_state_to(di, STATE_HW_TEMP_PROTECT); |
|---|
| 1457 | | - /* Intentional fallthrough */ |
|---|
| 1457 | + fallthrough; |
|---|
| 1458 | 1458 | |
|---|
| 1459 | 1459 | case STATE_HW_TEMP_PROTECT: |
|---|
| 1460 | 1460 | if (!di->events.main_thermal_prot && |
|---|
| .. | .. |
|---|
| 1465 | 1465 | case STATE_OVV_PROTECT_INIT: |
|---|
| 1466 | 1466 | abx500_chargalg_stop_charging(di); |
|---|
| 1467 | 1467 | abx500_chargalg_state_to(di, STATE_OVV_PROTECT); |
|---|
| 1468 | | - /* Intentional fallthrough */ |
|---|
| 1468 | + fallthrough; |
|---|
| 1469 | 1469 | |
|---|
| 1470 | 1470 | case STATE_OVV_PROTECT: |
|---|
| 1471 | 1471 | if (!di->events.vbus_ovv && |
|---|
| .. | .. |
|---|
| 1479 | 1479 | case STATE_CHG_NOT_OK_INIT: |
|---|
| 1480 | 1480 | abx500_chargalg_stop_charging(di); |
|---|
| 1481 | 1481 | abx500_chargalg_state_to(di, STATE_CHG_NOT_OK); |
|---|
| 1482 | | - /* Intentional fallthrough */ |
|---|
| 1482 | + fallthrough; |
|---|
| 1483 | 1483 | |
|---|
| 1484 | 1484 | case STATE_CHG_NOT_OK: |
|---|
| 1485 | 1485 | if (!di->events.mainextchnotok && |
|---|
| .. | .. |
|---|
| 1490 | 1490 | case STATE_SAFETY_TIMER_EXPIRED_INIT: |
|---|
| 1491 | 1491 | abx500_chargalg_stop_charging(di); |
|---|
| 1492 | 1492 | abx500_chargalg_state_to(di, STATE_SAFETY_TIMER_EXPIRED); |
|---|
| 1493 | | - /* Intentional fallthrough */ |
|---|
| 1493 | + fallthrough; |
|---|
| 1494 | 1494 | |
|---|
| 1495 | 1495 | case STATE_SAFETY_TIMER_EXPIRED: |
|---|
| 1496 | 1496 | /* We exit this state when charger is removed */ |
|---|
| .. | .. |
|---|
| 1537 | 1537 | case STATE_WAIT_FOR_RECHARGE_INIT: |
|---|
| 1538 | 1538 | abx500_chargalg_hold_charging(di); |
|---|
| 1539 | 1539 | abx500_chargalg_state_to(di, STATE_WAIT_FOR_RECHARGE); |
|---|
| 1540 | | - /* Intentional fallthrough */ |
|---|
| 1540 | + fallthrough; |
|---|
| 1541 | 1541 | |
|---|
| 1542 | 1542 | case STATE_WAIT_FOR_RECHARGE: |
|---|
| 1543 | 1543 | if (di->batt_data.percent <= |
|---|
| .. | .. |
|---|
| 1558 | 1558 | di->bm->batt_id].maint_a_cur_lvl); |
|---|
| 1559 | 1559 | abx500_chargalg_state_to(di, STATE_MAINTENANCE_A); |
|---|
| 1560 | 1560 | power_supply_changed(di->chargalg_psy); |
|---|
| 1561 | | - /* Intentional fallthrough*/ |
|---|
| 1561 | + fallthrough; |
|---|
| 1562 | 1562 | |
|---|
| 1563 | 1563 | case STATE_MAINTENANCE_A: |
|---|
| 1564 | 1564 | if (di->events.maintenance_timer_expired) { |
|---|
| .. | .. |
|---|
| 1578 | 1578 | di->bm->batt_id].maint_b_cur_lvl); |
|---|
| 1579 | 1579 | abx500_chargalg_state_to(di, STATE_MAINTENANCE_B); |
|---|
| 1580 | 1580 | power_supply_changed(di->chargalg_psy); |
|---|
| 1581 | | - /* Intentional fallthrough*/ |
|---|
| 1581 | + fallthrough; |
|---|
| 1582 | 1582 | |
|---|
| 1583 | 1583 | case STATE_MAINTENANCE_B: |
|---|
| 1584 | 1584 | if (di->events.maintenance_timer_expired) { |
|---|
| .. | .. |
|---|
| 1597 | 1597 | di->charge_status = POWER_SUPPLY_STATUS_CHARGING; |
|---|
| 1598 | 1598 | abx500_chargalg_state_to(di, STATE_TEMP_LOWHIGH); |
|---|
| 1599 | 1599 | power_supply_changed(di->chargalg_psy); |
|---|
| 1600 | | - /* Intentional fallthrough */ |
|---|
| 1600 | + fallthrough; |
|---|
| 1601 | 1601 | |
|---|
| 1602 | 1602 | case STATE_TEMP_LOWHIGH: |
|---|
| 1603 | 1603 | if (!di->events.btemp_lowhigh) |
|---|
| .. | .. |
|---|
| 1607 | 1607 | case STATE_WD_EXPIRED_INIT: |
|---|
| 1608 | 1608 | abx500_chargalg_stop_charging(di); |
|---|
| 1609 | 1609 | abx500_chargalg_state_to(di, STATE_WD_EXPIRED); |
|---|
| 1610 | | - /* Intentional fallthrough */ |
|---|
| 1610 | + fallthrough; |
|---|
| 1611 | 1611 | |
|---|
| 1612 | 1612 | case STATE_WD_EXPIRED: |
|---|
| 1613 | 1613 | if (!di->events.ac_wd_expired && |
|---|
| .. | .. |
|---|
| 1618 | 1618 | case STATE_TEMP_UNDEROVER_INIT: |
|---|
| 1619 | 1619 | abx500_chargalg_stop_charging(di); |
|---|
| 1620 | 1620 | abx500_chargalg_state_to(di, STATE_TEMP_UNDEROVER); |
|---|
| 1621 | | - /* Intentional fallthrough */ |
|---|
| 1621 | + fallthrough; |
|---|
| 1622 | 1622 | |
|---|
| 1623 | 1623 | case STATE_TEMP_UNDEROVER: |
|---|
| 1624 | 1624 | if (!di->events.btemp_underover) |
|---|
| .. | .. |
|---|
| 1823 | 1823 | "Enter 0. Disable AC/USB Charging\n" |
|---|
| 1824 | 1824 | "1. Enable AC charging\n" |
|---|
| 1825 | 1825 | "2. Enable USB Charging\n"); |
|---|
| 1826 | | - }; |
|---|
| 1826 | + } |
|---|
| 1827 | 1827 | return strlen(buf); |
|---|
| 1828 | 1828 | } |
|---|
| 1829 | 1829 | |
|---|