Re: [PATCH] winmate-fm07-keys: Winmate FM07/FM07P buttons

From: Daniel Beer
Date: Mon Mar 21 2022 - 18:06:01 EST


On Mon, Mar 21, 2022 at 08:13:15PM +0000, Barnabás Pőcze wrote:
> > +#define PORT_CMD 0x6c
> > +#define PORT_DATA 0x68
> > +
> > +#define EC_ADDR_KEYS 0x3b
> > +#define EC_CMD_READ 0x80
>
> It seems you are reading from the embedded controller, have you checked if the
> ACPI EC driver works? Then you could probably just use the `ec_{read,write}()` functions.

Hi Barnabás,

There is already an ACPI EC driver working on this system, but it's
using ports 0x66 and 0x62. I guess this one is something unrelated,
although it does appear to use the same protocol.

I might be missing something, but it doesn't look like I can use the ec_
functions in this case as they will direct everything towards the EC at
0x66/0x62. Is there anything else you'd suggest?

If it helps to know, the hardware vendor shipped an Ubuntu distribution
with a kernel module that just exposed the ability to read/write ports
0x6c/0x68 via chardev ioctls, and then a proprietary userspace program
polled for button states.

I'll address your other comments in v2.

Cheers,
Daniel

--
Daniel Beer
Software Development Manager
Tirotech Ltd