Skip to content

Commit eb52430

Browse files
committed
power: supply: ln8411: Exposes input sources ADC readings
Reports VUSB and VWPC to the respective node's VOLTAGE_NOW property. Change-Id: Ia42788438b87cce841b7c406bf88ea4d9e98a5ea Signed-off-by: Ricardo Rivera-Matos <[email protected]>
1 parent 7a99d9f commit eb52430

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/power/supply/ln8411_charger.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,8 @@ static int ln8411_get_wpc_property(struct power_supply *psy,
12501250
val->intval = false;
12511251
}
12521252
break;
1253+
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
1254+
return ln8411_get_adc(ln8411, LN8411_ADC_CHAN_VWPC, &val->intval);
12531255
default:
12541256
return -EINVAL;
12551257
}
@@ -1328,6 +1330,8 @@ static int ln8411_get_usb_property(struct power_supply *psy,
13281330
val->intval = false;
13291331
}
13301332
break;
1333+
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
1334+
return ln8411_get_adc(ln8411, LN8411_ADC_CHAN_VUSB, &val->intval);
13311335
default:
13321336
return -EINVAL;
13331337
}
@@ -1360,6 +1364,7 @@ static enum power_supply_property ln8411_input_props[] = {
13601364
POWER_SUPPLY_PROP_VOLTAGE_MAX,
13611365
POWER_SUPPLY_PROP_CURRENT_MAX,
13621366
POWER_SUPPLY_PROP_ONLINE,
1367+
POWER_SUPPLY_PROP_VOLTAGE_NOW,
13631368
};
13641369

13651370
static struct power_supply_desc ln8411_wpc_desc = {

0 commit comments

Comments
 (0)