All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements
@ 2022-02-06 22:02 Hans de Goede
  2022-02-06 22:02 ` [PATCH 2/4] platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-06 22:02 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: Hans de Goede, platform-driver-x86

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>
---
 drivers/platform/x86/x86-android-tablets.c | 47 +++++++++++-----------
 1 file 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",
 	}, {
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading
  2022-02-06 22:02 [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
@ 2022-02-06 22:02 ` Hans de Goede
  2022-02-06 22:02 ` [PATCH 3/4] platform/x86: intel_cht_int33fe: Drop Lenovo Yogabook YB1-X9x code Hans de Goede
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-06 22:02 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: Hans de Goede, platform-driver-x86

The intel_cht_int33fe driver is intended to deal with ACPI INT33FE
firmware-nodes on Cherry Trail devices with a Whiskey Cove PMIC.

The original version of the driver only dealt with the GPD win and
GPD pocket boards where the WC PMIC is connected to a TI BQ24292i charger,
paired with a Maxim MAX17047 fuelgauge + a FUSB302 USB Type-C Controller +
a PI3USB30532 USB switch, for a fully functional Type-C port.

Later it was split into a Type-C and a Micro-B variant to deal with
the Lenovo Yoga Book YB1-X90 / Lenovo Yoga Book YB1-X91 boards where
the ACPI INT33FE firmware-node only describes the TI BQ27542 fuelgauge.

Currently the driver differentiates between these 2 models by counting
the number of I2cSerialBus resources in the firmware-node.

There are a number of problems with this approach:

1. The driver autoloads based on the acpi:INT33FE modalias causing it
to get loaded on almost all Bay Trail and Cherry Trail devices. It
checks for the presence of a WC PMIC, so it won't bind but the loading
still wastes time and memory.

2. Both code paths in the driver are really only designed for a single
board and have harcoded various assumptions about these boards, if
another design matching the current checks ever shows up the driver
may end up doing something completely wrong.

Avoid both issues by switching to using DMI based autoloading of
the module, which has neither of these problems.

Note this splits the previous intel_cht_int33fe kernel module into two
modules: intel_cht_int33fe_typec and intel_cht_int33fe_microb, one for
each model.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/intel/int33fe/Makefile   |   5 +-
 .../intel/int33fe/intel_cht_int33fe_common.c  | 118 ------------------
 .../intel/int33fe/intel_cht_int33fe_common.h  |  41 ------
 .../intel/int33fe/intel_cht_int33fe_microb.c  |  53 +++++++-
 .../intel/int33fe/intel_cht_int33fe_typec.c   |  65 +++++++++-
 5 files changed, 111 insertions(+), 171 deletions(-)
 delete mode 100644 drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c
 delete mode 100644 drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.h

diff --git a/drivers/platform/x86/intel/int33fe/Makefile b/drivers/platform/x86/intel/int33fe/Makefile
index 9456e3b37f6f..4672fcbec896 100644
--- a/drivers/platform/x86/intel/int33fe/Makefile
+++ b/drivers/platform/x86/intel/int33fe/Makefile
@@ -1,5 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_INTEL_CHT_INT33FE)		+= intel_cht_int33fe.o
-intel_cht_int33fe-y			:= intel_cht_int33fe_common.o \
-					   intel_cht_int33fe_typec.o \
-					   intel_cht_int33fe_microb.o
+obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe_typec.o intel_cht_int33fe_microb.o
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c
deleted file mode 100644
index 463222521e61..000000000000
--- a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.c
+++ /dev/null
@@ -1,118 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Common code for Intel Cherry Trail ACPI INT33FE pseudo device drivers
- * (USB Micro-B and Type-C connector variants).
- *
- * Copyright (c) 2019 Yauhen Kharuzhy <jekhor@gmail.com>
- */
-
-#include <linux/acpi.h>
-#include <linux/i2c.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-
-#include "intel_cht_int33fe_common.h"
-
-#define EXPECTED_PTYPE		4
-
-static int cht_int33fe_check_hw_type(struct device *dev)
-{
-	unsigned long long ptyp;
-	acpi_status status;
-	int ret;
-
-	status = acpi_evaluate_integer(ACPI_HANDLE(dev), "PTYP", NULL, &ptyp);
-	if (ACPI_FAILURE(status)) {
-		dev_err(dev, "Error getting PTYPE\n");
-		return -ENODEV;
-	}
-
-	/*
-	 * The same ACPI HID is used for different configurations check PTYP
-	 * to ensure that we are dealing with the expected config.
-	 */
-	if (ptyp != EXPECTED_PTYPE)
-		return -ENODEV;
-
-	/* Check presence of INT34D3 (hardware-rev 3) expected for ptype == 4 */
-	if (!acpi_dev_present("INT34D3", "1", 3)) {
-		dev_err(dev, "Error PTYPE == %d, but no INT34D3 device\n",
-			EXPECTED_PTYPE);
-		return -ENODEV;
-	}
-
-	ret = i2c_acpi_client_count(ACPI_COMPANION(dev));
-	if (ret < 0)
-		return ret;
-
-	switch (ret) {
-	case 2:
-		return INT33FE_HW_MICROB;
-	case 4:
-		return INT33FE_HW_TYPEC;
-	default:
-		return -ENODEV;
-	}
-}
-
-static int cht_int33fe_probe(struct platform_device *pdev)
-{
-	struct cht_int33fe_data *data;
-	struct device *dev = &pdev->dev;
-	int ret;
-
-	ret = cht_int33fe_check_hw_type(dev);
-	if (ret < 0)
-		return ret;
-
-	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
-		return -ENOMEM;
-
-	data->dev = dev;
-
-	switch (ret) {
-	case INT33FE_HW_MICROB:
-		data->probe = cht_int33fe_microb_probe;
-		data->remove = cht_int33fe_microb_remove;
-		break;
-
-	case INT33FE_HW_TYPEC:
-		data->probe = cht_int33fe_typec_probe;
-		data->remove = cht_int33fe_typec_remove;
-		break;
-	}
-
-	platform_set_drvdata(pdev, data);
-
-	return data->probe(data);
-}
-
-static int cht_int33fe_remove(struct platform_device *pdev)
-{
-	struct cht_int33fe_data *data = platform_get_drvdata(pdev);
-
-	return data->remove(data);
-}
-
-static const struct acpi_device_id cht_int33fe_acpi_ids[] = {
-	{ "INT33FE", },
-	{ }
-};
-MODULE_DEVICE_TABLE(acpi, cht_int33fe_acpi_ids);
-
-static struct platform_driver cht_int33fe_driver = {
-	.driver	= {
-		.name = "Intel Cherry Trail ACPI INT33FE driver",
-		.acpi_match_table = ACPI_PTR(cht_int33fe_acpi_ids),
-	},
-	.probe = cht_int33fe_probe,
-	.remove = cht_int33fe_remove,
-};
-
-module_platform_driver(cht_int33fe_driver);
-
-MODULE_DESCRIPTION("Intel Cherry Trail ACPI INT33FE pseudo device driver");
-MODULE_AUTHOR("Yauhen Kharuzhy <jekhor@gmail.com>");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.h b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.h
deleted file mode 100644
index 03cd45f4e8cb..000000000000
--- a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_common.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Common code for Intel Cherry Trail ACPI INT33FE pseudo device drivers
- * (USB Micro-B and Type-C connector variants), header file
- *
- * Copyright (c) 2019 Yauhen Kharuzhy <jekhor@gmail.com>
- */
-
-#ifndef _INTEL_CHT_INT33FE_COMMON_H
-#define _INTEL_CHT_INT33FE_COMMON_H
-
-#include <linux/device.h>
-#include <linux/fwnode.h>
-#include <linux/i2c.h>
-
-enum int33fe_hw_type {
-	INT33FE_HW_MICROB,
-	INT33FE_HW_TYPEC,
-};
-
-struct cht_int33fe_data {
-	struct device *dev;
-
-	int (*probe)(struct cht_int33fe_data *data);
-	int (*remove)(struct cht_int33fe_data *data);
-
-	struct i2c_client *battery_fg;
-
-	/* Type-C only */
-	struct i2c_client *fusb302;
-	struct i2c_client *pi3usb30532;
-
-	struct fwnode_handle *dp;
-};
-
-int cht_int33fe_microb_probe(struct cht_int33fe_data *data);
-int cht_int33fe_microb_remove(struct cht_int33fe_data *data);
-int cht_int33fe_typec_probe(struct cht_int33fe_data *data);
-int cht_int33fe_typec_remove(struct cht_int33fe_data *data);
-
-#endif /* _INTEL_CHT_INT33FE_COMMON_H */
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c
index 673f41cd14b5..6c2feca8a06f 100644
--- a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c
+++ b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c
@@ -18,6 +18,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -26,7 +27,9 @@
 #include <linux/slab.h>
 #include <linux/usb/pd.h>
 
-#include "intel_cht_int33fe_common.h"
+struct cht_int33fe_data {
+	struct i2c_client *battery_fg;
+};
 
 static const char * const bq27xxx_suppliers[] = { "bq25890-charger" };
 
@@ -39,10 +42,30 @@ static const struct software_node bq27xxx_node = {
 	.properties = bq27xxx_props,
 };
 
-int cht_int33fe_microb_probe(struct cht_int33fe_data *data)
+static const struct dmi_system_id cht_int33fe_microb_ids[] = {
+	{
+		/* Lenovo Yoga Book X90F / X91F / X91L */
+		.matches = {
+			/* Non exact match to match all versions */
+			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
+		},
+	},
+	{ }
+};
+MODULE_DEVICE_TABLE(dmi, cht_int33fe_microb_ids);
+
+static int cht_int33fe_microb_probe(struct platform_device *pdev)
 {
-	struct device *dev = data->dev;
 	struct i2c_board_info board_info;
+	struct device *dev = &pdev->dev;
+	struct cht_int33fe_data *data;
+
+	if (!dmi_check_system(cht_int33fe_microb_ids))
+		return -ENODEV;
+
+	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
 
 	memset(&board_info, 0, sizeof(board_info));
 	strscpy(board_info.type, "bq27542", ARRAY_SIZE(board_info.type));
@@ -53,9 +76,31 @@ int cht_int33fe_microb_probe(struct cht_int33fe_data *data)
 	return PTR_ERR_OR_ZERO(data->battery_fg);
 }
 
-int cht_int33fe_microb_remove(struct cht_int33fe_data *data)
+static int cht_int33fe_microb_remove(struct platform_device *pdev)
 {
+	struct cht_int33fe_data *data = platform_get_drvdata(pdev);
+
 	i2c_unregister_device(data->battery_fg);
 
 	return 0;
 }
+
+static const struct acpi_device_id cht_int33fe_acpi_ids[] = {
+	{ "INT33FE", },
+	{ }
+};
+
+static struct platform_driver cht_int33fe_microb_driver = {
+	.driver	= {
+		.name = "Intel Cherry Trail ACPI INT33FE micro-B driver",
+		.acpi_match_table = ACPI_PTR(cht_int33fe_acpi_ids),
+	},
+	.probe = cht_int33fe_microb_probe,
+	.remove = cht_int33fe_microb_remove,
+};
+
+module_platform_driver(cht_int33fe_microb_driver);
+
+MODULE_DESCRIPTION("Intel Cherry Trail ACPI INT33FE micro-B pseudo device driver");
+MODULE_AUTHOR("Yauhen Kharuzhy <jekhor@gmail.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
index d59544167430..0de509fbf020 100644
--- a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
+++ b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
@@ -17,6 +17,7 @@
  * for these chips can bind to the them.
  */
 
+#include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
@@ -26,7 +27,12 @@
 #include <linux/slab.h>
 #include <linux/usb/pd.h>
 
-#include "intel_cht_int33fe_common.h"
+struct cht_int33fe_data {
+	struct i2c_client *battery_fg;
+	struct i2c_client *fusb302;
+	struct i2c_client *pi3usb30532;
+	struct fwnode_handle *dp;
+};
 
 /*
  * Grrr, I severely dislike buggy BIOS-es. At least one BIOS enumerates
@@ -272,15 +278,44 @@ cht_int33fe_register_max17047(struct device *dev, struct cht_int33fe_data *data)
 	return PTR_ERR_OR_ZERO(data->battery_fg);
 }
 
-int cht_int33fe_typec_probe(struct cht_int33fe_data *data)
+static const struct dmi_system_id cht_int33fe_typec_ids[] = {
+	{
+		/*
+		 * GPD win / GPD pocket mini laptops
+		 *
+		 * This DMI match may not seem unique, but it is. In the 67000+
+		 * DMI decode dumps from linux-hardware.org only 116 have
+		 * board_vendor set to "AMI Corporation" and of those 116 only
+		 * the GPD win's and pocket's board_name is "Default string".
+		 */
+		.matches = {
+			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+			DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
+			DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
+		},
+	},
+	{ }
+};
+MODULE_DEVICE_TABLE(dmi, cht_int33fe_typec_ids);
+
+static int cht_int33fe_typec_probe(struct platform_device *pdev)
 {
-	struct device *dev = data->dev;
 	struct i2c_board_info board_info;
+	struct device *dev = &pdev->dev;
+	struct cht_int33fe_data *data;
 	struct fwnode_handle *fwnode;
 	struct regulator *regulator;
 	int fusb302_irq;
 	int ret;
 
+	if (!dmi_check_system(cht_int33fe_typec_ids))
+		return -ENODEV;
+
+	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
 	/*
 	 * We expect the WC PMIC to be paired with a TI bq24292i charger-IC.
 	 * We check for the bq24292i vbus regulator here, this has 2 purposes:
@@ -368,8 +403,10 @@ int cht_int33fe_typec_probe(struct cht_int33fe_data *data)
 	return ret;
 }
 
-int cht_int33fe_typec_remove(struct cht_int33fe_data *data)
+static int cht_int33fe_typec_remove(struct platform_device *pdev)
 {
+	struct cht_int33fe_data *data = platform_get_drvdata(pdev);
+
 	i2c_unregister_device(data->pi3usb30532);
 	i2c_unregister_device(data->fusb302);
 	i2c_unregister_device(data->battery_fg);
@@ -378,3 +415,23 @@ int cht_int33fe_typec_remove(struct cht_int33fe_data *data)
 
 	return 0;
 }
+
+static const struct acpi_device_id cht_int33fe_acpi_ids[] = {
+	{ "INT33FE", },
+	{ }
+};
+
+static struct platform_driver cht_int33fe_typec_driver = {
+	.driver	= {
+		.name = "Intel Cherry Trail ACPI INT33FE Type-C driver",
+		.acpi_match_table = ACPI_PTR(cht_int33fe_acpi_ids),
+	},
+	.probe = cht_int33fe_typec_probe,
+	.remove = cht_int33fe_typec_remove,
+};
+
+module_platform_driver(cht_int33fe_typec_driver);
+
+MODULE_DESCRIPTION("Intel Cherry Trail ACPI INT33FE Type-C pseudo device driver");
+MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
+MODULE_LICENSE("GPL v2");
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] platform/x86: intel_cht_int33fe: Drop Lenovo Yogabook YB1-X9x code
  2022-02-06 22:02 [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
  2022-02-06 22:02 ` [PATCH 2/4] platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading Hans de Goede
