c6ca7ce
From 99c44df299d96db6a170ccce9b8108fc2e7f8bae Mon Sep 17 00:00:00 2001
c6ca7ce
From: Hans de Goede <hdegoede@redhat.com>
c6ca7ce
Date: Tue, 2 May 2017 13:40:44 +0200
c6ca7ce
Subject: [PATCH 04/16] platform/x86: intel_cht_int33fe: Set supplied-from
c6ca7ce
 property on max17047 dev
c6ca7ce
c6ca7ce
Devices with the intel_cht_int33fe ACPI device use a max17047 fuel-gauge
c6ca7ce
combined with a bq24272i charger, in order for the fuel-gauge driver to
c6ca7ce
correctly display charging / discharging status it needs to know which
c6ca7ce
charger is supplying the battery.
c6ca7ce
c6ca7ce
This commit sets the supplied-from device property to the name of the
c6ca7ce
bq24272i charger for this.
c6ca7ce
c6ca7ce
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c6ca7ce
---
c6ca7ce
 drivers/platform/x86/intel_cht_int33fe.c | 8 ++++++++
c6ca7ce
 1 file changed, 8 insertions(+)
c6ca7ce
c6ca7ce
diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c
c6ca7ce
index 6a1b2ca5b6fe..da706e2c4232 100644
c6ca7ce
--- a/drivers/platform/x86/intel_cht_int33fe.c
c6ca7ce
+++ b/drivers/platform/x86/intel_cht_int33fe.c
c6ca7ce
@@ -34,6 +34,13 @@ struct cht_int33fe_data {
c6ca7ce
 	struct i2c_client *pi3usb30532;
c6ca7ce
 };
c6ca7ce
 
c6ca7ce
+static const char * const max17047_suppliers[] = { "bq24190-charger" };
c6ca7ce
+
c6ca7ce
+static const struct property_entry max17047_props[] = {
c6ca7ce
+	PROPERTY_ENTRY_STRING_ARRAY("supplied-from", max17047_suppliers),
c6ca7ce
+	{ }
c6ca7ce
+};
c6ca7ce
+
c6ca7ce
 static int cht_int33fe_probe(struct i2c_client *client)
c6ca7ce
 {
c6ca7ce
 	struct device *dev = &client->dev;
c6ca7ce
@@ -70,6 +77,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
c6ca7ce
 
c6ca7ce
 	memset(&board_info, 0, sizeof(board_info));
c6ca7ce
 	strlcpy(board_info.type, "max17047", I2C_NAME_SIZE);
c6ca7ce
+	board_info.properties = max17047_props;
c6ca7ce
 
c6ca7ce
 	data->max17047 = i2c_acpi_new_device(dev, 1, &board_info);
c6ca7ce
 	if (!data->max17047)
c6ca7ce
-- 
c6ca7ce
2.13.0
c6ca7ce