Re: [RFC v2 0/2] ACPI/power-suppy add fuel-gauge support on cht-wc PMIC without USB-PD support devs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 3, 2021 at 12:40 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:

...

> While working on this I realized that there also is a 4th option,
> which is basically option 1 from the v1 RFC minus the 2 gpiolib-acpi
> patches.
>
> With the 2nd option (as implemented by this RFC) we leave the
> _AEI handler in place and run the fuel-gauge without interrupt,
> we can do the same when marking the fuel-gauge as always present
> by treating IRQs on ACPI devices the same way as in the
> max17042_battery code, which has already solved the IRQ problem
> without disabling the _AEI handler:
>
>                 /*
>                  * On ACPI systems the IRQ may be handled by ACPI-event code,
>                  * so we need to share (if the ACPI code is willing to share).
>                  */

>                 if (acpi_id)

(Side remark: wouldn't it be better to have has_acpi_companion() and
use device_get_match_data()?)

>                         flags |= IRQF_SHARED | IRQF_PROBE_SHARED;
>
> This is a pretty decent option too, it requires:
>
> 1. 2 more always_present quirks in the ACPI scan code which is part of
> the main kernel image.
>
> 2. Patches to the bq27xxx_battery code to support ACPI enumeration.

If it works, why not try it?

I like the common base for the FG drivers that can be used as a pattern then.


-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux