All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel_cht_int33fe: Set supplied-from property on max17047 dev
@ 2017-05-26 10:53 Hans de Goede
  2017-05-30 13:22 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2017-05-26 10:53 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Hans de Goede, platform-driver-x86, linux-kernel

Devices with the intel_cht_int33fe ACPI device use a max17047 fuel-gauge
combined with a bq24272i charger, in order for the fuel-gauge driver to
correctly display charging / discharging status it needs to know which
charger is supplying the battery.

This commit sets the supplied-from device property to the name of the
bq24272i charger for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/intel_cht_int33fe.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c
index 6a1b2ca5b6fe..da706e2c4232 100644
--- a/drivers/platform/x86/intel_cht_int33fe.c
+++ b/drivers/platform/x86/intel_cht_int33fe.c
@@ -34,6 +34,13 @@ struct cht_int33fe_data {
 	struct i2c_client *pi3usb30532;
 };
 
+static const char * const max17047_suppliers[] = { "bq24190-charger" };
+
+static const struct property_entry max17047_props[] = {
+	PROPERTY_ENTRY_STRING_ARRAY("supplied-from", max17047_suppliers),
+	{ }
+};
+
 static int cht_int33fe_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
@@ -70,6 +77,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
 
 	memset(&board_info, 0, sizeof(board_info));
 	strlcpy(board_info.type, "max17047", I2C_NAME_SIZE);
+	board_info.properties = max17047_props;
 
 	data->max17047 = i2c_acpi_new_device(dev, 1, &board_info);
 	if (!data->max17047)
-- 
2.13.0

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

* Re: [PATCH] platform/x86: intel_cht_int33fe: Set supplied-from property on max17047 dev
  2017-05-26 10:53 [PATCH] platform/x86: intel_cht_int33fe: Set supplied-from property on max17047 dev Hans de Goede
@ 2017-05-30 13:22 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2017-05-30 13:22 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Darren Hart, Andy Shevchenko, Platform Driver, linux-kernel

On Fri, May 26, 2017 at 1:53 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Devices with the intel_cht_int33fe ACPI device use a max17047 fuel-gauge
> combined with a bq24272i charger, in order for the fuel-gauge driver to
> correctly display charging / discharging status it needs to know which
> charger is supplying the battery.
>
> This commit sets the supplied-from device property to the name of the
> bq24272i charger for this.

Pushed to testing, thanks!

>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/platform/x86/intel_cht_int33fe.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c
> index 6a1b2ca5b6fe..da706e2c4232 100644
> --- a/drivers/platform/x86/intel_cht_int33fe.c
> +++ b/drivers/platform/x86/intel_cht_int33fe.c
> @@ -34,6 +34,13 @@ struct cht_int33fe_data {
>         struct i2c_client *pi3usb30532;
>  };
>
> +static const char * const max17047_suppliers[] = { "bq24190-charger" };
> +
> +static const struct property_entry max17047_props[] = {
> +       PROPERTY_ENTRY_STRING_ARRAY("supplied-from", max17047_suppliers),
> +       { }
> +};
> +
>  static int cht_int33fe_probe(struct i2c_client *client)
>  {
>         struct device *dev = &client->dev;
> @@ -70,6 +77,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
>
>         memset(&board_info, 0, sizeof(board_info));
>         strlcpy(board_info.type, "max17047", I2C_NAME_SIZE);
> +       board_info.properties = max17047_props;
>
>         data->max17047 = i2c_acpi_new_device(dev, 1, &board_info);
>         if (!data->max17047)
> --
> 2.13.0
>



-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2017-05-30 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 10:53 [PATCH] platform/x86: intel_cht_int33fe: Set supplied-from property on max17047 dev Hans de Goede
2017-05-30 13:22 ` Andy Shevchenko

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.