The gpio_export() call requires someone (the caller!) to
have requested the GPIO already. The "one owner" rule is
not being changed.
Right. Not unless we're debugging the driver managing
those GPIOs.
Well, I wouldn't call that "regular"! But then, I don't
have this "use GPIOs from userspace" focus. To me, that's
the exception not the rule.
I suppose I'd prefer to see a formal gpio_export() call from
the kernel as part of the BSP, if that's the model for how that
particular board stack should be used. But I suspect there will
be differing opinions on that point, especially from folk who
avoid custom kernels for whatever reasons. (Like, "that binary
has been qualified, this one hasn't.")
... intended purely for debugging, not for use with production
systems ...
I don't follow what you're saying here. GPIO numbering is deeply
specific to the hardware; so I'd say the relevant hardware docs are
what become mission-critical. The kernel can't know when some
field update has rewired a bunch of GPIOs, for example...
Trent pointed out that dynamic range assignment can make trouble,
so I can see some help might be needed here. Were you suggesting
something like a /sys/class/gpio/chips file with contents like
0-15 gpio
16-31 gpio
32-47 gpio
48-63 gpio
192-207 mpuio
208-213 tps65010
(Matching a stock OMAP 5912 OSK board, for what it's worth.)
Sysfs attributes are supposed to be pollable. I've not done it,
but fs/sysfs/file.c::sysfs_notify() looks relevant ...
We accept patches. Even patches on top of patches. ;)
- Dave
--