@ 2022-02-06 22:02 ` Hans de Goede
  2022-02-06 22:02 ` [PATCH 4/4] platform/x86: intel_cht_int33fe: Move to intel directory Hans de Goede
  2022-02-11  9:52 ` [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-06 22:02 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: Hans de Goede, platform-driver-x86

Move the Lenovo Yogabook YB1-X9x fuel-gauge instantiation code over to
the x86-android-tablets module, which already deals with this for various
other devices.

This removes the need to have a special intel_cht_int33fe_microb module
just for Lenovo Yogabook YB1-X9x laptops.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/intel/int33fe/Kconfig    |  18 ++-
 drivers/platform/x86/intel/int33fe/Makefile   |   2 +-
 .../intel/int33fe/intel_cht_int33fe_microb.c  | 106 ------------------
 drivers/platform/x86/x86-android-tablets.c    |  27 +++++
 4 files changed, 35 insertions(+), 118 deletions(-)
 delete mode 100644 drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c

diff --git a/drivers/platform/x86/intel/int33fe/Kconfig b/drivers/platform/x86/intel/int33fe/Kconfig
index 2f7329a2e399..60a6cb689299 100644
--- a/drivers/platform/x86/intel/int33fe/Kconfig
+++ b/drivers/platform/x86/intel/int33fe/Kconfig
@@ -6,19 +6,15 @@ config INTEL_CHT_INT33FE
 	depends on USB_ROLES_INTEL_XHCI=y || (USB_ROLES_INTEL_XHCI=m && m)
 	depends on TYPEC_MUX_PI3USB30532=y || (TYPEC_MUX_PI3USB30532=m && m)
 	help
-	  This driver add support for the INT33FE ACPI device found on
-	  some Intel Cherry Trail devices.
+	  This driver add support for the INT33FE ACPI device found on the
+	  GPD win and the GPD pocket.
 
-	  There are two kinds of INT33FE ACPI device possible: for hardware
-	  with USB Type-C and Micro-B connectors. This driver supports both.
-
-	  The INT33FE ACPI device has a CRS table with I2cSerialBusV2
-	  resources for Fuel Gauge Controller and (in the Type-C variant)
-	  FUSB302 USB Type-C Controller and PI3USB30532 USB switch.
+	  The INT33FE ACPI device on these mini laptops contains I2cSerialBusV2
+	  resources for a MAX17042 Fuel Gauge, FUSB302 USB Type-C Controller
+	  and PI3USB30532 USB switch.
 	  This driver instantiates i2c-clients for these, so that standard
 	  i2c drivers for these chips can bind to the them.
 
 	  If you enable this driver it is advised to also select
-	  CONFIG_BATTERY_BQ27XXX=m or CONFIG_BATTERY_BQ27XXX_I2C=m for Micro-B
-	  device and CONFIG_TYPEC_FUSB302=m and CONFIG_BATTERY_MAX17042=m
-	  for Type-C device.
+	  CONFIG_TYPEC_FUSB302=m, CONFIG_TYPEC_MUX_PI3USB30532=m and
+	  CONFIG_BATTERY_MAX17042=m.
diff --git a/drivers/platform/x86/intel/int33fe/Makefile b/drivers/platform/x86/intel/int33fe/Makefile
index 4672fcbec896..582aa7808c7a 100644
--- a/drivers/platform/x86/intel/int33fe/Makefile
+++ b/drivers/platform/x86/intel/int33fe/Makefile
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe_typec.o intel_cht_int33fe_microb.o
+obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe_typec.o
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c b/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c
deleted file mode 100644
index 6c2feca8a06f..000000000000
--- a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_microb.c
+++ /dev/null
@@ -1,106 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Intel Cherry Trail ACPI INT33FE pseudo device driver for devices with
- * USB Micro-B connector (e.g. without of FUSB302 USB Type-C controller)
- *
- * Copyright (C) 2019 Yauhen Kharuzhy <jekhor@gmail.com>
- *
- * At least one Intel Cherry Trail based device which ship with Windows 10
- * (Lenovo YogaBook YB1-X91L/F tablet), have this weird INT33FE ACPI device
- * with a CRS table with 2 I2cSerialBusV2 resources, for 2 different chips
- * attached to various i2c busses:
- * 1. The Whiskey Cove PMIC, which is also described by the INT34D3 ACPI device
- * 2. TI BQ27542 Fuel Gauge Controller
- *
- * So this driver is a stub / pseudo driver whose only purpose is to
- * instantiate i2c-client for battery fuel gauge, so that standard i2c driver
- * for these chip can bind to the it.
- */
-
-#include <linux/acpi.h>
-#include <linux/dmi.h>
-#include <linux/i2c.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/consumer.h>
-#include <linux/slab.h>
-#include <linux/usb/pd.h>
-
-struct cht_int33fe_data {
-	struct i2c_client *battery_fg;
-};
-
-static const char * const bq27xxx_suppliers[] = { "bq25890-charger" };
-
-static const struct property_entry bq27xxx_props[] = {
-	PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq27xxx_suppliers),
-	{ }
-};
-
-static const struct software_node bq27xxx_node = {
-	.properties = bq27xxx_props,
-};
-
-static const struct dmi_system_id cht_int33fe_microb_ids[] = {
-	{
-		/* Lenovo Yoga Book X90F / X91F / X91L */
-		.matches = {
-			/* Non exact match to match all versions */
-			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
-		},
-	},
-	{ }
-};
-MODULE_DEVICE_TABLE(dmi, cht_int33fe_microb_ids);
-
-static int cht_int33fe_microb_probe(struct platform_device *pdev)
-{
-	struct i2c_board_info board_info;
-	struct device *dev = &pdev->dev;
-	struct cht_int33fe_data *data;
-
-	if (!dmi_check_system(cht_int33fe_microb_ids))
-		return -ENODEV;
-
-	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
-		return -ENOMEM;
-
-	memset(&board_info, 0, sizeof(board_info));
-	strscpy(board_info.type, "bq27542", ARRAY_SIZE(board_info.type));
-	board_info.dev_name = "bq27542";
-	board_info.swnode = &bq27xxx_node;
-	data->battery_fg = i2c_acpi_new_device(dev, 1, &board_info);
-
-	return PTR_ERR_OR_ZERO(data->battery_fg);
-}
-
-static int cht_int33fe_microb_remove(struct platform_device *pdev)
-{
-	struct cht_int33fe_data *data = platform_get_drvdata(pdev);
-
-	i2c_unregister_device(data->battery_fg);
-
-	return 0;
-}
-
-static const struct acpi_device_id cht_int33fe_acpi_ids[] = {
-	{ "INT33FE", },
-	{ }
-};
-
-static struct platform_driver cht_int33fe_microb_driver = {
-	.driver	= {
-		.name = "Intel Cherry Trail ACPI INT33FE micro-B driver",
-		.acpi_match_table = ACPI_PTR(cht_int33fe_acpi_ids),
-	},
-	.probe = cht_int33fe_microb_probe,
-	.remove = cht_int33fe_microb_remove,
-};
-
-module_platform_driver(cht_int33fe_microb_driver);
-
-MODULE_DESCRIPTION("Intel Cherry Trail ACPI INT33FE micro-B pseudo device driver");
-MODULE_AUTHOR("Yauhen Kharuzhy <jekhor@gmail.com>");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c
index 8e6e4f89220f..f280c82d5ba5 100644
--- a/drivers/platform/x86/x86-android-tablets.c
+++ b/drivers/platform/x86/x86-android-tablets.c
@@ -679,6 +679,25 @@ static const struct x86_dev_info czc_p10t __initconst = {
 	.init = czc_p10t_init,
 };
 
+/* Lenovo Yoga Book X90F / X91F / X91L need manual instantiation of the fg client */
+static const struct x86_i2c_client_info lenovo_yogabook_x9x_i2c_clients[] __initconst = {
+	{
+		/* BQ27542 fuel-gauge */
+		.board_info = {
+			.type = "bq27542",
+			.addr = 0x55,
+			.dev_name = "bq27542",
+			.swnode = &fg_bq25890_supply_node,
+		},
+		.adapter_path = "\\_SB_.PCI0.I2C1",
+	},
+};
+
+static const struct x86_dev_info lenovo_yogabook_x9x_info __initconst = {
+	.i2c_client_info = lenovo_yogabook_x9x_i2c_clients,
+	.i2c_client_count = ARRAY_SIZE(lenovo_yogabook_x9x_i2c_clients),
+};
+
 /* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */
 static const char * const nextbook_ares8_accel_mount_matrix[] = {
 	"0", "-1", "0",
@@ -915,6 +934,14 @@ static const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
 		},
 		.driver_data = (void *)&czc_p10t,
 	},
+	{
+		/* Lenovo Yoga Book X90F / X91F / X91L */
+		.matches = {
+			/* Non exact match to match all versions */
+			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
+		},
+		.driver_data = (void *)&lenovo_yogabook_x9x_info,
+	},
 	{
 		/* Nextbook Ares 8 */
 		.matches = {
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] platform/x86: intel_cht_int33fe: Move to intel directory
  2022-02-06 22:02 [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
  2022-02-06 22:02 ` [PATCH 2/4] platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading Hans de Goede
  2022-02-06 22:02 ` [PATCH 3/4] platform/x86: intel_cht_int33fe: Drop Lenovo Yogabook YB1-X9x code Hans de Goede
@ 2022-02-06 22:02 ` Hans de Goede
  2022-02-11  9:52 ` [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-06 22:02 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: Hans de Goede, platform-driver-x86

Now that there is only 1 c-file left of the intel_cht_int33fe code,
move it to the intel directory instead of it having its own int33fe
sub-directory.

Note this also renames the module from intel_cht_int33fe_typec to
intel_chtwc_int33fe, to better match the names of other PMIC related
modules like the intel_chtdc_ti_pwrbtn module.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/intel/Kconfig            | 21 ++++++++++++++++++-
 drivers/platform/x86/intel/Makefile           |  3 ++-
 ...el_cht_int33fe_typec.c => chtwc_int33fe.c} |  0
 drivers/platform/x86/intel/int33fe/Kconfig    | 20 ------------------
 drivers/platform/x86/intel/int33fe/Makefile   |  2 --
 5 files changed, 22 insertions(+), 24 deletions(-)
 rename drivers/platform/x86/intel/{int33fe/intel_cht_int33fe_typec.c => chtwc_int33fe.c} (100%)
 delete mode 100644 drivers/platform/x86/intel/int33fe/Kconfig
 delete mode 100644 drivers/platform/x86/intel/int33fe/Makefile

diff --git a/drivers/platform/x86/intel/Kconfig b/drivers/platform/x86/intel/Kconfig
index 8e65086bb6c8..2d9b49eed33d 100644
--- a/drivers/platform/x86/intel/Kconfig
+++ b/drivers/platform/x86/intel/Kconfig
@@ -5,7 +5,6 @@
 
 source "drivers/platform/x86/intel/atomisp2/Kconfig"
 source "drivers/platform/x86/intel/int1092/Kconfig"
-source "drivers/platform/x86/intel/int33fe/Kconfig"
 source "drivers/platform/x86/intel/int3472/Kconfig"
 source "drivers/platform/x86/intel/pmc/Kconfig"
 source "drivers/platform/x86/intel/pmt/Kconfig"
@@ -89,6 +88,26 @@ config INTEL_CHTDC_TI_PWRBTN
 	  To compile this driver as a module, choose M here: the module
 	  will be called intel_chtdc_ti_pwrbtn.
 
+config INTEL_CHTWC_INT33FE
+	tristate "Intel Cherry Trail Whiskey Cove ACPI INT33FE Driver"
+	depends on X86 && ACPI && I2C && REGULATOR
+	depends on CHARGER_BQ24190=y || (CHARGER_BQ24190=m && m)
+	depends on USB_ROLES_INTEL_XHCI=y || (USB_ROLES_INTEL_XHCI=m && m)
+	depends on TYPEC_MUX_PI3USB30532=y || (TYPEC_MUX_PI3USB30532=m && m)
+	help
+	  This driver add support for the Intel Cherry Trail Whiskey Cove
+	  INT33FE ACPI device found on the GPD win and the GPD pocket.
+
+	  The INT33FE ACPI device on these mini laptops contains I2cSerialBusV2
+	  resources for a MAX17042 Fuel Gauge, FUSB302 USB Type-C Controller
+	  and PI3USB30532 USB switch.
+	  This driver instantiates i2c-clients for these, so that standard
+	  i2c drivers for these chips can bind to the them.
+
+	  If you enable this driver it is advised to also select
+	  CONFIG_TYPEC_FUSB302=m, CONFIG_TYPEC_MUX_PI3USB30532=m and
+	  CONFIG_BATTERY_MAX17042=m.
+
 config INTEL_ISHTP_ECLITE
 	tristate "Intel ISHTP eclite controller Driver"
 	depends on INTEL_ISH_HID
diff --git a/drivers/platform/x86/intel/Makefile b/drivers/platform/x86/intel/Makefile
index 35f2066578b2..053edc457ccb 100644
--- a/drivers/platform/x86/intel/Makefile
+++ b/drivers/platform/x86/intel/Makefile
@@ -6,7 +6,6 @@
 
 obj-$(CONFIG_INTEL_ATOMISP2_PDX86)	+= atomisp2/
 obj-$(CONFIG_INTEL_SAR_INT1092)		+= int1092/
-obj-$(CONFIG_INTEL_CHT_INT33FE)		+= int33fe/
 obj-$(CONFIG_INTEL_SKL_INT3472)		+= int3472/
 obj-$(CONFIG_INTEL_PMC_CORE)		+= pmc/
 obj-$(CONFIG_INTEL_PMT_CLASS)		+= pmt/
@@ -36,6 +35,8 @@ intel_crystal_cove_charger-y		:= crystal_cove_charger.o
 obj-$(CONFIG_X86_ANDROID_TABLETS)	+= intel_crystal_cove_charger.o
 intel_chtdc_ti_pwrbtn-y			:= chtdc_ti_pwrbtn.o
 obj-$(CONFIG_INTEL_CHTDC_TI_PWRBTN)	+= intel_chtdc_ti_pwrbtn.o
+intel_chtwc_int33fe-y			:= chtwc_int33fe.o
+obj-$(CONFIG_INTEL_CHTWC_INT33FE)	+= intel_chtwc_int33fe.o
 intel_mrfld_pwrbtn-y			:= mrfld_pwrbtn.o
 obj-$(CONFIG_INTEL_MRFLD_PWRBTN)	+= intel_mrfld_pwrbtn.o
 intel_punit_ipc-y			:= punit_ipc.o
diff --git a/drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c b/drivers/platform/x86/intel/chtwc_int33fe.c
similarity index 100%
rename from drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
rename to drivers/platform/x86/intel/chtwc_int33fe.c
diff --git a/drivers/platform/x86/intel/int33fe/Kconfig b/drivers/platform/x86/intel/int33fe/Kconfig
deleted file mode 100644
index 60a6cb689299..000000000000
--- a/drivers/platform/x86/intel/int33fe/Kconfig
+++ /dev/null
@@ -1,20 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-config INTEL_CHT_INT33FE
-	tristate "Intel Cherry Trail ACPI INT33FE Driver"
-	depends on X86 && ACPI && I2C && REGULATOR
-	depends on CHARGER_BQ24190=y || (CHARGER_BQ24190=m && m)
-	depends on USB_ROLES_INTEL_XHCI=y || (USB_ROLES_INTEL_XHCI=m && m)
-	depends on TYPEC_MUX_PI3USB30532=y || (TYPEC_MUX_PI3USB30532=m && m)
-	help
-	  This driver add support for the INT33FE ACPI device found on the
-	  GPD win and the GPD pocket.
-
-	  The INT33FE ACPI device on these mini laptops contains I2cSerialBusV2
-	  resources for a MAX17042 Fuel Gauge, FUSB302 USB Type-C Controller
-	  and PI3USB30532 USB switch.
-	  This driver instantiates i2c-clients for these, so that standard
-	  i2c drivers for these chips can bind to the them.
-
-	  If you enable this driver it is advised to also select
-	  CONFIG_TYPEC_FUSB302=m, CONFIG_TYPEC_MUX_PI3USB30532=m and
-	  CONFIG_BATTERY_MAX17042=m.
diff --git a/drivers/platform/x86/intel/int33fe/Makefile b/drivers/platform/x86/intel/int33fe/Makefile
deleted file mode 100644
index 582aa7808c7a..000000000000
--- a/drivers/platform/x86/intel/int33fe/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe_typec.o
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements
  2022-02-06 22:02 [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
                   ` (2 preceding siblings ...)
  2022-02-06 22:02 ` [PATCH 4/4] platform/x86: intel_cht_int33fe: Move to intel directory Hans de Goede
@ 2022-02-11  9:52 ` Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-11  9:52 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: platform-driver-x86

Hi,

On 2/6/22 23:02, Hans de Goede wrote:
> 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>

I've added this seriesto my review-hans (soon to be for-next) branch now.

Regards,

Hans



> ---
>  drivers/platform/x86/x86-android-tablets.c | 47 +++++++++++-----------
>  1 file 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",
>  	}, {
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-11  9:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-06 22:02 [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede
2022-02-06 22:02 ` [PATCH 2/4] platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading Hans de Goede
2022-02-06 22:02 ` [PATCH 3/4] platform/x86: intel_cht_int33fe: Drop Lenovo Yogabook YB1-X9x code Hans de Goede
2022-02-06 22:02 ` [PATCH 4/4] platform/x86: intel_cht_int33fe: Move to intel directory Hans de Goede
2022-02-11  9:52 ` [PATCH 1/4] platform/x86: x86-android-tablets: Minor charger / fuel-gauge improvements Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.