[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd2ytGkaSDZXuKNLihsK5JYrFv5ezkTAd73o2xFjoNDHQ@mail.gmail.com>
Date: Tue, 16 Nov 2021 17:19:07 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Hans de Goede <hdegoede@...hat.com>
Cc: "Rafael J . Wysocki" <rjw@...ysocki.net>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Mark Gross <markgross@...nel.org>,
Andy Shevchenko <andy@...radead.org>,
Wolfram Sang <wsa@...-dreams.de>,
Sebastian Reichel <sre@...nel.org>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Ard Biesheuvel <ardb@...nel.org>, Len Brown <lenb@...nel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Yauhen Kharuzhy <jekhor@...il.com>,
Tsuchiya Yuto <kitakar@...il.com>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
linux-i2c <linux-i2c@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-efi <linux-efi@...r.kernel.org>
Subject: Re: [PATCH v2 19/20] extcon: intel-cht-wc: Add support for
registering a power_supply class-device
On Sun, Nov 14, 2021 at 7:05 PM Hans de Goede <hdegoede@...hat.com> wrote:
>
> The bq25890 used on the Yogabook YB1-X90 / -X91 models relies on
> the extcon-driver's BC-1.2 charger detection, and the bq25890 driver
> expect this info to be available through a parent power_supply
> class-device which models the detected charger (idem to how the Type-C
> TCPM code registers a power_supply classdev for the connected charger).
>
> Add support for registering the power_supply class-device expected
> by this setup.
...
> + struct cht_wc_extcon_data *ext = power_supply_get_drvdata(psy);
> + int ret = 0;
Not needed.
> + switch (psp) {
> + case POWER_SUPPLY_PROP_USB_TYPE:
> + val->intval = ext->usb_type;
> + break;
> + case POWER_SUPPLY_PROP_ONLINE:
> + val->intval = ext->usb_type ? 1 : 0;
> + break;
> + default:
> + ret = -EINVAL;
> + break;
return -EINVAL;
> + }
> +
> + return ret;
return 0;
> +}
P.S. And here you have a "break", which is nice!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists