@@ -1323,6 +1323,7 @@ static int smb2_init_wireless_psy(struct smb2 *chip)
1323
1323
*************************/
1324
1324
1325
1325
static enum power_supply_property smb2_batt_props [] = {
1326
+ POWER_SUPPLY_PROP_CHARGING_ENABLED ,
1326
1327
POWER_SUPPLY_PROP_INPUT_SUSPEND ,
1327
1328
POWER_SUPPLY_PROP_STATUS ,
1328
1329
POWER_SUPPLY_PROP_HEALTH ,
@@ -1380,6 +1381,9 @@ static int smb2_batt_get_prop(struct power_supply *psy,
1380
1381
case POWER_SUPPLY_PROP_PRESENT :
1381
1382
rc = smblib_get_prop_batt_present (chg , val );
1382
1383
break ;
1384
+ case POWER_SUPPLY_PROP_CHARGING_ENABLED :
1385
+ val -> intval = !get_effective_result (chg -> chg_disable_votable );
1386
+ break ;
1383
1387
case POWER_SUPPLY_PROP_INPUT_SUSPEND :
1384
1388
rc = smblib_get_prop_input_suspend (chg , val );
1385
1389
break ;
@@ -1516,6 +1520,9 @@ static int smb2_batt_set_prop(struct power_supply *psy,
1516
1520
case POWER_SUPPLY_PROP_STATUS :
1517
1521
rc = smblib_set_prop_batt_status (chg , val );
1518
1522
break ;
1523
+ case POWER_SUPPLY_PROP_CHARGING_ENABLED :
1524
+ vote (chg -> chg_disable_votable , USER_VOTER , !!!val -> intval , 0 );
1525
+ break ;
1519
1526
case POWER_SUPPLY_PROP_INPUT_SUSPEND :
1520
1527
rc = smblib_set_prop_input_suspend (chg , val );
1521
1528
break ;
@@ -1611,6 +1618,7 @@ static int smb2_batt_prop_is_writeable(struct power_supply *psy,
1611
1618
{
1612
1619
switch (psp ) {
1613
1620
case POWER_SUPPLY_PROP_STATUS :
1621
+ case POWER_SUPPLY_PROP_CHARGING_ENABLED :
1614
1622
case POWER_SUPPLY_PROP_INPUT_SUSPEND :
1615
1623
case POWER_SUPPLY_PROP_SYSTEM_TEMP_LEVEL :
1616
1624
case POWER_SUPPLY_PROP_CAPACITY :
0 commit comments