Very briefly:
Entries in /sys
are not really files. This mount is of type sysfs
, and in the kernel this corresponds to an API where other parts of the kernel can register themselves. Then when the "files" of this file system are read or written, sysfs forwards these actions to the registered modules.
The gpio
(general purpose I/O) layer of the kernel is again an abstractions where other drivers can registers. Typically these are drivers of chips or chipsets which have GPIO registers in the chips themselves. How the GPIO pins of these chips are wired depends on the hardware.
A bit more information can be found in Documentation/gpio/gpio.txt
etc. in the kernel source code.
As for ways to identify the driver, one way is to ll gpio432
after you have created the gpio node and look at the symlink; it will point to the device that has the chip/chipset with the GPIO registers. Then look for the driver for that device.
Another way would be to look through dmesg
and see if the driver produces messages when it registers the GPIO.
Possibly this information can also be accessed via udevadm
.
/sys
hierarchy?