Re: [PATCH 2/2] gpio-f7188x: filter non-export gpio for F81866

From: Peter Hung
Date: Tue Jan 12 2016 - 20:56:24 EST


Hi Simon,

@@ -351,6 +485,15 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
for (i = 0; i < data->nr_bank; i++) {
struct f7188x_gpio_bank *bank = &data->bank[i];

+ /*
+ * Dont export GPIO sysfs if pin set is not enable by MB
+ * manufacturer.

What does MB stands for ?

The MB is stands for "Motherboard", Due to the limit of 80 words length,
I use the abbreviation.

+ */
+ if (sio->type == f81866 && f81866_verify_gpioset(sio->addr, i))
+ continue;

This whole filtering mechanism relies on the fact that the multiplexing
configuration has been correctly applied by the BIOS (if applied at
all). But I wonder if it is often the case. For example, I have several
boards for which it is not true. And to make the GPIOs available, I need
first to fix the multiplexing pin configuration of the Super I/O.

Maybe it would be more correct to rely on the hardware description of a
board (Device Tree or ACPI) to decide which GPIO bank can be enabled or
not.

That's good for control by Device Tree or ACPI.

IMO, we shouldn't export GPIOs not enabled if the BIOS had written
wrong configuration to SuperIO, but it's only my opinion. Should I
do filter for this?

Thanks for your advices.
--
With Best Regards,
Peter Hung