power: supply: bq2415x: add DT referencing support

Add support for using bq2415x together with power_supply_am_i_supplied().

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
Sebastian Reichel 2018-02-21 12:42:20 +01:00 committed by Sebastian Reichel
parent f451655c72
commit 90ad4cc203
1 changed files with 4 additions and 1 deletions

View File

@ -1037,7 +1037,10 @@ static int bq2415x_power_supply_init(struct bq2415x_device *bq)
int ret;
int chip;
char revstr[8];
struct power_supply_config psy_cfg = { .drv_data = bq, };
struct power_supply_config psy_cfg = {
.drv_data = bq,
.of_node = bq->dev->of_node,
};
bq->charger_desc.name = bq->name;
bq->charger_desc.type = POWER_SUPPLY_TYPE_USB;