Re: [PATCH 5/6] platform/chrome: cros_ec_lpc: Correct ACPI name for Framework Laptop

From: Tzung-Bi Shih
Date: Sat May 25 2024 - 21:26:35 EST


On Fri, May 24, 2024 at 07:35:22PM +0100, Ben Walsh wrote:
> Tzung-Bi Shih <tzungbi@xxxxxxxxxx> writes:
>
> > From the context you provided, instead of matching "PNP0C09" in the driver,
> > it makes more sense to me (for Framework EC):
> >
> > * Mainly use DMI match.
> > * Add a quirk for looking up (acpi_get_devices()?) and binding
> > (e.g. ACPI_COMPANION_SET()) the `adev` in cros_ec_lpc_probe().
>
> Sorry, I don't think I provided enough context. There is already a
> platform device /sys/bus/platform/devices/PNP0C09:00 with a companion
> acpi device /sys/bus/acpi/devices/PNP0C09:00. I think it makes sense to
> bind the driver to the existing platform device.
>
> I could add a new quirk which provides an alternative ACPI match table
> to be used instead of the default. In the default case the match_table
> will contain only "GOOG0004" as before. But in the Framework EC case the
> match table will be "PNP0C09".

I think it doesn't work as the current quirk is handling in
cros_ec_lpc_probe() which is after matching.

My original idea: would it be possible to get the `adev` in cros_ec_lpc_probe()
via any lookup API? If yes, it could still use DMI match and get `adev` if
required.