On 11/24/2017 06:37 AM, Greg Gallagher wrote:
> Hi,
>   I'm finishing up my work on a patch to add a RTDM gpio driver for
> the zynq-7000 platform.  I ran into a situation where I needed to call
> gpio_request in gpio-core because the zynq gpio driver uses the
> gpio_request function to enable the gpio pins on the board.
>     A side effect that I found when testing is that the driver will fail to
> load
> if another application has exported a gpio pin via sysfs and likewise sysfs
> won't allow anyone to export gpio pins once the rtdm gpio driver has been
> loaded.
> My implementation calls gpio_request on each pin as they are  registered
> under /dev/rtdm.
>     I'm not sure if the above is an issue or not, if the RTDM driver has
> claimed the
> gpio pins then I think it would make sense for them not to be accessible by
> applications
> via sysfs.  If my assumption is not correct then maybe one option could be
> to only call gpio_request on each pin as need, maybe via ioctl?
> 
> Any guidance would be appreciated,
> 

gpio-core deals with entire GPIO controllers, so claiming every pin from
every bank on the controller for rt usage unconditionally seems overkill.

The ioctl option seems a better option, but then you would have to be
careful about not conflicting with request_gpio_irq() which does request
input pins. rtdm_gpio_chan->requested tells whether a pin as already
been claimed.

-- 
Philippe.

_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai

Reply via email to