From 4e9498b835ab31b83fc32fae4f77426f668010ac Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 28 Nov 2022 10:28:54 +0100 Subject: power: supply: bq25890: Support boards with more then one charger IC Some devices, such as the Lenovo Yoga Tab 3 Pro (YT3-X90F) have multiple batteries with a separate bq25890 charger for each battery. This requires the bq25890_charger code to use a unique name per registered power_supply class device, rather then hardcoding "bq25890-charger" as power_supply class device name. Add a "-%d" prefix to the name, allocated through idr in the same way as several other power_supply drivers are already doing this. Note this also updates: drivers/platform/x86/x86-android-tablets.c which refers to the charger by power_supply-class-device-name for the purpose of setting the "supplied-from" property on the fuel-gauge to this name. Reviewed-by: Marek Vasut Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel --- drivers/platform/x86/x86-android-tablets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/platform') diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c index 123a4618db55..111b007656fc 100644 --- a/drivers/platform/x86/x86-android-tablets.c +++ b/drivers/platform/x86/x86-android-tablets.c @@ -187,7 +187,7 @@ struct x86_dev_info { /* Generic / shared charger / battery settings */ static const char * const tusb1211_chg_det_psy[] = { "tusb1211-charger-detect" }; static const char * const bq24190_psy[] = { "bq24190-charger" }; -static const char * const bq25890_psy[] = { "bq25890-charger" }; +static const char * const bq25890_psy[] = { "bq25890-charger-0" }; static const struct property_entry fg_bq24190_supply_props[] = { PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_psy), -- cgit v1.2.3