summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-02-06 23:02:17 +0100
committerHans de Goede <hdegoede@redhat.com>2022-02-11 10:52:56 +0100
commit5030e8d9ff0d58e6c0fa3b6447b653e192536a5f (patch)
tree07069097de4350f4f790e19b96457566a45d9564 /drivers/platform
parentplatform/x86: x86-android-tablets: Add Nextbook Ares 8 data (diff)
downloadlinux-5030e8d9ff0d58e6c0fa3b6447b653e192536a5f.tar.xz
linux-5030e8d9ff0d58e6c0fa3b6447b653e192536a5f.zip
platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements
Minor charger / fuel-gauge improvements: 1. Make some of the names of charger / fuel-gauge related globals more generic in preparation for also using them on other boards. 2. Update the dev_name on the Asus ME176C and TF103C to reflect that these are using the bq24297 variant of the bq24190 family. 3. During review of the ug3105 driver the "upi,rsns-microohm" property was renamed to "upisemi,rsns-microohm" as "upisemi" is the correct vendor prefix, update the ug3105 properties accordingly. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220206220220.88491-1-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/x86-android-tablets.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c
index 838d667126e5..8e6e4f89220f 100644
--- a/drivers/platform/x86/x86-android-tablets.c
+++ b/drivers/platform/x86/x86-android-tablets.c
@@ -172,8 +172,18 @@ struct x86_dev_info {
};
/* Generic / shared charger / battery settings */
-static const char * const bq24190_suppliers[] = { "tusb1211-charger-detect" };
-static const char * const ug3105_suppliers[] = { "bq24190-charger" };
+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 struct property_entry fg_bq25890_supply_props[] = {
+ PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq25890_psy),
+ { }
+};
+
+static const struct software_node fg_bq25890_supply_node = {
+ .properties = fg_bq25890_supply_props,
+};
/* LiPo HighVoltage (max 4.35V) settings used by most devs with a HV bat. */
static const struct property_entry generic_lipo_hv_4v35_battery_props[] = {
@@ -295,7 +305,7 @@ static const struct software_node asus_me176c_accel_node = {
};
static const struct property_entry asus_me176c_bq24190_props[] = {
- PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_suppliers),
+ PROPERTY_ENTRY_STRING_ARRAY("supplied-from", tusb1211_chg_det_psy),
PROPERTY_ENTRY_REF("monitored-battery", &generic_lipo_hv_4v35_battery_node),
PROPERTY_ENTRY_U32("ti,system-minimum-microvolt", 3600000),
PROPERTY_ENTRY_BOOL("omit-battery-class"),
@@ -308,9 +318,9 @@ static const struct software_node asus_me176c_bq24190_node = {
};
static const struct property_entry asus_me176c_ug3105_props[] = {
- PROPERTY_ENTRY_STRING_ARRAY("supplied-from", ug3105_suppliers),
+ PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_psy),
PROPERTY_ENTRY_REF("monitored-battery", &generic_lipo_hv_4v35_battery_node),
- PROPERTY_ENTRY_U32("upi,rsns-microohm", 10000),
+ PROPERTY_ENTRY_U32("upisemi,rsns-microohm", 10000),
{ }
};
@@ -320,11 +330,11 @@ static const struct software_node asus_me176c_ug3105_node = {
static const struct x86_i2c_client_info asus_me176c_i2c_clients[] __initconst = {
{
- /* bq24190 battery charger */
+ /* bq24297 battery charger */
.board_info = {
.type = "bq24190",
.addr = 0x6b,
- .dev_name = "bq24190",
+ .dev_name = "bq24297",
.swnode = &asus_me176c_bq24190_node,
.platform_data = &bq24190_pdata,
},
@@ -463,7 +473,7 @@ static const struct software_node asus_tf103c_battery_node = {
};
static const struct property_entry asus_tf103c_bq24190_props[] = {
- PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_suppliers),
+ PROPERTY_ENTRY_STRING_ARRAY("supplied-from", tusb1211_chg_det_psy),
PROPERTY_ENTRY_REF("monitored-battery", &asus_tf103c_battery_node),
PROPERTY_ENTRY_U32("ti,system-minimum-microvolt", 3600000),
PROPERTY_ENTRY_BOOL("omit-battery-class"),
@@ -476,9 +486,9 @@ static const struct software_node asus_tf103c_bq24190_node = {
};
static const struct property_entry asus_tf103c_ug3105_props[] = {
- PROPERTY_ENTRY_STRING_ARRAY("supplied-from", ug3105_suppliers),
+ PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_psy),
PROPERTY_ENTRY_REF("monitored-battery", &asus_tf103c_battery_node),
- PROPERTY_ENTRY_U32("upi,rsns-microohm", 5000),
+ PROPERTY_ENTRY_U32("upisemi,rsns-microohm", 5000),
{ }
};
@@ -488,11 +498,11 @@ static const struct software_node asus_tf103c_ug3105_node = {
static const struct x86_i2c_client_info asus_tf103c_i2c_clients[] __initconst = {
{
- /* bq24190 battery charger */
+ /* bq24297 battery charger */
.board_info = {
.type = "bq24190",
.addr = 0x6b,
- .dev_name = "bq24190",
+ .dev_name = "bq24297",
.swnode = &asus_tf103c_bq24190_node,
.platform_data = &bq24190_pdata,
},
@@ -834,17 +844,6 @@ static const struct x86_dev_info whitelabel_tm800a550l_info __initconst = {
*
* This takes care of instantiating the hidden devices manually.
*/
-static const char * const bq27520_suppliers[] = { "bq25890-charger" };
-
-static const struct property_entry bq27520_props[] = {
- PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq27520_suppliers),
- { }
-};
-
-static const struct software_node bq27520_node = {
- .properties = bq27520_props,
-};
-
static const struct x86_i2c_client_info xiaomi_mipad2_i2c_clients[] __initconst = {
{
/* BQ27520 fuel-gauge */
@@ -852,7 +851,7 @@ static const struct x86_i2c_client_info xiaomi_mipad2_i2c_clients[] __initconst
.type = "bq27520",
.addr = 0x55,
.dev_name = "bq27520",
- .swnode = &bq27520_node,
+ .swnode = &fg_bq25890_supply_node,
},
.adapter_path = "\\_SB_.PCI0.I2C1",
}, {