Thread (16 messages) 16 messages, 2 authors, 2017-05-31

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

From: Andy Shevchenko <hidden>
Date: 2017-05-30 18:36:03
Also in: linux-gpio, lkml

On Tue, May 30, 2017 at 10:01 AM, Jan Kiszka [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help