Re: [PATCH 2/2] Make non-linear GPIO ranges accesible from gpiolib
From: Stephen Warren <hidden>
Date: 2013-06-25 15:22:09
Also in:
lkml
On 06/25/2013 08:32 AM, Linus Walleij wrote:
On Fri, Jun 21, 2013 at 11:17 PM, Stephen Warren [off-list ref] wrote:quoted
On 06/20/2013 05:57 AM, Christian Ruppert wrote:quoted
The Linux pinctrl subsystem specifically doesn't provide mutual exclusion between "mux function" and GPIO usage within a pin group, although perhaps a driver could internally.It used to block this at one point. But it doesn't make sense when the hardware looks like so:quoted
quoted
+- SPI Physical pins --- GPIO --- pinctrl -+- I2C +- mmcAs in this case it is perfectly legal to enable the GPIO as input while the I2C bus is running and "spy" on the signals. The driver should probably not allow the GPIO output to be driven while some peripheral is muxed in though, that could be disastrous...
Well, in the HW diagram above, GPIO output probably simply overrides "mux function" output, so everything would work as requested. Whether it makes sense to request such an override is a policy question that pinctrl itself probably shouldn't decide. After all, what if there's a pin group containing 4 pins, which are used by the board as 2 GPIO and 2 I2C. pinctrl shouldn't disallow selecting GPIO on any pin in that pin group simply because I2C is selected on it; that fact doesn't necessarily mean that the selected mux function actually uses every single pin in the group.