linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: axp288_fuel_gauge: Add the ECS EF20EA to the blacklist
@ 2020-12-09  4:50 Chris Chiu
  2020-12-09 14:57 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Chiu @ 2020-12-09  4:50 UTC (permalink / raw)
  To: sre, wens, hdegoede; +Cc: linux-pm, linux-kernel, linux, Chris Chiu

The ECS EF20EA laptop ships an AXP288 but it is actually using a
different, separate FG chip for AC and battery monitoring. On this
laptop we need to keep using the regular ACPI driver and disable the
AXP288 FG to avoid reporting two batteries to userspace.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
---
 drivers/power/supply/axp288_fuel_gauge.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index 148eb8105803..a15c322c79ea 100644
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -739,6 +739,12 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
 		}
 	},
+	{
+		/* ECS EF20 */
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "EF20"),
+		},
+	},
 	{}
 };
 
-- 
2.20.1


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

* Re: [PATCH] power: supply: axp288_fuel_gauge: Add the ECS EF20EA to the blacklist
  2020-12-09  4:50 [PATCH] power: supply: axp288_fuel_gauge: Add the ECS EF20EA to the blacklist Chris Chiu
@ 2020-12-09 14:57 ` Hans de Goede
  2020-12-10  3:25   ` Chris Chiu
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2020-12-09 14:57 UTC (permalink / raw)
  To: Chris Chiu, sre, wens; +Cc: linux-pm, linux-kernel, linux

Hi,

On 12/9/20 5:50 AM, Chris Chiu wrote:
> The ECS EF20EA laptop ships an AXP288 but it is actually using a
> different, separate FG chip for AC and battery monitoring. On this
> laptop we need to keep using the regular ACPI driver and disable the
> AXP288 FG to avoid reporting two batteries to userspace.
> 
> Signed-off-by: Chris Chiu <chiu@endlessos.org>
> ---
>  drivers/power/supply/axp288_fuel_gauge.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
> index 148eb8105803..a15c322c79ea 100644
> --- a/drivers/power/supply/axp288_fuel_gauge.c
> +++ b/drivers/power/supply/axp288_fuel_gauge.c
> @@ -739,6 +739,12 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
>  			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
>  		}
>  	},
> +	{
> +		/* ECS EF20 */
> +		.matches = {
> +			DMI_MATCH(DMI_PRODUCT_NAME, "EF20"),
> +		},
> +	},
>  	{}
>  };

The axp288_fuel_gauge_blacklist already has the following entry:

        {
                /* ECS EF20EA */
                .matches = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
                },
        },

So is this real entry really necessary? The existing entry
matches the quirk for this in drivers/acpi/battery.c:

        {
                /* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
                .callback = battery_do_not_check_pmic_quirk,
                .matches = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
                },
        },

And the one in drivers/acpi/ac.c:

        {
                /* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
                .callback = ac_do_not_check_pmic_quirk,
                .matches = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
                },
        },

So I don't think that this patch is necessary...

Regards,

Hans



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

* Re: [PATCH] power: supply: axp288_fuel_gauge: Add the ECS EF20EA to the blacklist
  2020-12-09 14:57 ` Hans de Goede
@ 2020-12-10  3:25   ` Chris Chiu
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Chiu @ 2020-12-10  3:25 UTC (permalink / raw)
  To: Hans de Goede; +Cc: sre, wens, Linux PM, Linux Kernel, linux

On Wed, Dec 9, 2020 at 10:57 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 12/9/20 5:50 AM, Chris Chiu wrote:
> > The ECS EF20EA laptop ships an AXP288 but it is actually using a
> > different, separate FG chip for AC and battery monitoring. On this
> > laptop we need to keep using the regular ACPI driver and disable the
> > AXP288 FG to avoid reporting two batteries to userspace.
> >
> > Signed-off-by: Chris Chiu <chiu@endlessos.org>
> > ---
> >  drivers/power/supply/axp288_fuel_gauge.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
> > index 148eb8105803..a15c322c79ea 100644
> > --- a/drivers/power/supply/axp288_fuel_gauge.c
> > +++ b/drivers/power/supply/axp288_fuel_gauge.c
> > @@ -739,6 +739,12 @@ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
> >                       DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
> >               }
> >       },
> > +     {
> > +             /* ECS EF20 */
> > +             .matches = {
> > +                     DMI_MATCH(DMI_PRODUCT_NAME, "EF20"),
> > +             },
> > +     },
> >       {}
> >  };
>
> The axp288_fuel_gauge_blacklist already has the following entry:
>
>         {
>                 /* ECS EF20EA */
>                 .matches = {
>                         DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
>                 },
>         },
>
> So is this real entry really necessary? The existing entry
> matches the quirk for this in drivers/acpi/battery.c:
>
>         {
>                 /* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
>                 .callback = battery_do_not_check_pmic_quirk,
>                 .matches = {
>                         DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
>                 },
>         },
>
> And the one in drivers/acpi/ac.c:
>
>         {
>                 /* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
>                 .callback = ac_do_not_check_pmic_quirk,
>                 .matches = {
>                         DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
>                 },
>         },
>
> So I don't think that this patch is necessary...
>
> Regards,
>
> Hans
>
>

Thanks for pointing that out. We kept this downstreamly for a long time and
didn't notice it's already there.

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

end of thread, other threads:[~2020-12-10  3:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09  4:50 [PATCH] power: supply: axp288_fuel_gauge: Add the ECS EF20EA to the blacklist Chris Chiu
2020-12-09 14:57 ` Hans de Goede
2020-12-10  3:25   ` Chris Chiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).