Re: [PATCH v4 8/9] gpio-exar/8250-exar: Make set of exported GPIOs configurable

From: Andy Shevchenko
Date: Tue May 30 2017 - 14:36:06 EST


On Tue, May 30, 2017 at 10:01 AM, Jan Kiszka <jan.kiszka@xxxxxxxxxxx> wrote:
> On the SIMATIC, IOT2040 only a single pin is exportable as GPIO, the
> rest is required to operate the UART. To allow modeling this case,
> expand the platform device data structure to specify a (consecutive) pin
> subset for exporting by the gpio-exar driver.

> static void *
> -xr17v35x_register_gpio(struct pci_dev *pcidev)

> +xr17v35x_register_gpio(struct pci_dev *pcidev, unsigned int first_pin,
> + unsigned int ngpios)

I would rather to provide properties here as a parameter...

> {
> + struct property_entry properties[] = {
> + PROPERTY_ENTRY_U32("gpio-exar,first-pin", first_pin),
> + PROPERTY_ENTRY_U32("ngpios", ngpios),
> + { }
> + };

> if (pcidev->vendor == PCI_VENDOR_ID_EXAR)

...while defining them somewhere here.

> port->port.private_data =
> - xr17v35x_register_gpio(pcidev);
> + xr17v35x_register_gpio(pcidev, 0, 16);

--
With Best Regards,
Andy Shevchenko